Not sure if this error was reported before.

I was wondering if CM ever worked for any simple case where non-admin user moved content from Draft to In Review.

Notice: Trying to get property of non-object in Drupal\content_moderation\Plugin\Validation\Constraint\ModerationStateConstraintValidator->isFirstTimeModeration() (line 129 of core/modules/content_moderation/src/Plugin/Validation/Constraint/ModerationStateConstraintValidator.php).

Drupal\content_moderation\Plugin\Validation\Constraint\ModerationStateConstraintValidator->isFirstTimeModeration(Object) (Line: 87)
Drupal\content_moderation\Plugin\Validation\Constraint\ModerationStateConstraintValidator->validate(Object, Object) (Line: 185)
...
The website encountered an unexpected error. Please try again later.
Error: Call to a member function isRevisionTranslationAffected() on null in Drupal\content_moderation\ParamConverter\EntityRevisionConverter->convert() (line 101 of core/modules/content_moderation/src/ParamConverter/EntityRevisionConverter.php).

Drupal\content_moderation\ParamConverter\EntityRevisionConverter->convert('3', Array, 'node', Array) (Line: 99)
Drupal\Core\ParamConverter\ParamConverterManager->convert(Array) (Line: 89)
...
CommentFileSizeAuthor
#6 2817305.patch797 bytespericxc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pericxc created an issue. See original summary.

pericxc’s picture

Issue summary: View changes
Sam152’s picture

Can you please provide detailed steps on how to reproduce this?

pericxc’s picture

Title: Error Validating » Errors Validating - ( two cases)
Issue summary: View changes
pericxc’s picture

Also, CM doesn't have any test case for multi-user use case (second error).

This solution works for me.

   $revision_ids = $storage->getQuery()
        ->allRevisions()
        ->accessCheck(FALSE)
        ->condition($this->entityTypeManager->getDefinition($entity_type_id)->getKey('id'), $entity_id)
        ->sort($this->entityTypeManager->getDefinition($entity_type_id)->getKey('revision'), 'DESC')
   ...
  

Would like to see if anyone else tested it and if there is any other solution.

pericxc’s picture

Status: Active » Needs review
FileSize
797 bytes
pericxc’s picture

@Sam152, since there are no tests for those kind of use cases. For example, second user has only one permission - "Keep in Draft". I guess it has to be manually tested. Would you please verify?

Sam152’s picture

I have been using content moderation with a mixture of different permissions on roles. There is no reason we can't create two users with different permissions in a test to verify and test this functionality.

Sam152’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

timmillwood’s picture

Status: Needs work » Closed (outdated)