-
AuthorPosts
-
June 28, 2018 at 9:12 pm #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, 4 months ago by dethfire.
June 28, 2018 at 11:03 pm #979135I 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, 4 months ago by dethfire.
July 1, 2018 at 3:18 pm #979832Please anyone?
July 2, 2018 at 8:36 am #979995Hi,
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,
IsmaelJuly 2, 2018 at 10:58 pm #980323Thanks 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.
July 3, 2018 at 6:38 am #980400Hi,
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,
IsmaelAugust 4, 2018 at 7:58 pm #993570Hi,
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.
August 6, 2018 at 8:25 am #993830Hi,
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,
IsmaelAugust 11, 2018 at 9:24 pm #996340This reply has been marked as private.August 13, 2018 at 7:36 am #996548Hi,
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,
IsmaelAugust 13, 2018 at 1:18 pm #996656Take 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, 3 months ago by dethfire.
August 14, 2018 at 3:57 am #996929Hi,
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,
IsmaelAugust 14, 2018 at 4:07 am #996934Hi,
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?
August 14, 2018 at 4:19 am #996938Do you think the classic editor plugin is to blame?
August 15, 2018 at 12:53 am #997388With 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, 3 months ago by dethfire.
August 15, 2018 at 5:35 am #997419Hi,
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,
IsmaelAugust 17, 2018 at 2:05 pm #998450Thank you!
August 19, 2018 at 1:06 pm #998902Hi,
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ünterAugust 19, 2018 at 2:20 pm #998915awesome! thank you thank you thank you! I was going crazy and now I can finally update! :)
August 19, 2018 at 5:19 pm #998988Hi dethfire,
Glad Günter helped you to get it working! :)
If you need further assistance please let us know.
Best regards,
VictoriaAugust 19, 2018 at 5:56 pm #999001Updated successfully. Feel free to close, thanks again!
-
AuthorPosts
- The topic ‘4.4.1 apparently changed content in my posts and totally screwed up my mathjax’ is closed to new replies.