verbb / workflow

A Craft CMS plugin to create a workflow for publishing entries.
Other
140 stars 27 forks source link

Error when trying to compare in the workflow CP #173

Closed green17 closed 1 year ago

green17 commented 1 year ago

Describe the bug

Getting this error when trying to compare in the workflow CP.

craft\services\Elements::getElementById(): Argument #1 ($elementId) must be of type int, null given, called in /var/www/html/vendor/verbb/workflow/src/models/Review.php on line 113

Steps to reproduce

  1. View submissions
  2. Click cog then Compare

Craft CMS version

4.2.5.1

Plugin version

2.0.1

Multi-site?

No

Additional context

No response

engram-design commented 1 year ago

Should be fixed already in 2.0.2

green17 commented 1 year ago

Still having a problem on this with "verbb/workflow": "dev-craft-4 as 2.0.2,

Error: Call to a member function setAttributes() on null

  1. in /var/www/html/vendor/verbb/workflow/src/models/Review.php
engram-design commented 1 year ago

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.

green17 commented 1 year ago

Still having a problem with this on the new version error is now:

Impossible to invoke a method ("getFieldLayout") on a null variable.
engram-design commented 1 year ago

I think this is probably because you're trying to view an approved review on a submission, which won't be that helpful. That's because the draft entry that was approved was applied to the original entry, deleting it. As such, the (draft) entry that the submission was all about is gone, so it's got nothing to compare to.

It's a little frustrating that the draft doesn't stick around as a bit of a paper trail, but that's how Craft's draft system works.

I've just pushed a fix for this (run composer update)

engram-design commented 1 year ago

Fixed in 2.0.3