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

Status not saving after change and save - new entry edit screen in workflow #175

Closed
green17 opened this issue Dec 6, 2022 · 8 comments
Closed

Comments

@green17
Copy link

green17 commented Dec 6, 2022

Describe the bug

Status not saving after change and save - new entry edit screen in workflow
/admin/workflow/submissions/edit/XXXXX

Steps to reproduce

  1. View an entry that needs to be approved eg /admin/workflow/submissions/edit/XXXXX
  2. Click the dropdown right-hand side to change the status then hit save. It looks like it saves but the status does not get saved.

Craft CMS version

4.2.5.1

Plugin version

2.0.1

Multi-site?

No

Additional context

No response

@engram-design
Copy link
Member

Duplicate of #168, can you try 2.0.2?

@green17
Copy link
Author

green17 commented Dec 6, 2022

Hi @engram-design I upgraded to 2.0.2 but then some entries in the workflow give this error - just viewing them:

Diff\Differ\MapDiffer::doDiff(): Argument #1 ($oldValues) must be of type array, null given, called in /vendor/verbb/workflow/src/services/Content.php on line 39

@green17
Copy link
Author

green17 commented Dec 6, 2022

Also the link to the entry is missing now on the right hand menu in /admin/workflow/submissions/edit/XXXXX

@engram-design
Copy link
Member

The error should be fixed for the next release. To get the fix early, change your verbb/workflow requirement in composer.json to:

"require": {
  "verbb/workflow": "dev-craft-4 as 2.0.2,
  "...": "..."
}

Then run composer update.

As for the missing entry in the sidebar, what state is your submission? Pending, in review or approved? If you look up the ID of the submission (the XXXXX part) in your workflow_submissions database table, is there a value for ownerId?

Once scenario where this might happen is that you've created a submission on an already-published entry (creating a new draft), and if approved, the draft will be deleted, but applying (overwriting) the original entry. But even in that instance, it should refer back to the canonical entry, instead of the now-deleted draft.

@green17
Copy link
Author

green17 commented Dec 8, 2022

Yes there is an ID in ownerId in the DB, the id if looked up in entires works fine too. On the staging site it works for the 2.0.1 plugin version, we have a copy of the staging site DB for the local dev and it does not show on any of these pages - /admin/workflow or /admin17/workflow/submissions/edit/XXXXX.

If I do a new submission for review on an entry that is completely new it still does not work?

@engram-design
Copy link
Member

Strange! I've done a whole lot of submissions in multiple scenarios, checking each step along the way, and there's always a reference to the entry.

It should fetch the last review's draft. If you can look at the workflow_review database table, for the submissionId column to match the submission you are referring to, there should be both an elementId and a draftId.

image

Regardless, I've added support for things to fallback on the owner, when a draft doesn't exist, which should help. Run composer update again to get this fix.

@green17
Copy link
Author

green17 commented Dec 8, 2022

The fallback fixes it thanks. :-)

When I looked up a few some have no elementId or draftId, some have no draft id but have a elementId then some have both. If I look up one submissionId that has an edit/review/publish the edit/publish is blank for elementId or draftId and then the review had a elementId but no draftId.

image

@engram-design
Copy link
Member

Fixed in 2.0.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants