Hi! After updating to the latest Types and Views, one of my views is no longer working correctly. The first item from the view displays the title and text of the page where it displays instead of the item in question. It also shows a message saying "Content not displayed because it produces an infinite loop. The wpv-post-body shortcode was called more than once with the same attributes". It's only the first item where this happens - the rest of the list looks fine after that. And other views are fine - it's just this one and some variations using the same content type where the issue is happening.
Here's an example of it happening on our test site: hidden link
And here's our live site, which I've rolled back to Types 3.4.18 and Views 3.6.5: hidden link
The view is pulled in by a shortcode in the page body, in this case: [wpv-view name="person-by-department-list" wpvdepartment="teen-services"].
Here's what's in the loop editor:
[wpv-layout-start]
[wpv-items-found]
<div class="department-people-list">
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-post-body view_template="loop-item-in-person-by-department"]
</wpv-loop>
<!-- wpv-loop-end -->
</div>
[/wpv-items-found]
[wpv-no-items-found]
[/wpv-no-items-found]
[wpv-layout-end]
And here's the view template:
<div class="person person-list card">
[wpv-conditional if="( $(wpcf-bio-picture) ne '' ) OR ( $(wpcf-bio-list-picture) ne '' )"]
<div class="person-list-image alignleft">
<!-- [types field='bio-picture' title='%%TITLE%%' alt='%%ALT%%' size='full'][/types] -->
[types field='bio-list-picture' title='%%TITLE%%' alt='%%ALT%%' size='large' resize='proportional'][/types]
[wpv-conditional if="( $(wpcf-bio-list-picture) eq '' )"]
[types field='bio-picture' title='%%TITLE%%' alt='%%ALT%%' size='large' resize='proportional'][/types]
[/wpv-conditional]
</div>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-real-excerpt]' ne '' )"]
<h3>[wpv-post-link]</h3>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-real-excerpt]' eq '' )"]
<h3>[wpv-post-title]</h3>
[/wpv-conditional]
[wpv-conditional if="('[wpv-attribute name="wpvdepartment"]' eq 'board-of-trustees') OR ('[wpv-attribute name="wpvdepartment"]' eq 'bot-liaison')"]
<h4 class="bot-role">[types field='bot-role'][/types]</h4>
[/wpv-conditional]
[wpv-conditional if="( [wpv-post-id] ne [wpv-post-id item='@location.parent'] )"]
<p>
[wpml-string context="wpv-views"]Location:[/wpml-string] [wpv-post-link item="@location.parent"]
</p>
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-job-title) ne '' ) AND ( $(wpcf-bio-contact-format) ne '' ) AND ('[wpv-attribute name="wpvdepartment"]' ne 'bot-liaison')"]
<p>
[types field='job-title'][/types]
</p>
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-email-address) ne '' ) AND ( $(wpcf-bio-contact-format) ne '' )"]
<p>
[wpml-string context="wpv-views"]Email:[/wpml-string] [types field='email-address'][/types]
</p>
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-phone-number) ne '' ) AND ( $(wpcf-bio-contact-format) ne '' )"]
<p>
[types field='phone-number'][/types]
</p>
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-real-excerpt]' ne '' )"]
[wpv-post-excerpt]
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-real-excerpt]' eq '' )"]
[wpv-post-body view_template="None"]
[/wpv-conditional]
[wpv-conditional if="( $(wpcf-personal-pronouns) ne '' )"]
<p class="personal-pronouns">
[wpml-string context="wpv-views"]Pronouns:[/wpml-string] [types field='personal-pronouns'][/types]
</p>
[/wpv-conditional]
</div>
Is there something I can change in the view to prevent this?
Thanks!
Sarah
Hi there,
Would you please temporarily remove the content template from the loop?
[wpv-post-body view_template="loop-item-in-person-by-department"]
And instead paste the whole code of the content template inside the loop and remove the content template content?
See if it fixes the issue for you?
Thanks.
Hi there - thanks for the response! I tried doing it that way and still get the same thing.
Hi there,
Thank you. Would you please provide the staging version login information by marking the next reply as private, and point me where to check to see the issue?
Finally, I'd appreciate it if you can give me the result of the isolated test for the issue:
- IMPORTANT STEP! Create a backup of your website.
- Switch to the default theme such as "TwentyTwenty" by going to "WordPress Dashboard > Appearance > themes".
- Go to "WordPress Dashboard > Plugins" and deactivate all plugins except WPML and its add-ons.
- Check if you can still recreate the issue.
I understand you mentioned it is related to the latest version, but I need to know if that has anything to do with a plugin conflict on the new version or an independent factor.
Thanks.
Hi there,
Thank you for the information. I reported this to the second-tier.
I will get back to you as soon as I have an update.
Thank you.
Hi there,
The issue is replicated by our second-tier support and reported to the development team.
I will inform you when there is a fix.
For now we published an erratum about the issue:
https://toolset.com/errata/wrong-output-for-the-first-item-in-the-loop-of-a-view/
Thank you.
Thanks for the update - I appreciate it!
-Sarah
Hi there,
I wanted to let you know that we published plugin updates today that includes a fix for this issue (in your case Views 3.6.7).
If the update does not show up on your plugin installer page (click the registered link beneath the plugin name to go to the custom installer page) click the Check for Updates button to update the list.
Or you can download the latest versions from your accounts page: https://toolset.com/account/downloads
Thanks.
Hi Christopher,
That's great news! I just installed the update, and everything is looking good. Thanks for your help--
-Sarah