This site has the following add-ons installed via the add-ons control panel:
This site has previously had the addon collective.easyslideshow installed and then removed.
I made a mistake with the editing of the front-page and I attempted to revert to a previous version. When I try to revert to any of the previous versions I get the following error displayed when logged in as the admin user:
I've done a bit of poking about and I've got the icons to display properly now. I think the icons issue may have been related to uninstalling and removing collective.easyslideshow? I had a poke in the resource registry and saw that I still had a JS related to easyslideshow installed as part of the plone-legacy bundle. I removed this and rebuilt plone-legacy, but no difference noted. Taking the resource registry in/out of debug mode after this seems to have fixed the problem.
I still have the problem with not being able to revert any content to previous versions. Any ideas where to look for this?
actually, taking the resource registry in/out of debug mode is the only way to rebuild plone-legacy. I don't see how you could have 'rebuilt' the plone-legacy bundle without the debug mode switch, there is no 'build' button with this very special bundle.
Symptoms like this usually indicate some breakage in a previous bundle part. In debug mode, resources are provided individually and there is few interference from one resource with following resources; in non-debug mode, resources are bundled and problems in one part (for example syntax errors) may cause severely affect following parts. Check the browser console to learn about JS and CSS problems detected during page rendering.
If you are lucky (likely, you will not), then the "Insufficient Privileges" error is associated with an Unauthorized exception. In this case, reconfiguration of the error_log object in your site (not to ignore Unauthorized) can give you an entry there for your problem. In this case, configuring verbose-security can give you quite detailed information about the problem.
Unfortunately, it is quite likely, that Plone uses its own code for the "Insufficient Priviledges" - and likely no Unauthorized exception is involved or it is caught early by Plone. In this case, the above approach will not help. Instead, you could try to localize the Plone code responsible for the "Insufficient Priviledges" check and debug it to find out why it fails.
Browser console shows the following when rendering any page:
Source map error: request failed with status 404
Resource URL: http://vm-tallinn.ee.ucl.ac.uk:9090/ipes-cdt/++plone++production/++unique++2018-03-12T16:20:02.869263/default.js
Source Map URL: jquery.min.map
patterns.Patternslib Base: This pattern without a name attribute will not be registered!
The browser console errors still appear if I put this in debug mode, but the icons display is fixed, so I don't think this is the cause of the problem. Out of debug mode the icons display is broken again....
I've stopped the error log ignoring Unauthorized errors and now this is logged when I try to revert:
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module Products.CMFCore.FSPythonScript, line 127, in __call__
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 344, in _exec
Module script, line 4, in revertversion
<FSPythonScript at /ipes-cdt/revertversion used for /ipes-cdt/front-page>
- Line 4
Module AccessControl.ZopeGuards, line 305, in guarded_import
Unauthorized: import of 'six' is unauthorized
This is good news: the problem is in a Python script named revertversion. Recursively search you file system (when the Plone components are placed) for a file revertversion.py. It imports the module six (a helper to get code compatible with both Python 2 and Python 3) but six is not declared "safe" for imports in untrusted code.
There are several possibilities to fix the problem:
allow the import of six in untrusted code. For this you would put the following code sequence somewhere executed during startup:
from AccessControl import allow_module
find out to which component the script above belongs and try to use an older version of this component (by version pinning) -- one that does not yet try to be compatible with both Python 2 and Python 3. The components "Change log" likely gives hints towards this version.
Yes as @dieter said use Firefox and especially the network window, where you could see if URL are failing (404 errors) it would indicate that really the resource redirection problem that @espenmn was talking about is hitting you. If you see 404 errors and weird URL with ++production...++plone.static it's the culprit.
The problem is with the release of Products.CMFEditions that was installed as part of the 5.1 upgrade. The changelog states that version 3.1.1 is to "Prepare for Python 2 / 3 compatibility", so I guess this is where the "six" dependency was added?
I fixed this issue by adding the following to the "[versions]" section of buildout.cfg and rerunning buildout:
Products.CMFEditions = 3.1
Now I can revert to earlier versions of content. I have 3 sites currently running 5.1 and this problem affects them all, so maybe this version of CMFEditions needs to pinned in the default version.cfg for plone 5.1?
Thanks so much for all your help.
Hopefully we'll get the toolbar icons issue sorted as well!