Views is broken
- This topic has 6 replies, 3 voices, and was last updated 2 years, 5 months ago by
badabingbreda.
-
AuthorPosts
-
November 30, 2022 at 3:46 PM #39413
badabingbreda
ParticipantMB Views seems to be broken, on a client's site whenever I add template code like
{% if total > 3 %}{# do something #}{% endif %}
it gets rewritten to
{% if total & gt; 3 %}{# do something #}{% endif %}
which obviously breaks the entire template and blanks out. Client does not know how long this has been going on.
Edit: had to edit this post because & gt; (but without the space) is shown as > here. In MB Views it is changed to the htmlentity.
December 1, 2022 at 9:57 PM #39437Peter
ModeratorHello there,
Can you please let me know the steps to reproduce the issue? I'm just using the type Shortcode and putting your code to the post content and do not see any issue.
December 2, 2022 at 12:14 AM #39445badabingbreda
ParticipantThat's just it, it's on a live site. It just started happening after I was informed that a Twig template wasn't rendering, but I'm unable to edit it and troubleshoot because of this.
Here's what happens when I save a view (this isn't the view that's not working, but if I edit that one it will just mess it up more than it already is):
December 2, 2022 at 2:31 AM #39446Marius
ParticipantI have a similar behaviour for me this one is not working it shows both options, even if i have only one value (like WOHNEN) on the post, this is for all for item in X queries :
{% set backto = mb.rwmb_meta( 'nutzungsart', '', post.ID ) %} {% for item in backto %} {% if item == 'GEWERBE' %} <div class="back-to-results"> <a href="/mietwohnungen-in-hagen/gewerbeobjekte/">Zurück zu allen Gewerbeobjekten</a> </div> {% elseif item == 'WOHNEN' %} <div class="back-to-results"> <a href="/wohnungssuche-in-hagen/">Zurück zu allen Suchergebnissen</a> </div> {% endif%} {% endfor %}
December 3, 2022 at 10:32 AM #39467Peter
ModeratorHello,
I do not see that on my demo site, screen record https://monosnap.com/file/iQRdb11B2538YWhcrpZE93Q0SrwHqo
Can you please check this issue in a fresh install and the latest version of Meta Box and MB plugins?
December 4, 2022 at 1:22 AM #39477badabingbreda
ParticipantThanks for your reply. I have yet to hear back from my client. I asked him to create a staging copy of the site. I there disabled all plugins that I could but that didn't help. Something that didn't seem of importance was that it's a multisite environment. I asked him to assign me the role of super admin. After he did so, the problem went away.
This was Friday morning, I reported to the client about my findings but he has not replied yet. I mean to test the theory and have him strip away the extra privileges on staging, and grant me them on live. Was going to report back as soon as I knew more, but it's undetermined when that will be.
December 4, 2022 at 10:05 PM #39483badabingbreda
ParticipantOkay, client replied, gave me super admin privileges on the network and without touching anything else I went straight into a demo view that I had used to isolate the problem (the view mention in the original initial post). I was now able to save the template without > being saved as & gt; withing twig brackets.
I was administrator before, super admin after. Seems like a bug for multisite only perhaps.
-
AuthorPosts
- You must be logged in to reply to this topic.