Skip to content
Snippets Groups Projects

Issue #3449851: LogicException: The LangcodeRequiredIfTranslatableValues constraint can only operate on the root object being validated

Closed Issue #3449851: LogicException: The LangcodeRequiredIfTranslatableValues constraint can only operate on the root object being validated
2 unresolved threads
2 unresolved threads

Issue #3449851: Convert LogicException to E_USER_DEPRECATED in LangcodeRequiredIfTranslatableValuesConstraintValidator

Closes #3449851

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
23 22 $mapping = $this->context->getObject();
24 23 assert($mapping instanceof Mapping);
25 24 if ($mapping !== $this->context->getRoot()) {
26 throw new LogicException('The LangcodeRequiredIfTranslatableValues constraint can only operate on the root object being validated.');
25 // @todo Convert this deprecation to LogicException.
  • 23 22 $mapping = $this->context->getObject();
    24 23 assert($mapping instanceof Mapping);
    25 24 if ($mapping !== $this->context->getRoot()) {
    26 throw new LogicException('The LangcodeRequiredIfTranslatableValues constraint can only operate on the root object being validated.');
    25 // @todo Convert this deprecation to LogicException.
    26 @trigger_error('Calling the LangcodeRequiredIfTranslatableValues constraint on other than the root object being validated is deprecated in drupal:10.3.0 and removed in drupal:11.0.0. See https://www.drupal.org/project/drupal/issues/3449851', E_USER_DEPRECATED);
    • Suggested change
      26 @trigger_error('Calling the LangcodeRequiredIfTranslatableValues constraint on other than the root object being validated is deprecated in drupal:10.3.0 and removed in drupal:11.0.0. See https://www.drupal.org/project/drupal/issues/3449851', E_USER_DEPRECATED);
      26 @trigger_error('Calling the LangcodeRequiredIfTranslatableValues constraint on other than the root object being validated is deprecated in drupal:10.3.0 and will trigger \LogicException in drupal:11.0.0. See https://www.drupal.org/project/drupal/issues/3449851', E_USER_DEPRECATED);

      Also we need to fix the link here. It needs to point to a change record.

    • Alex Pott changed this line in version 2 of the diff

      changed this line in version 2 of the diff

    • Please register or sign in to reply
  • Alex Pott added 24 commits

    added 24 commits

    Compare with previous version

  • closed

  • Please register or sign in to reply
    Loading