plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
246 stars 186 forks source link

global_statusmessage viewlet is duplicated for many control panel pages in Plone 5.1 #2947

Closed djowett-ftw closed 1 year ago

djowett-ftw commented 5 years ago

BUG

We're making ftw.globalstatusmessage plone5 compatible, and as such have put our (non-transient) status message into the plone.globalstatusmessage viewlet manager which was introduced with Plone 5. This works fine in the content tree, but many(most?) of the controlpanels display the status message twice - as shown below.

Screenshot 2019-09-13 at 11 18 05

What I did:

Vanilla Plone install + ftw.globalstatusmessage from our development branch: ftw.globalstatusmessage = git https://github.com/4teamwork/ftw.globalstatusmessage.git branch=dj/plone5.1

What I expect to happen:

Only one global status message to be shown

What actually happened:

Two global status messages are shown

What version of Plone/ Addons I am using:

ftw.globalstatusmessage

Theories of cause

This viewlet manager shouldn't be included twice on a single page. We think that Plone might have got away with this until now, because i) not many things use this new Viewlet Manager ii) normal status messages are transient and therefore after the viewlet in one viewlet manager consumes the message for display, the viewlet in the other viewlet manager won't find it.

djowett-ftw commented 5 years ago

I'm on a new github account - so don't have permission to add labels it seems

ale-rt commented 5 years ago

I think the viewletmanager changed to IGlobalStatusMessage https://github.com/plone/plone.app.layout/blob/master/plone/app/layout/viewlets/configure.zcml#L54

djowett-ftw commented 5 years ago

Thanks @ale-rt - it did, but that's been included twice - see below:

(The first one comes through plone/app/registry/browser/controlpanel_layout.pt)

djowett-ftw commented 5 years ago

Simply put.... the global_statusmessage used to be slot in Plone 4 but is now a viewlet in Plone 5

However, when it was converted it also moved from inside of #content slot to outside it. That means that anything overriding the #content slot should not include a global_statusmessage viewlet - but controlpanel continues to do so. It may have been intentional (though I would hazard a guess it wasn't), but if so it should somehow restrict the display of the gsm viewlet outside #content.

Does that make sense?

fredvd commented 4 years ago

@djowett-ftw Related warning, found your issue while searching for duplicates: there is more trouble: I'm looking into a strange case where the status message type is not translated in easyform's. The status message of forms (z3c.form & plone.app.z3cfrm) are included in the content as well and use the css styling, but could also possibly cause duplicates. Check macros.pt in plone.app.z3cform.

jensens commented 1 year ago

I close the issue, because it addresses a Plone version that is no longer supported. If you think this is wrong please reopen the issue and assign a matching milestone.