Silva Link preview tab doesn't work on updated Silva Dataset

Bug #1065240 reported by mallow on 2012-10-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Ever since Silva 2.1 clicking on the preview tab simply logs the user out of Silva with no possibility of successfully logging in until one clicks another button aside from the preview tab. This is an old bug.

I did a test:
Since I am unable to update to 2.3.6 at this time I am upgrading to 2.3.5.

I did two installations.
One using our current Data.fs file, and one completely fresh installation of 2.3.5

I used the tagged '2.3.5' and the Buildout instructions (ie.

On the instance of the upgraded Silva content the preview tab fails and logs the user out just as it does on our production environment 2.1. On the fresh install, however, it works as expected.

It seems as though there is some legacy bug in our data set or something? How can I fix this?

mallow (princemallow) wrote :

Additional Test:

The test I did above involves two separate instances of Zope/Silva.

I just attempted an additional test. Using the instance where the Preview tab isn't working I made a new silva site within the same instance. And the new silva site works fine as well.

Could it have anything to do with modifications made to the frontend.html file?

description: updated
Sylvain Viollon (thefunny) wrote :

We won't fix this in 2.3. You should update to 3.0.

Changed in silva:
status: New → Won't Fix
mallow (princemallow) wrote :

Since I can't really upgrade to 3.0 at this time, I've decided to patch this for my system today. I am posting this for anybody interested.

Within the Silva Product locate the file called:
Mine is not installed via buildout (doesn't work with 2.3 anyways) so it's located under the silva folder then

Comment out lines 29-32:
 29 """if not getSecurityManager().getUser().has_permission(
 30 SilvaPermissions.ChangeSilvaContent, target):
 31 tab = 'tab_preview'
 32 """

What the commented out lines do:

The check to see if the user has permission to edit the resource selected, if they do then they get to view that resource in whatever editor module that resource is handled with. If the user does not have permission to edit that resource, then they are redirected to the whatever preview module that resource is handled with.

What the bug does:

For some reason unknown to me, our product behaves this way: When the user doesn't have the permission to edit a resource, they are redirected to the preview module and logged out. They are also presented with a log in screen and confused again and again as to why they are constantly being asked to log in.

We went around this by giving the user the ability to edit everything but that's not ideal

What Commenting the line does:
Now it will not check if the user has permission to view that resource, it will automatically bring them to the edit module. If it's a folder or publication, then fine, it gives them the hierarchical view, if it's not, then it logs them out. So it just moves the bug in a less annoying place.

This will only change what happens in the Content view in Silva. Not in any other view such as publish, nor does it change the behavior of the preview tab.

To change the behavior in the 'Publish / Status' View

Edit file: Products/Silva/views/edit/Container/

Change line 173 from this
href string:${obj_url}/edit/tab_preview;
href string:${obj_url}/edit/tab_edit;

I don't know if it's required, but restart the zope service/server

mallow (princemallow) wrote :

Hold on, might need to make a modification to my changes

mallow (princemallow) wrote :

My patch is fine, just when you comment out don't forget to keep up with the tabs

Also it won't change the link in the preview column

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers