Viewing 21 posts - 1 through 21 (of 21 total)
  • Author
    Posts
  • #979067

    Everything was working fine and then I update to 4.4.1 and now all my mathjax code in hundreds of posts is totally broken. How do I fix?

    mathjax devs think that backslashes were removed

    *Confirmed, backslashes have been removed from my posts. How is this possible that a theme can edit post content? I have no choice but to restore a backup and hope this issue is solved in a future release?

    Example page:

    • This topic was modified 6 years, 5 months ago by dethfire.
    #979135

    I have rolled back to 4.2.2 and restored a db backup for now, but need this fixed to upgrade

    • This reply was modified 6 years, 5 months ago by dethfire.
    #979832

    Please anyone?

    #979995

    Hi,

    Thank you for using Enfold.

    Do you have a dev or a staging site? We need to inspect the issue first. Do note that we don’t provide support for third party plugin as stated on our support policy. Please keep in touch with the plugin author.

    Best regards,
    Ismael

    #980323

    Thanks for the reply! It’s not a plug-in. Just a simple JavaScript and not the cause of issue. The issue is when I updated enfold it removed backslashes in all my post content. When I restored backup version and dB everything was ok again. I’ll try to get a dev area up.

    #980400

    Hi,

    Thanks for the update. Please let us know once the dev site is accessible. And point us to the script so that we can check it.

    Best regards,
    Ismael

    #993570

    Hi,

    Sorry I was traveling for a month but back. The script is really irrelevant. It just formats text equations from code, aka LaTeX. The code starts with a backslash. Upgrading enfold to newest stripped the backslashes from every post. Is that even conceivable on your end? Does your upgrade script alter post content? I’ll have the dev area setup later next week.

    #993830

    Hi,

    The theme doesn’t filter the posts content or remove backslashes specifically. Check the includes > loop-index.php file. This template renders the single post pages. We’ll wait for the dev site.

    Best regards,
    Ismael

    #996340
    This reply has been marked as private.
    #996548

    Hi,

    Thanks for the update.

    I see a lot of equations in that post but I’m not sure which ones are incorrect because I don’t understand them. Can you point us to the equations that are supposed to contain backslashes?

    Best regards,
    Ismael

    #996656

    Take for example the first one. In browser source code view, looking at the post in WP or the database, you’ll see it starts with “\begin{align*}”. After upgrade it becomes “begin{align*}” and breaks.

    • This reply was modified 6 years, 4 months ago by dethfire.
    #996929

    Hi,

    Thanks for the info.

    I just noticed that the staging site is still on version 4.2.2, so I did the test on my installation. The backslashes are still intact after saving the post, suggesting that the update didn’t cause the removal.

    Screenshot: https://imgur.com/a/B70NUJI

    Where did you put the mathjax script? Why did you install the “Classic Editor” plugin?

    Best regards,
    Ismael

    #996934

    Hi,

    I kept it on 4.2.2 so you could see the before and then update to see the after :)

    hmmm the script just goes in the header, it just renders the equation code. I looked in the database and the posts had the backslashes removed.

    When you update wordpress it asks you to install gutenberg or classic editor.

    Please update my test site. If you are convinced it’s not the theme, what else could it be? Should I deactivate all my plugins before updating?

    #996938

    Do you think the classic editor plugin is to blame?

    #997388

    With all plugins deactivated I upgraded and it happened again.

    [tex]begin{align*} -c^{2} dtau^{2} = ds^{2}
    = & -left( 1 – frac{2M r}{rho^2} right) c^{2} dt^{2} + frac{rho^2}{Delta} dr^{2} + rho^2, dtheta^{2} \
    & + left( r^{2} + a^{2} + frac{2M r a^{2}}{ rho^2} sin^{2} theta right) sin^{2} theta dphi^{2}
    – frac{4M ra sin^{2} theta }{rho^2} , c , dt , dphi end{align*}[/tex]

    Should be:

    [tex]\begin{align*} -c^{2} d\tau^{2} = ds^{2}
    = & -\left( 1 – \frac{2M r}{\rho^2} \right) c^{2} dt^{2} + \frac{\rho^2}{\Delta} dr^{2} + \rho^2\, d\theta^{2} \\
    & + \left( r^{2} + a^{2} + \frac{2M r a^{2}}{ \rho^2} \sin^{2} \theta \right) \sin^{2} \theta \ d\phi^{2}
    – \frac{4M ra \sin^{2} \theta }{\rho^2} \, c \, dt \, d\phi \end{align*}[/tex]

    Let me know if you want me to restore the backup for you to try and see.

    • This reply was modified 6 years, 4 months ago by dethfire.
    #997419

    Hi,

    I’m still not sure why the update would remove the backslashes. What if you update the theme first and then restore the database from a backup?
    I’ll tag one of the theme developers to check the issue. Please wait for his response.

    Best regards,
    Ismael

    #998450

    Thank you!

    #998902

    Hi,

    Thank you for reporting this. I could locate a bug.

    In file enfold\config-templatebuilder\avia-template-builder\php\element-manager.class.php around line 589 you find:

    
    Avia_Builder()->update_post_content( $post_id, $content_new );
    

    Replace this with:

    
    $content_new_wp = wp_slash( $content_new );
    Avia_Builder()->update_post_content( $post_id, $content_new_wp );
    

    Fix should be in one of the next updates.

    Best regards,
    Günter

    #998915

    awesome! thank you thank you thank you! I was going crazy and now I can finally update! :)

    #998988

    Hi dethfire,

    Glad Günter helped you to get it working! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #999001

    Updated successfully. Feel free to close, thanks again!

Viewing 21 posts - 1 through 21 (of 21 total)
  • The topic ‘4.4.1 apparently changed content in my posts and totally screwed up my mathjax’ is closed to new replies.