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

[Workflows] Allow for "Only save new version" transition #4101

Open
ivanmerta opened this issue Mar 20, 2019 · 5 comments

Comments

Projects
None yet
3 participants
@ivanmerta
Copy link
Contributor

commented Mar 20, 2019

It would be great if there is an option in transition that would only save new version but would keep the currently published version still the published one - possibly with a new Change Publish State option.
Currently, it seems that it saves version only if the object is unpublished but it is not possible to save new version only when the object is published.

This would allow workflow scenarios like - https://talk.pimcore.org/t/only-save-new-version-option-in-workflow/1929.

@PaulSchumacher

This comment has been minimized.

Copy link

commented May 7, 2019

I am suffering from the same problem, is there any update on this feature/bug?

@fashxp

This comment has been minimized.

Copy link
Member

commented May 13, 2019

could you please check, if #4360 resolves your issues?

@PaulSchumacher

This comment has been minimized.

Copy link

commented May 14, 2019

Thanks for your reply. I still got some problems with my workflow which could relate to the pull request.

There seems to be a problem with force_publish if the user didn't get the permissions to publish a document directly.
If the user has the permissions to publish, the document will get published on every state change.

pimcore:
    workflows:
        workflow:
            label: 'workflow'
            type: 'state_machine'
            supports:
                - 'Pimcore\Model\Document\Page'
            places:
                new:
                    label: 'init'
                    color: '#636363'
                edited:
                    label: 'edited'
                    color: '#377ea9'
                rejected:
                    label: 'rejected'
                    color: '#28a013'
                in_review:
                    label: 'in review'
                    color: '#d9ef36'
                ready_to_publish:
                    label: 'ready to publish'
                    color: '#70ab2a'
                published:
                    label: 'Live'
                    color: '#636363'
            transitions:
                set_in_review:
                    from: edited
                    to: in_review
                    options:
                        label: 'Änderungen in Review geben'
                        changePublishedState: 'no_change' # expected to save a new version without publishing it
                rejecting:
                    from: in_review
                    to: rejected
                    options:
                        label: 'Änderungen nicht OK'
                        notes:
                            commentEnabled: true
                            commentRequired: true
                        changePublishedState: 'no_change' # expected to save a new version without publishing it
                updating:
                    from: [rejected, published, new, in_review]
                    to: edited
                    options:
                        label: 'Änderungen werden gemacht'
                        changePublishedState: 'no_change' # expected to save a new version without publishing it
                publishing:
                    guard: 'subject.getUserModification() != user.getId() or "ROLE_PIMCORE_ADMIN" in roles'
                    from: in_review
                    to: published
                    options:
                        label: 'veröffentlichen'
                        changePublishedState: 'force_published' # expected to save and publish
@fashxp

This comment has been minimized.

Copy link
Member

commented May 21, 2019

is the document published, when the workflow starts?
maybe the permission setting in the place config can help?

permissions:
   - condition: "has_role('ROLE_PIMCORE_ADMIN')"
     publish: false
     save: true
     delete: false
@PaulSchumacher

This comment has been minimized.

Copy link

commented May 22, 2019

I still get some problems when I am starting my workflow with a published document. I have entered your permission config to my workflow places to prevent publishing the document by an admin besides the workflow. If the admin user is saving the document, the document will become unpublished. If a user without publishing permissions is saving the document, pimcore ist only saving a new version without unpublishing the document (works as expected).

Another problem I've encountered is that the "changePublishedState: 'no_change'" is working inconsistently.
After I have created a new document with my admin user and went through the workflow once in order to publish my document. I started editing and saving the published document with my test user without publishing permissions. After this, the workflow became buggy and published the document on every transition.
When I am starting my workflow with my test user everything works fine until the admin user is doing one transition on a published document.
This seems to be a problem with the versions when I am working with multiple users on one document (editing, saving, running workflow transitions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.