Skip Navigation

[Resolved] Missing post content on view in middle of display and update breaks view worse.

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

Problem: I have a group of nested Views that is not displaying content after updating to Views 3.3.2. In Views 3.2.2.1, I am able to see the content I expect to see.

Solution: In this case, a Content Template shortcode nested in one of the Views did not use an explicit view_template attribute, and the newer version of Views is not able to infer which template to apply here. An update to the shortcode solves the problem.

Old shortcode:

[wpv-post-body output="raw"]

New shortcode:

[wpv-post-body view_template="backup-from-the-print-template"]

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-post-body

This support ticket is created 4 years, 2 months 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.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 3 replies, has 2 voices.

Last updated by bryanC-2 4 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#1841569
Views version 3.2.2.1.png
views 3.3.2.png

I have set up a list of posts that get scheduled by date and are organized by category under each date. You can see the page with this at this development/test URL. hidden link (Note this is a copy of the live site so I can easier work on this.)

If you scroll down to the date July 9, you will notice, no items show up for that date, but the view will still continue to work after July 16th.

The client's workflow doesn't appear as if it has changed, so I can't figure why this one week would not show up. I do note, that this is close to the 6 month/26 week mark in the view, but I have the view has no limit.

There are quite a few views on this site, so I will list below what I use.

I've created a "From The Print" CPT. All this is supposed to do is create a placeholder for the articles plus give a date from which posts are to be taken. The client marks a date in a custom field in a post so when the two dates match, views know to use the post.

This is the content template that shows under each date. hidden link

In the content template, you can see the views that are being used which are also below.

from-last-weeks-paper
from-the-print-village-council
from-the-print-obits
from-the-print-sports
featured-photos-for-from-the-print

The current version of views that is on the development/test site is version 3.2.2.1. I updated the site to Views 3.3.2, but then the view broke worse where only the dates for each set of posts appeared, but no posts at all. I will add two screenshots to show the difference. If either version can be fixed or if guidance can be given, it would be appreciated.

I'm happy to give you credentials if you need them.

Bryan

#1842139

Hello, yes please provide credentials so I can see how this View and Content Template arrangement is set up in wp-admin. I will activate private reply fields here.

Also, have you tried these troubleshooting steps yet?
- Temporarily disable all plugins except Types (if active) and Blocks or Views, and activate a default theme like Twenty Twenty
- If the problem is resolved, reactivate your theme and other plugins one by one, testing each time, until the problem returns
- Let me know if it's okay to try these steps myself on your site if you have not tried them yet, or if you would prefer I made a clone of the site with Duplicator to test locally without affecting your live site

#1845883

Thanks for the login information. As far as the update to Views 3.3.2 causing a problem, I tracked that down to one line of code used to display the Content Template in the View For From The Print Page for 2020 here:
hidden link

The Content Template shortcode was originally set with the output="raw" attribute, which isn't supported, and it did not include an explicit template slug:

[wpv-post-body output="raw"]

I changed that shortcode to use the explicit template slug and removed output="raw", like so:

[wpv-post-body view_template="backup-from-the-print-template"]

Now the results for each Month/Year section appear as expected with the exception of July 9. I assume that a change in the latest version of Views is not as lenient, and the Content Template was not applied as expected.

To further test the July 9 issue, I temporarily modified this post to use the issue publication date July 9, 2020 instead of its original issue publication date of July 2, 2020:
hidden link

As you can see, this post now appears in the July 9 Features section. Are you aware of any posts with the issue publication date of July 9, 2020 that should appear here but do not? I did not do an inspection of all the content, but my guess is that there is simply no other content with the Issue Publication date of July 9 2020, other than the one item I manually adjusted. If that is not the case, please let me know the URL of one of the missing posts and I will take a closer look.

Otherwise, I think the change to the Content Template shortcode I mentioned above should be sufficient to allow you to update to the latest version of Views in the production site without encountering any missing content.

#1849815

My issue is resolved now. Thank you!