Products.cmfplone: global_statusmessage viewlet is duplicated for many control panel pages in Plone 5.1

Created on 13 Sep 2019  路  5Comments  路  Source: plone/Products.CMFPlone

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.

bug

All 5 comments

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

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)

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?

@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.

Was this page helpful?
0 / 5 - 0 ratings