Skip Navigation

[Resolved] Views breaks markup structure

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

Problem: In some circumstances a View breaks the page markup structure.

Solution: In this case, there was a missing closing div tag in the Loop Output editor. Check the Loop Output and the wpv-item tags to make sure the row structure is closed on the last item and the pad-last item. It will look like there is an extra closing div tag, but it's required.

Relevant Documentation:
https://toolset.com/documentation/user-guides/digging-into-view-outputs/

This support ticket is created 6 years, 5 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.

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
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 5 replies, has 2 voices.

Last updated by Christian Cox 6 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#907640

Hello, we're using Toolset Views and CRED to run a kitchen display system on my client's website.

The view "Kitchen Orders" generates the orders on the screen. Clicking them will trigger a modal built inside the view "Kitchen Orders All Modals". The All Modals view generates essentially the same view but with buttons/CRED forms to update and revert order status.

The All Modals view is nested inside the HTML structure for the modal, located below the Kitchen Orders view. NOTE the All Modals view is not nested inside the Kitchen Orders view. For some reason, after CRED updates the view, the All Modals and its HTML structure disappears. We haven't been able to get it to show up after the view updates.

Also, following the latest updates to Toolset plugins on May 28, our CRED forms "Revert Order" and "Update Order" — which are suppose to change WooCommerce order status to wc-processing and wc-completed respectively — have stopped working. Pressing the buttons do nothing to update their status.

Even our own Toolset contractor is having difficulties finding the cause of these issues. If anyone can provide an insight as to why the CRED forms and the modal view are not working, that'd be great.

We've also set up a site clone for troubleshooting purposes as orderpantry.com is a live site with many themes and plugins that we cannot risk updating. The same issues are arising on the site clone as well.

EDITED: Sorry, but the debug code I pasted was from the site clone not the actual live site.

#907948

Hi, can I get an updated clone of your site so I can run some additional tests? I will check out the modal issue here in this ticket, and we can create a separate ticket for the order status issue.

#908447

Hello Christian,

After checking the "Kitchen Orders" view from our old production site. I found why the modal is not occurring; it's really weird.

If you check Kitchen Order's Loop Out Editor from Line 19 to the end:

	</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

Nothing is amiss, right? I checked the original code on our production site and it is:

      </div>
	</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

There is what seem to be an extra </div> closing tag. When I reapplied this the modal returns after CRED updates! I've no idea why this tag is required.

Since the modal issue seem to have been fixed, can we check out the order status issue instead?

#908864

There is what seem to be an extra </div> closing tag
The reason it looks like an extra closing tag is because this closing div tag is technically part of the wpv-item index=pad-last. The row div is opened in the first item (index=1). The last item in the row must close the row div before starting a new row, so you should see a closing div on the pad-last item and also on the index=4 item. If there are 4 items to display in the current row, index=4 will close the row. If there are not 4 items to display in the current row and your View is configured to pad the list, then the pad-last item will close the row.

#908898

Thank you Christian for the explanation!
Shall I go ahead and create a separate ticket for the order update issue?

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/cred-update-order-status-not-working-as-intended/

#909082

Let's continue debugging the order status issue in the new ticket. Thanks!