Skip Navigation

[Resolved] shortcodes are not parsed when nested [wpv-conditional] are used

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Shane 6 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#534309

Something is really broken with wpv-conditional tags parsing and it seems to be a new issue, because it used to work.

This is my code:

<section class="single-ad">
  [wpv-conditional if="( $(wpcf-is-external) ne '1' )"]
  <div class="single-ad__contact-form">

    <div class="single-ad__contact-box">

      <div class="contact-box">
        [wpv-conditional if="( $(wpcf-contact-first-name) != '' )"]
        <div class="contact-box__item">
          <p class="contact-box__label">
            Contact person
          </p>
          <p class="contact-box__text">
            [types field="contact-first-name"][/types]
          </p>
        </div>
        [/wpv-conditional]
      </div>
      <!-- /.contact-box -->

    </div>
    <!-- /.single-ad__contact-box -->

  </div>
  <!-- .single-ad__contact-form -->
  [/wpv-conditional]
</section>
<!-- /.single-ad -->

When both conditions are evaluated to `true` I'm expecting the `[types field="contact-first-name"][/types]` shortcode to be parsed and see it's value. But the shortcode is not parsed. Instead of its value I see the `[types field="contact-first-name"][/types]` text.

I thought that maybe I messed up quotes, so I played a little replacing single quotes with double quotes, etc. It didn't help.

Then I tried to unwrap the code from the outer `[wpv-conditional]`.

<div class="contact-box">
  [wpv-conditional if="( $(wpcf-contact-first-name) != '' )"]
  <div class="contact-box__item">
    <p class="contact-box__label">
      Contact person
    </p>
    <p class="contact-box__text">
      [types field="contact-first-name"][/types]
    </p>
  </div>
  [/wpv-conditional]
</div>
<!-- /.contact-box -->

Surprisingly this code works fine. The types shortcode is parsed properly (I can see it's value). But it's not a solution because I need the outer conditional. So I made more tests and I found that when I get rid of the inner conditional HTML then the types shortcode is parsed properly!

<section class="single-ad">
  [wpv-conditional if="( $(wpcf-is-external) ne '1' )"]
  <div class="single-ad__contact-form">

    <div class="single-ad__contact-box">

      <div class="contact-box">
        [wpv-conditional if="( $(wpcf-contact-first-name) != '' )"]
            [types field="contact-first-name"][/types]
        [/wpv-conditional]
      </div>
      <!-- /.contact-box -->

    </div>
    <!-- /.single-ad__contact-box -->

  </div>
  <!-- .single-ad__contact-form -->
  [/wpv-conditional]
</section>
<!-- /.single-ad -->

Of course getting rid of the HTML is not a solution, but for some strange reason the HTML that's inside the inner `[wpv-conditional]` breaks the parser. This is very weird.

#534383

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lapala,

Thank you fro contacting our support forum.

What I can do is to check on this issue and verify that it also exists in a fresh install.

Once i've done this I can make a formal report about it to our development team for further debugging.

I'll post to you any new information that I find.

Thanks,
Shane

#534444

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lapala,

I'm not able to replicate this problem.

Would you mind providing me with admin access to your website so that I can have a more detailed look at the issue?

The private fields will be enabled for your next response.

Thanks,
Shane

#534714

You can make my posts public. I will not post any credentials here. Please restore my previous comment. Don't make this post private, it might be useful for other users.

#534748

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lapala,

I understand the concern but allowing me to take a look at the site would allow me to help you debug and see what is causing the issue.

Can you recall when this issue started happening, maybe there was a new plugin installed? Also you can provide me with a duplicator package of the website so that I can debug the issue from my local host.

To provide the duplicator package please have a look at the link below.
https://toolset.com/faq/provide-supporters-copy-site/

Thanks,
Shane

#534801

> I understand the concern but allowing me to take a look at the site would allow me to help you debug and see what is causing the issue.

Sorry, but I can't give you an access to the site. I also can't give you the full database dump. I can make an export of Types/Views/Cred if it works for you.

> Can you recall when this issue started happening

As I said in the first post it used to work before Views plugin update. I think it started to happen after the latest Views/Types update - I've updated both plugins at the same time. Now I use the most recent version of both plugins: Views 2.4.0, Types 2.1.12. I don't remember what was the exact version number of Views before update, but I'm sure it was 2.3.x.

#534814

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Lapala,

Yes providing the exports should be fine however if i'm still not able to see the issue then a full backup will be needed to debug.

Beyond this i'm not able to help much since i'm not able to replicate the issue on a fresh install.

I'll however try my best to get this problem resolved.

Thanks,
Shane

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.