Problem/Motivation

In working on #3336243: Update Package Manager event documentation in package_manager.api.php I realized that a badly written validator could call stopPropagation() with actually adding an error

This may be would happen if the developer didn't realize that other validators still need to run to provide their own validation

while stopPropagation() should be used carefully or the user will not get all the validation messages if a subscribed called stopPropagation() without adding its own error or checking that \Drupal\package_manager\Event\PreOperationStageEvent::getResults had at least 1 error it could effectively be letting an operation proceed without running all the validation

Proposed resolution

Override stopPropagation() in \Drupal\package_manager\Event\PreOperationStageEvent to check for this

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

tedbow created an issue. See original summary.

tedbow’s picture

Issue tags: +core-post-mvp, +Needs tests

wim leers’s picture

tedbow’s picture

Status: Active » Needs work
Issue tags: +sprint, +DX (Developer Experience)
yash.rode’s picture

Assigned: Unassigned » yash.rode
yash.rode’s picture

Assigned: yash.rode » wim leers
Status: Needs work » Needs review
Issue tags: -Needs tests
wim leers’s picture

Assigned: wim leers » yash.rode
Status: Needs review » Needs work

Only nits — looking good! 👍

yash.rode’s picture

Assigned: yash.rode » wim leers
Status: Needs work » Needs review
wim leers’s picture

Assigned: wim leers » Unassigned

👍

wim leers’s picture

Status: Needs review » Reviewed & tested by the community

I meant to do this 🙈😄

tedbow’s picture

Assigned: Unassigned » tedbow

Looks good will merge when green

  • tedbow committed 842998e3 on 8.x-2.x
    Issue #3336247 by tedbow, yash.rode, Wim Leers: Throw an exception if...
tedbow’s picture

Assigned: tedbow » Unassigned
Status: Reviewed & tested by the community » Fixed

Great!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.