Skip Navigation

[Resolved] Switching to PHP 703 causes wpv-if to not be recognized?

This thread is resolved. Here is a description of the problem and solution.

Problem:

Test a local instance of a site for PHP 7 compatibility, but there are a bunch of [wpv-if] shortcodes displayed.

Solution:

You can replace all [wpv-if] shortcodes with [wpv-conditional] shortcodes, and test again.

Relevant Documentation:

https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional

100% of people find this useful.

This support ticket is created 6 years ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by jeffS-2 6 years ago.

Assisted by: Luo Yang.

Author
Posts
#1154129
Screen Shot 2018-11-27 at 3.52.06 PM.png

I am trying to: Test a local instance of a site for PHP 7 compatibility.

Link to a page where the issue can be seen: hidden link

I expected to see: The standard view for my upcoming event.

Instead, I got: Most of the view for the single event still displays, but there are a bunch of [/wpv-if] shortcodes displayed.

WP 4.9.8, PHP 7.0.3, MySQL 5.6.34, nginx, Custom 1.3.1

Site: IEEE-CNSV.local
Live Link: hidden link

Content template for event-single:


<div class="upcomingEventPg_info_contnr">
  <div class="upcomingEventPg_title"><h3>[wpv-post-title]</h3></div> 
  <div class="upcomingEventPg_speaker">
    [wpv-if spkrsemail="wpcf-speakers-email" evaluate="!empty($spkrsemail)"]<a href='mailto:[types field="speakers-email" raw="true"][/types]?subject=Inquiry from CNSV talk'>[types field="name-of-speaker"][/types]</a>[/wpv-if][wpv-if spkrsemail="wpcf-speakers-email" evaluate="empty($spkrsemail)"][types field="name-of-speaker" raw="true"][/types][/wpv-if][wpv-if compnyname="wpcf-speakers-company-name" evaluate="!empty($compnyname)"][wpv-if spkrswebsit="wpcf-speakers-website" evaluate="!empty($spkrswebsit)"] of <a href='[types field="speakers-website" raw="true"][/types]' target='_blank'>[types field="speakers-company-name"][/types]</a>[/wpv-if][wpv-if spkrswebsit="wpcf-speakers-website" evaluate="empty($spkrswebsit)"] of [types field="speakers-company-name" raw="true"][/types][/wpv-if][/wpv-if][wpv-if existspkr2="wpcf-add-speaker-no-2-info" evaluate="$existspkr2 = '1'"][wpv-if spkrsemail="wpcf-speaker-no-2-email" evaluate="!empty($spkrsemail)"]&comma; <a href='mailto:[types field="speaker-no-2-email" raw="true"][/types]?subject=Inquiry from CNSV talk'>[types field="name-of-speaker-no-2"][/types]</a>[/wpv-if][wpv-if spkrsemail="wpcf-speaker-no-2-email" evaluate="empty($spkrsemail)"]&comma; [types field="name-of-speaker-no-2" raw="true"][/types][/wpv-if][/wpv-if][wpv-if existspkr3="wpcf-add-speaker-no-3-info" evaluate="$existspkr3 = '1'"][wpv-if spkrsemail="wpcf-speaker-no-3-email" evaluate="!empty($spkrsemail)"]&comma; <a href='mailto:[types field="speaker-no-3-email" raw="true"][/types]?subject=Inquiry from CNSV talk'>[types field="name-of-speaker-no-3"][/types]</a>[/wpv-if][wpv-if spkrsemail="wpcf-speaker-no-3-email" evaluate="empty($spkrsemail)"]&comma; [types field="name-of-speaker-no-3" raw="true"][/types][/wpv-if][/wpv-if][wpv-if existspkr4="wpcf-add-speaker-no-4-info" evaluate="$existspkr4 = '1'"][wpv-if spkrsemail="wpcf-speaker-no-4-email" evaluate="!empty($spkrsemail)"]&comma; <a href='mailto:[types field="speaker-no-4-email" raw="true"][/types]?subject=Inquiry from CNSV talk'>[types field="name-of-speaker-no-4"][/types]</a>[/wpv-if][wpv-if spkrsemail="wpcf-speaker-no-4-email" evaluate="empty($spkrsemail)"]&comma; [types field="name-of-speaker-no-4" raw="true"][/types][/wpv-if][/wpv-if][wpv-if existspkr5="wpcf-add-speaker-no-5-info" evaluate="$existspkr5 = '1'"][wpv-if spkrsemail="wpcf-speaker-no-5-email" evaluate="!empty($spkrsemail)"]&comma; <a href='mailto:[types field="speaker-no-5-email" raw="true"][/types]?subject=Inquiry from CNSV talk'>[types field="name-of-speaker-no-5"][/types]</a>[/wpv-if][wpv-if spkrsemail="wpcf-speaker-no-5-email" evaluate="empty($spkrsemail)"]&comma; [types field="name-of-speaker-no-5" raw="true"][/types][/wpv-if][/wpv-if] [wpv-if existspkr6="wpcf-add-speaker-no-6-info" evaluate="$existspkr6 = '1'"][wpv-if spkrsemail="wpcf-speaker-no-6-email" evaluate="!empty($spkrsemail)"]&comma; <a href='mailto:[types field="speaker-no-6-email" raw="true"][/types]?subject=Inquiry from CNSV talk'>[types field="name-of-speaker-no-6"][/types]</a>[/wpv-if][wpv-if spkrsemail="wpcf-speaker-no-6-email" evaluate="empty($spkrsemail)"]&comma; [types field="name-of-speaker-no-6" raw="true"][/types][/wpv-if][/wpv-if] [wpv-if existspkr7="wpcf-add-speaker-no-7-info" evaluate="$existspkr7 = '1'"][wpv-if spkrsemail="wpcf-speaker-no-7-email" evaluate="!empty($spkrsemail)"]&comma; <a href='mailto:[types field="speaker-no-7-email" raw="true"][/types]?subject=Inquiry from CNSV talk'>[types field="name-of-speaker-no-7"][/types]</a>[/wpv-if][wpv-if spkrsemail="wpcf-speaker-no-7-email" evaluate="empty($spkrsemail)"]&comma; [types field="name-of-speaker-no-7" raw="true"][/types][/wpv-if][/wpv-if] [wpv-if existspkr8="wpcf-add-speaker-no-8-info" evaluate="$existspkr8 = '1'"][wpv-if spkrsemail="wpcf-speaker-no-8-email" evaluate="!empty($spkrsemail)"]&comma; <a href='mailto:[types field="speaker-no-8-email" raw="true"][/types]?subject=Inquiry from CNSV talk'>[types field="name-of-speaker-no-8"][/types]</a>[/wpv-if][wpv-if spkrsemail="wpcf-speaker-no-8-email" evaluate="empty($spkrsemail)"]&comma; [types field="name-of-speaker-no-8" raw="true"][/types][/wpv-if][/wpv-if]
  </div> 
  <!-- upcomingEventPg_speaker -->
  <div class="upcomingEventPg_date">[wpv-if eventtype="wpcf-event-type" evaluate="$eventtype != '3'"][types field="event-date-time" style="text" format="l, M j, Y - g:i a"][/types] [wpv-if existendtime ="wpcf-event-end-time" evaluate="!empty($existendtime)"]  to [types field="event-end-time" style="text" format="g:i a"][/types][/wpv-if][/wpv-if] [wpv-if eventtype="wpcf-event-type" evaluate="$eventtype = '3'"][types field="event-date-time" style="text" format="l, M j, Y"][/types][wpv-if existendtime="wpcf-event-end-time" evaluate="!empty($existendtime)"][wpv-if evaluate="'[wpv-post-id]' != '22772'"] - [types field="event-end-time" style="text" format="l, M j, Y"][/types][/wpv-if][/wpv-if][/wpv-if][wpv-if preslidesavail="wpcf-presentation-slides" evaluate="!empty($preslidesavail)"]         <a id="eventpdfslidesicon" href="#recordingorslides" title="View/Downoad PDF slides..."><img src="<em><u>hidden link</u></em>" width="20" height="20"  class="size-thumbnail" /></a>[/wpv-if] [wpv-if liverecavail="wpcf-video-recording-vim-id-no"  evaluate="!empty($liverecavail)"] <a id="eventvideoicon" href="#recordingorslides" title="Watch video..."><img src="<em><u>hidden link</u></em>" width="20" height="20"  class="size-thumbnail" /></a>[/wpv-if] </div>  <!-- upcomingEventPg_date -->
  <div class="upcomingEventPg_location">[wpv-if locationlink="wpcf-link-for-name-of-location" evaluate="!empty($locationlink)"]Location: <a href="[types field="link-for-name-of-location" raw="true"][/types]" target="_blank">[types field="name-of-event-location" raw="true"][/types] </a> 
    [wpv-if existsig1title="wpcf-sig1-mtg-title" evaluate="!empty($existsig1title)"]<br /><span style="font-size:0.9rem;">6 - 7 PM:  [types field="sig1-name"][/types] – [types field="sig1-mtg-title"][/types]</span>[/wpv-if]
    [wpv-if existsig2title="wpcf-sig2-mtg-title" evaluate="!empty($existsig2title)"]<br /><span style="font-size:0.9rem;">6 - 7 PM:  [types field="sig2-name"][/types] – [types field="sig2-mtg-title"][/types]</span>[/wpv-if]
    [wpv-if existsig3title="wpcf-sig3-mtg-title" evaluate="!empty($existsig3title)"]<br /><span style="font-size:0.9rem;">6 - 7 PM:  [types field="sig3-name"][/types] – [types field="sig3-mtg-title"][/types]</span>[/wpv-if]
    [wpv-if existsig4title="wpcf-sig4-mtg-title" evaluate="!empty($existsig4title)"]<br /><span style="font-size:0.9rem;">6 - 7 PM:  [types field="sig4-name"][/types] – [types field="sig4-mtg-title"][/types]</span>[/wpv-if]
    [/wpv-if] [wpv-if locationlink="wpcf-link-for-name-of-location" evaluate="empty($locationlink)"]Location: [types field="name-of-event-location" raw="true"][/types][/wpv-if]
  </div> 
  <!-- upcomingEventPg_location -->
  [wpv-if namofspkr="wpcf-name-of-speaker" evaluate="!empty($namofspkr)"]
    <div class="upcomingEventPg_eventLogo" style="margin-top:-3rem !important;">
      [types field="conference-logo"  align="center" title="Event Logo"][/types] 
    </div>
  [/wpv-if]
  [wpv-if namofspkr="wpcf-name-of-speaker" evaluate="empty($namofspkr)"]
      <div class="upcomingEventPg_eventLogo" style="margin-top:-1rem !important;">
        [types field="conference-logo"  align="center" title="Event Logo"][/types] 
      </div>
  [/wpv-if]  
 [wpv-conditional if="( $(wpcf-event-date-time) gte ('TODAY()'))"]
  [wpv-if evntcost="wpcf-event-cost" evaluate="!empty($evntcost)"]
      <div class="upcomingEventPg_eventCost">
        [types field="event-cost"][/types]
      </div>
  [/wpv-if]
  [wpv-if evntcost="wpcf-event-cost" evaluate="empty($evntcost)"]
     <div class="upcomingEventPg_eventCost">
        This event is Free!
     </div>
  [/wpv-if]  
 [/wpv-conditional]

  <hr class="hr_upcomingEventPg" />

#1154453

Hello,

In your screenshot, the problems occur only to [wpv-if] shortcodes, it is a legacy shortcode from old version, it is replaced with [wpv-conditional] shortcode, in your case, you are wrapping [wpv-if] within [wpv-conditional] shortcode, it will conduct unexpected result.
I suggest you replace all [wpv-if] shortcodes with [wpv-conditional] shortcodes, and test again.

But [wpv-conditional] shortcode has different attributes from [wpv-if], for example, you can replace the shortcode, from:

[wpv-if evntcost="wpcf-event-cost" evaluate="!empty($evntcost)"]
      <div class="upcomingEventPg_eventCost">
        [types field="event-cost"][/types]
      </div>
  [/wpv-if]

To:

[wpv–conditional if="( !empty($(wpcf-event-cost))  )"]
      <div class="upcomingEventPg_eventCost">
        [types field="event-cost"][/types]
      </div>
  [/wpv–conditional]

More help:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional

And you can enable the "debug" attribute in shortcode [wpv-conditional] to test and debug it.

#1155165

My issue is resolved now. Thank you!