Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolbar delete action - actionOption redirectOnResponse for modal pattern is ignored #3197

Open
fulv opened this issue Oct 13, 2020 · 0 comments · May be fixed by #3198
Open

Toolbar delete action - actionOption redirectOnResponse for modal pattern is ignored #3197

fulv opened this issue Oct 13, 2020 · 0 comments · May be fixed by #3198

Comments

@fulv
Copy link
Member

fulv commented Oct 13, 2020

The delete action menu item in the Plone toolbar uses pat-modal, with an actionOptions data object to provide configuration for the pattern. This is the rendered HTML:

<a href="https://blahblahblah/delete_confirmation?_authenticator=blah"
  title=""
  id="plone-contentmenu-actions-delete"
  class="actionicon-object_buttons-delete pat-plone-modal"
  data-pat-plone-modal="{&quot;actionOptions&quot;: {&quot;disableAjaxFormSubmit&quot;:true, &quot;redirectOnResponse&quot;:true}}">
    Delete
</a>

Both disableAjaxFormSubmit and redirectOnResponse are set to true. However, looking at the pattern source, it appears that the place where redirectOnResponse is checked would never be reached if disableAjaxFormSubmit === true:

https://github.com/plone/mockup/blob/master/mockup/patterns/modal/pattern.js#L383

Therefore, I would say that setting redirectOnResponse is superfluous.

The action menu comes from here:

https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/profiles/default/actions.xml#L192

@fulv fulv changed the title Toolbar delete action - ignored actionOption redirectOnResponse for modal pattern Toolbar delete action - actionOption redirectOnResponse for modal pattern is ignored Oct 13, 2020
@fulv fulv linked a pull request Oct 14, 2020 that will close this issue
fulv added a commit to plone/plone.app.upgrade that referenced this issue Oct 14, 2020
fulv added a commit to plone/plone.app.upgrade that referenced this issue Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant