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

Tentative fix for saving records with new workflow #342

Closed
wants to merge 1 commit into from

Conversation

NightJar
Copy link
Contributor

Still breaks on subsequent save & publish, but the first one works

Stop gap fix for #333

Still breaks on subsequent save & publish, but the first one works
if (isset($changed['WorkflowDefinitionID']) &&
(
empty($changed['WorkflowDefinitionID']['before'])
|| empty($changed['WorkflowDefinitionID']['before'])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these the same thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears to be, yep. Perhaps the first was supposed to be isset.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isset would be covered by empty anyway, maybe we just need the one

// Ignore canPublish() if in the middle of having workflow added / removed
$key = $this->owner->baseClass() . '#' . $this->owner->ID;
if (isset(static::$itemsChangingWorkflow[$key])) {
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like false would suit the method name better, assuming it should return a bool (unless false and null have different results for the user, like a validation error)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They do, and this has been addressed in #345

@raissanorth
Copy link
Contributor

This pull request is now superseded by #345
Closing.

@raissanorth raissanorth closed this Feb 5, 2018
@dhensby dhensby deleted the pulls/weird-fix branch February 5, 2018 11:18
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

Successfully merging this pull request may close these issues.

3 participants