plone / Products.CMFPlone

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

File with workflow is downloaded on pusblish action in toolbar #3676

Closed jensens closed 1 year ago

jensens commented 1 year ago

BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)

What I did:

Take Plone 6 ClassicUI, give type "File" a (Default) workflow (ZMI -> portal_workflow).

Create a file and upload some crap.

Publish file using action in toolbar

What I expect to happen:

File is published, site is reloaded, I am still on file view, in toolbar I see it is published.

What actually happened:

File is downloaded. /no reload happens.

After site reload it is pubslihed,

What version of Plone/ Addons I am using:

https://6-classic.demo.plone.org as of today.

    Plone 6.0.0b4.dev0 (6009)
    CMF 2.6.0
    Zope 5.7.dev0
    Python 3.8.3 (default, Jul 14 2020, 07:39:54) [GCC 7.5.0]
    PIL 9.3.0 (Pillow)
    WSGI: On
    Server: waitress 2.1.2
jensens commented 1 year ago

cc @gogobd

jensens commented 1 year ago

The redirect from content_status_modify does not take into account it should load a specific view, but uses the absolute_url. https://github.com/plone/plone.app.content/blob/ee6b62934ce926c5f9903e0294bc39a59e3709b6/plone/app/content/browser/content_status_modify.py#L147

mauritsvanrees commented 1 year ago

Easiest would be to always redirect it to /view, which seems to be what was done before.

Otherwise check the registry for plone.types_use_view_action_in_listings.

I am having a look.