JS error after switch from PHP 5.6 to PHP 7.2

Author Posts

Edouard

Hello,
Due to PHP 5.6 getting unsupported at the end of this month, WP Engine asks their users to switch to PHP 7.2 before they do it automatically…. This doesn’t give a lot of time to detect and solve the issues.
After switching to 7.2, Microthemer exhibits loading errors in all my websites, that use the PageLines CMS theme, as soon as the Microthemer bar is open. There was no conflict with any theme or plugin before the switch to 7.2, and nothing was changed apart from the switch to 7.2.

Please find below the errors shown by Microthemer.
Uncaught TypeError: Cannot read property ‘disabled’ of undefined (line 1)
Microthemer discovered a JavaScript error on your site:
Error: Uncaught TypeError: Cannot read property ‘disabled’ of undefined
URL: /wp-content/plugins/microthemer/js-min/microthemer.js?v=5.2.5.8&ver=4.9.8 (line 1)
Source: Frontend preview
Something’s wrong
Loading WordPress site took more than 30 seconds. A JavaScript error may be preventing the action from completing. The following errors were detected:
Error: Uncaught TypeError: Cannot read property ‘disabled’ of undefined
URL: /wp-content/plugins/microthemer/js-min/microthemer.js?v=5.2.5.8&ver=4.9.8 (line 1)
Source: Frontend preview

The Javascript console says:
microthemer.js?v=5.2.5.8&ver=4.9.8:1 Uncaught TypeError: Cannot read property ‘disabled’ of undefined
at Object.styles_disabled (microthemer.js?v=5.2.5.8&ver=4.9.8:1)
at Object.log_js_events_used (microthemer.js?v=5.2.5.8&ver=4.9.8:1)
at Object.run_callbacks (microthemer.js?v=5.2.5.8&ver=4.9.8:1)
at Object.loop (microthemer.js?v=5.2.5.8&ver=4.9.8:1)
at Object.loop (microthemer.js?v=5.2.5.8&ver=4.9.8:1)
at Object.loop (microthemer.js?v=5.2.5.8&ver=4.9.8:1)
at Object.maybe_recurse (microthemer.js?v=5.2.5.8&ver=4.9.8:1)
at Object.run_callbacks (microthemer.js?v=5.2.5.8&ver=4.9.8:1)
at Object.loop (microthemer.js?v=5.2.5.8&ver=4.9.8:1)
at Object.recalculate_active_events (microthemer.js?v=5.2.5.8&ver=4.9.8:1)

Thank you in advance for your help!


Edouard

FOLLOW-UP: After more tests, it appears that the problem happens even before switching to PHP 7.2.
Then it must have appeared without me noticing during one of those automatic WordPress updates (currently 4.9.8).
Even weirder, after solving a few issues by switching all websites to SSL, the problem only remains on two websites, while other websites with the same PagesLines CMS theme work well.


Sebastian

Hey Edouard,

I develop Microthemer on PHP 7.2 so I suspect something else might be the root of the issue, as you suggest in your follow up. The SSL update is probably telling too. Mixed content issues due to an incomplete SSL setup can cause issues for Microthemer, which it generally reports as JavaScript errors (a downstream consequence of mixed content SSL issues).

Could you send me access details for one of the two remaining sites that still has an issue via our secure contact form? I should be able to offer a solution for both once I’ve found a fix for one.

Cheers!
Sebastian


Edouard

Thank you Sebastian, I just sent it.


Sebastian

Thanks Edouard, details received.

I’ve managed to get rid of the error, though I’m not entirely sure why. I uploaded a new version of Microthemer that would give me more detailed debug info, but to my surprise the error went away. And it’s still gone now that I’ve installed the original version of Microthemer. This, and your comments about most of your sites getting better after switching to SSL makes me think some sort of caching lead to the error lingering on some sites, but only temporarily. And installing a new version of MT automatically cleared the cache.

I’m not at all sure my guess is correct. Now that the issue has disappeared on the site I have access to, I can’t put my hypothesis to the test. Could you try clearing WP Engine’s cache on the one remaining site that has an issue? And if that doesn’t work, try uninstalling and re-installing Microthemer?

If you could let me know the outcome that would be very much appreciated.

Thanks!
Sebastian


Edouard

Thank you for connecting to the development platform if one of the two caches. I tried to clear WP Engine’s cache (“Purge all caches”: The page-cache, the CDN cache, and the object cache) and to update MicroThemer to the latest version (that was released yesterday) on the production platform but it did not help. Then I also tried to disable, delete then reupload and reactivate MicroThemer, to no avail. Then I realized I could copy the development platform to both staging and production. So it solved the problem for this website. However I could not find how to solve the problem on the second website. I’ve just sent you the access information so that you can try your magic on it as well!


Sebastian

Thanks Edouard, I worked my magic again on your other site. Magic because all I did was save the settings again to fix the issue. I suspect that’s also what fixed it on your other site, as I did an export of your settings on the first site, which triggers a save.

I’m still not sure how this happened to all of your sites. It looks like everything is working fine now. But please let me know if you encounter any further issues, and I’ll get right back onto it.

Cheers,
Sebastian


Edouard

Thank you Sebastian for your stellar support! You are right, on the staging and production platforms of this second website, exporting and reimporting the settings did the trick.
Cheers,
Edouard


Sebastian

Excellent!

You must login or register to reply to this topic.