Throw an exception if stopPropagation() called for `PreOperationStageEvent` and no error has been added

Created on 24 January 2023, almost 2 years ago
Updated 27 January 2023, almost 2 years ago

Problem/Motivation

In working on 📌 Update Package Manager event documentation in package_manager.api.php Fixed 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

📌 Task
Status

Fixed

Version

2.0

Component

Code

Created by

🇺🇸United States tedbow Ithaca, NY, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024