Skip Navigation

[Résolu] Condition causes error

This support ticket is created Il y a 6 années et 3 mois. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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

Supporter timezone: America/Jamaica (GMT-05:00)

Ce sujet contient 17 réponses, a 2 voix.

Dernière mise à jour par Shane Il y a 6 années et 3 mois.

Assisté par: Shane.

Auteur
Publications
#1084611

Jim

Ik have build a layout with a condition and inside the condition there is a loop through images:

[wpv-conditional if="( $(wpcf-tables-figures) ne '' )"]
		[wpv-for-each field="wpcf-tables-figures"]
			[types field='tables-figures' size='full' align='none'][/types]
			<p class="imgdescr">[description url="[types field='tables-figures' size='full' url='true'][/types]"]</p>
		[/wpv-for-each]
[/wpv-conditional]

This works well but now I have a post with 10+ images and that breaks the condition somehow...
If there are more than 10 images the short codes inside the condition are printed to the page like this:

lien caché

Really hope you can help me out here...

Thanks,
Jim

#1084691

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Jim,

So if it is below 10 then the shortcodes show up find correct?

I suspect this is some server limitation but please confirm so that I can run the tests locally.

If you remove the conditionals then it works normally?

Please let me know.
Thanks,
Shane

#1085483

Jim

Yes exactly:
below 10 everything is fine. That is why I only just found out because most posts don't have that many images.
And correct; without the condition all the images show up correctly.

Strange huh?

#1085494

Jim

One other thing worth mentioning is that other shortcodes inside the condition are not executed
The short code outside the condition works correctly!

[wpv-conditional if="( $(wpcf-tables-figures) ne '' )"]
<div id="figures" class="">
  		[mepr-show if="rule: 1225"]This text is only visible for members - placed inside the condition[/mepr-show] 
		[wpv-for-each field="wpcf-tables-figures"]
			[types field='tables-figures' alt='%%ALT%%' title='%%TITLE%%' size='full' align='none'][/types]
			<p class="imgdescr">[description url="[types field='tables-figures' size='full' url='true'][/types]"]</p>
		[/wpv-for-each]
</div>
[/wpv-conditional]

[mepr-show if="rule: 1225"]Another piece of text only for members - placed outside the condition[/mepr-show]

lien caché

#1085766

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Jim,

I'm not able to replicate the issue on my install here.

Would you mind providing me with a copy of your site to test here locally so that I can check to see if its a server issue ?

To provide the copy please take a look at the link below.
https://toolset.com/faq/provide-supporters-copy-site/

Thanks,
Shane

#1087399

Jim

Hi Shane,
my clients website is very big, Finally I left out some directories hope it still works...

lien caché

#1087518

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Jim,

I have the backup running locally.

Could you send me a link to a page where I can see the issue ?

Thanks,
Shane

#1087622

Jim

Hi Shane, good to hear!
This is the url from the root up:
/journal-article/huidige-mogelijkheden-voor-behandeling-van-graft-versus-host-ziekte-een-nieuwe-richtlijn/

Let me know if you need more help.
Thnx,
Jim

#1088625

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Jim,

I've escalated this one to our 2nd tier supporters for further debugging.

Thanks,
Shane

#1090170

Jim

Thnx Shane, hope to hear more anytime soon...

In the meantime, there seems to be another strange bug when is present in a field.
That causes a strange error: the field is not visible and the order of fields/loop get mixed up:
/journal-article/ernstige-aplastische-anemie-bij-eosinofiele-fasciitis/
The 'summary' field is missing and title and breadcrums are printed twice among others.

Solution:
If you remove the
from the "summary" field, or replace it with the problem is gone...
Are you aware of this? Should I open a new ticket?

#1090171

Jim

Thnx Shane, hope to hear more anytime soon...

In the meantime, there seems to be another strange bug when

<i>

is present in a field.
That causes a strange error: the field is not visible and the order of fields/loop get mixed up:
/journal-article/ernstige-aplastische-anemie-bij-eosinofiele-fasciitis/
The 'summary' field is missing and title and breadcrums are printed twice among others.

Solution:
If you remove the

<i>

from the "summary" field, or replace it with

<em>

the problem is gone...
Are you aware of this? Should I open a new ticket?

#1090307

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Jim,

As to not cause any confusion as our 2nd tier supporters are checking this you should open a new ticket for this issue.

Thanks,
Shane

#1090418

Jim

Alright will do. It is just that sometimes things/bugs are related so they could help tracking down the problem...

In the meantime while doing more research we now found that we have to delete even more images before the post is correctly displayed. Before I thought 10 was the max, now it happens above 6 images.
Could be that other things have changed here on our install.

Just posting to keep you updated and maybe help finding the problem...

#1091450

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Jim,

Could you try increasing the max_execution_time of your php to see if this would work ?

It could be that the scripts to process the code ran out of time due to this limit.

Please try and let me know.

Thanks,
Shane

#1092888

Jim

Yes, that helped Shane!
I upped the max exec time and now the shortcodes display correctly!

Glad we got that solved, on the other hand it is worriing as this project get's more complicated by the week, the more resources are needed.

Can you or the development team have a look at my code and let me know if there is a more efficient way to code all the conditions, fields and views etc... ?

Thanks!!