I don’t see anything wrong with your code, and the appropriate HTML is still output. It’s more likely the change in versions is affecting what JavaScript is being loaded somehow. Your page has a console error “ReferenceError: BrowserDetect is not defined” which is probably preventing your fold out script from running on a click event. Perhaps you should be looking at whatever PHP is causing the BrowserDetect script to be loaded.
Hi, thanks for answering. Well I’m not familiar with javascript and don’t know anything about that. The Reference Error you point at doesn’t sound as something I’ve ever heard before as well so I really don’t know where to look to solve this problem.
There are a few javascript files in the folder as well but as i don’t know anything about javascript, I haven’t got a clue if one of them actually has something to do with the fold out thing.
The erroneous BrowserDetect appears to be related to the fade in effect of content when the page loads. I’m guessing this is part of your theme. Try temporarily switching to the twentytwenty theme. If the error in browser console goes away, then it is confirmed that it’s your theme. It it’s not your theme, selectively deactivate plugins to zero in on the offending module. I’d then recommend you seek assistance through the dedicated support channel of the responsible module.
Thanks again but are you sure you’re looking at the right page because as far as I know (and see) there’s never been any fade-in effect for content. It just loads and then it’s there. I’m really getting a bit confused now although I really appreciate your approach for help.
The TwentyTwenty theme doesn’t have a collapsible button like this one does so I can’t test if that works or not. It must be theme related and I already tried deactivating all plug-ins and even reverting the theme back to the original files (I did some customisations) but unfortunately the button-issue stays where it is. The only difference is when I roll back to PHP 7.0 so that’s how I know it’s something that has to do with the PHP upgrade.
Whether the fade in effect manifests itself or not isn’t the issue. There’s code on the page that tries to apply a fade in effect which is causing an error. While twentytwenty doesn’t have your fold out eelement, the goal is to see if the Reference error: BrowserDetect is not defined
message goes away in the console. We don’t need the fold out element to do so.
I think what has happened is the change in PHP version has caused scripts to load in a different order. The script defining BrowserDetect
is probably still there, but is now executed after the BrowserDetect
variable is first referenced. This can happen when scripts are not properly enqueued with appropriate dependency parameters.
This may not actually resolve the broken fold out, but we cannot properly evaluate its functioning when there is a console error on the page. All the same, resolving this error will probably allow the fold out to work correctly.
If you’re not interested in the fade in effect, the best course of action is to remove any related script. We need to identify the module responsible to do so. Unless there is a related setting somewhere in the admin area, you’ll likely need the assistance of the responsible module’s developer.
Sorry for my extremely late reply and thanks so much for your help. I did find the fade in effect which is actually in the same line as the browserdetect, I think. My knowledge of advanced scripting doesn’t go that far.
If I actually remove the line and upload the file without it, the fold-out item works again! But I’m not sure if it’s safe to really remove it. It’s something related to IE6 and I don’t use that browser. I just commented it out now, but maybe you have a clue if it’s better to alter this line or that it’s safe to have it removed.
This is the line where the fade script goes including something ‘browserdetect’.
echo( '<script type="text/javascript">jQuery(document).ready(function(){ if( BrowserDetect.browser == "Explorer" && BrowserDetect.version <= 6){jQuery("#wrapper").fadeOut(2000);jQuery("#absolute").hide();jQuery("#absolute").load("'.$Modules->url.'ie6/template.html");jQuery("#absolute").fadeIn(2000);}});</script>' );