Hi!,
Thanks for letting us know. I can see that Slider Revolution is not a free plugin so we can’t really test it. Also please ask at their support desk if they can prevent loading their scripts and data on admin pages that are not theirs.
That said, the fix is probably quite simple by adding a check. This will be included in the next version.
In the meanwhile you can apply the patch to the javascript manually in maxbuttons-admin.js ( around line 506, replace the json parse statement with this: )
try
{
condition = JSON.parse(condition);
}
catch(errorVar)
{
console.log('Data show error: ' + errorVar);
}
When the next update hits you can just update it without issues. You can also get it from the updates branch:
https://bitbucket.org/MF_Team/maxbuttons/src/updates/
Can you please provide the EXACT lines from the maxbuttons-admin.js that are to be replaced with the above code sample?
Bas, you will need a larger try catch. The next statement looks for the condition.target which will then be null and throw an error it’self. The try catch should extend to line 524.
@bryanearl907 It’s line 506, look for :
condition = JSON.parse(condition);
And then replace that line with the snippet above.
@jbartley13
Probably better to use a return on error, so it will just stop processing that one. Like so:
try
{
condition = JSON.parse(condition);
}
catch(errorVar)
{
console.log('Data show error: ' + errorVar);
return;
}
Does that help?
I have the same problem.
Reverting back to version 9.3 temporarily solved it.
Instead of the proposed check wouldn’t it be better to rename the condition variable to something with a prefix like mbCondition (and other vars later as well)?
That way the chance for a future collision gets significantly lower.
In that specific situation the authors of Slider Revolution aren’t entirely at fault as in my case I have a really old version of their plugin (a few years old), bundled with the theme and this variable has existed since then.
Yes it’s not great that they’ve loaded their scripts everywhere but they’re not the only ones doing so and it’s always a better solution to try and avoid such situations by using prefixes.
Version 9.4.1 should fix the conflict.
In a future version I might rename the variables, but this is some work. Maxbuttons doesn’t / shouldn’t load in places it has no business in. Nonetheless there are many checks to prevent conflicts of plugins who decided to come and crash in our screens ^^ , not all can ever be prevented sadly, such is the nature of Javascript.