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

Add placeful workflow for mails in inbox area #5325

merged 3 commits into from Feb 8, 2019


None yet
3 participants
Copy link

njohner commented Feb 5, 2019

Mails cannot be edited in the inbox, because of the inbox workflow introduced in #4648, preventing inbox group users are to edit the inbox. A placeful workflow was added for documents to allow editing of documents in the inbox, but not for mails. We correct this here.

For the upgrade step, we cannot simply use the PlacefulWorkflowPolicyActivator. The problem is that the opengever_inbox_policy is already active on the inbox and that we simply add a workflow for mails, so that as soon as we call self.install_upgrade_profile(), the objects in the inbox will be on the new workflow, and WorkflowChainUpdater called from PlacefulWorkflowPolicyActivator will not apply the state mapping. Hence we have to do this by hand.

For easier review I have a first commit simply copying the opengever_mail_workflow as a new placeful workflow, and then modifying it.

resolves #5198

@njohner njohner requested a review from 4teamwork/gever Feb 5, 2019

for inbox in inboxes:
activator = PlacefulWorkflowPolicyActivator(inbox)

This comment has been minimized.


jone Feb 5, 2019


I think you don't need a PlacefulWorkflowPolicyActivator at all, because you are not activating a new placeful policy, right? The PlacefulWorkflowPolicyActivator actually just enables a new placeful workflow policy and then uses the WorkflowChainUpdater. So this should be doable with only using WorkflowChainUpdater.

I would do it like this:

from operator import methodcaller

inbox_paths = map(methodcaller('getPath'),
                  self.catalog_unrestricted_search(…, full_objects=False))

mails_in_inboxes = self.catalog_unrestricted_search(
    {'path': inbox_paths, portal_type='ftw.mail.mail'},

with WorkflowChainUpdater(mails_in_inboxes, review_state_mapping):

This comment has been minimized.


njohner Feb 5, 2019

Author Member

Thanks for the clarification

@njohner njohner force-pushed the nj_inbox_mail branch from b84fa03 to 8d9fa5e Feb 5, 2019

@deiferni deiferni added this to the Release 2019.1 milestone Feb 6, 2019

Copy link

deiferni left a comment


@njohner njohner merged commit bb2e1f3 into master Feb 8, 2019

8 checks passed

CI Governor: test-docs-intern.cfg Task #361969 succeeded
CI Governor: test-docs-public-fr.cfg Task #361970 succeeded
CI Governor: test-docs-public.cfg Task #361971 succeeded
CI Governor: test-i18n-de.cfg Task #361972 succeeded
CI Governor: test-plone-4.3.x.cfg Task #361973 succeeded
CI Governor: test-qa.cfg Task #361974 succeeded
CI Governor: test-testserver-selftest.cfg Task #361975 succeeded
CI Governor: test-xml-convention.cfg Task #361976 succeeded

@njohner njohner deleted the nj_inbox_mail branch Feb 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment