Skip Navigation

[Résolu] After Toolset Plugin Updates PDFs no Longer Show!

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

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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 7 réponses, has 2 voix.

Last updated by EricP9341 Il y a 8 années et 1 mois.

Assisted by: Beda.

Auteur
Publications
#376557
screenshot-no-PDF-after-update.jpg

HELP - we are just about to launch after a year of development, was supposed to happen last week, client is anxious. I am going out of town next week. This function has been working fine for months, now minor Toolset plugin updates break it!!?
I am trying to: I just updated the Toolset plugins, and
I visited this URL: hidden link
or any other page found via hidden link

I expected to see: PDF showing after purchase. See screenshot.

Instead, I got: an error page embedded instead of the embedded PDF (after purchasing - please allow me to give you the PayPal sandbox account info if needed) .

Thanks

#376943

I apologize the delay here

Does the issue disappear if you downgrade to the previous Toolset?
You can grab them here and deploy via FTP:
https://toolset.com/account/downloads/

I will also need access to a (best case) development site and then I will see how to fix this.

I strongly assume a update to the theme has been made and some code got lost, or the ShortCode conditional we used there is somehow corrupted.

Thank you

#377435

Eric, I pointed out in past that you have received elaborated Custom Code, which I adapted to your case because WooCommerce API is broken in this detail, and it is not Toolset breaking this API, since it does not even touch or create them

Last time we debugged this over 1,5 months to find out that the code in functions.php was not copied over to the real site and not registered.

Then we have had the same issue again, with a update of the theme and the code "stopped working":
https://toolset.com/forums/topic/conditional-shortcode-not-working-after-toolset-starter-theme-update-1-3-5/

Since this is working on your Test Server and you seem to have updated Toolset there (according your statement), as well, I assume it is a similar issue here.

I see on your Live site you use the Toolset Child theme, a outdated version.

Although as far I can see, all code is present in the active theme, and the ShortCode is registered, I see in your layouts Content Template Cell some unusual Code that I did not recommend to use.

[wpv-conditional if="( '[wpv-product-purchased]' eq '1' )"]
  <embed src="[types field=" episode-pdf"="" link="true" output="raw" ][="" types]"="" width="100%" height="500">
  <span style="font-size: 13px;">
    <a href="[types field='episode-pdf' link='true' output='raw'][/types]" target="_blank">
        <em>[wpml-string context='wpv-layout-conversation']Can't view transcript below? Open PDF in new window with this link.[/wpml-string]</em>
    </a>
  </span> 
<br><br>
<span style="font-size: 0.8em">[wpml-string context='wpv-layout-conversation'](Note: No refund possible for the purchase of this episode)[/wpml-string]</span>[/wpv-conditional]

I do not know what your goal is with the empty apostrophes as in types field=" episode-pdf"="" ...
or in [="" types]...

This certainly is not something we provided.

When you insert the ShortCode with the GUI, as recommended, you will get:

[types field="episode-pdf" link="true" output="raw"][/types]

No spaces, no brackets, nothing unusual and unexpected.

Anyway the ShortCode evaluation is working fine as expected.

Just change the evaluation from '1' to '' and you will see your PDF Link in the Product page, means, the conditional is correctly hiding it if the product is not purchased and will show it if purchased.
Or Yin can replace your code with a OK / Not OK output to check purchased and not purchased products.

Although your code in that evaluation is wrong, it has wrong ShortCodes and apostrophes, and that will most certainly break your content.

Please fix this code according the guidelines of ShortCodes.

Thank you

#377679

As I tried to explain, those "empty apostrophes " are being inserted by your software. When I remove them and save, and re-open the page, they are there again, preventing the functioning of the PDFs showing. This did not happen before the plugin upgrades.
I even copied the chunk of conditional code from the working test site, and the same thing happens.

This is why I said
"I did some troubleshooting myself and noticed that the shortcode for the conditional (for the PDF showing or not) is being changed (on unilisten.eplatt.com) after being saved. Something is adding some characters:
" episode-pdf"="" should be "episode-pdf""

I don't know how I can say that any clearer. I am not adding that code.
So for example, I copy in into your GUI:

 [types field="episode-pdf" link="true" output="raw"][/types]  

and save, close, test (not working), and re-open the GUI and it turns into:

 [types field=" episode-pdf"="" link="true" output="raw" ][="" types]"=""  

It is not my "goal" as you say! Please help me find what has started causing this after the plugin upgrades.

#377756

I went in, deleted the messy code, inserted the ShortCod with the GUI, changed the apostrophes as required in this sort of nested ShortCodes, saved the Content template, closed, reopened and all is still with the correct Apostrophes and syntax.

This is the code present right now:

<embed src="[types field='episode-pdf' link='true' output='raw'][/types]"> 

As you use ShortCodes to populate HTML attributes you must set apostrophes to '' and not "".

This is not a problem of Toolset, it is actually a WordPress restriction, to be clear, WordPress does not like this sort of usage of ShortCodes:
https://make.wordpress.org/core/2015/07/23/changes-to-the-shortcode-api/

We do our best to keep this possibility alive though.

Does it work after my changes?

Thank you

#377866

Yes it works (after I added back in the width="100%" height="500" to get the appropriate size).

I understand about WordPress update and shortcode syntax, but it doesn't explain where the "" came from – I'm not arguing or criticizing, I just want to know what to do differently – since I never added them and there was no apostrophe ('). And I tried fixing it before you by simply copying the working code from the older version of the site, or manually editing the code, but it added back in "" after saving – so what did you do differently?

Another issue (I can open a different support thread if you want but you already have the login and second site info etc), after the updates, one of the episodes (conversations) no longer appears in searches despite it being there when you go to the URL:
hidden link
Search page:
hidden link

Thanks

#378440

I am not sure why this was added/changed on your site

This is not something that can happen because of the Update, as we do not change contents when updating, but only FTP files of our Plugins, and the information is not stored in the FTP Files but in the DataBase, which we do not touch on update process.

I simply went in, added the ShortCode with the GUI and saved the Layout/Content Template.
I did not perform any specific action.

As the original issue is resolved may I kindly ask you please to open a new ticket for your additional question?
This will help other users with similar problems to find solutions when searching the forum.

Thank you for your patience.

#379840

OK, thanks

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.