This is a sister issue of #2996431: Fix docs for ConditionPluginBase and together they make very hard to read / follow the condition plugin system. When the execute() method of a condition plugin is called it calls the condition plugin manager which in turn calls back the evaluate() method of the same plugin. Both of these steps are mistyped: the manager property typehint is incorrect as the issue notes and this issue is about ConditionManager::execute() calling evaluate() but that method doesn't exist on ExecutableInterface, the only reason this never blows up is because everyone calls this via the aforementioned ConditionPluginBase::execute() with said plugin as the argument and that's not only an ExecutableInterface but also it's a ConditionInterface. The attached simple patch merely codifies this. Altering the interface is much harder in light of BC policies and this is enough (once the sister issue at least gets the typehint fixed).
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 3065586_4.patch | 1.12 KB | ghost of drupal past |
| #4 | interdiff.txt | 886 bytes | ghost of drupal past |
Comments
Comment #2
ghost of drupal pastComment #3
alexpottLet's throw a
As that way we conform to the already documented interface. Otherwise this looks good and although this theoretically changes BC because a fatal is now an exception we don't really make any promises about that AND the
ExecutableExceptionis already on the interface.Comment #4
ghost of drupal pastThanks for the review.
Comment #5
ghost of drupal pastComment #6
bircherThat makes sense.
I have no concerns about BC for going from a fatal to an exception since both should be avoided and potentially found in a development environment. In addition this change will make it easier to understand and reason about it in case that happens.
Comment #7
alexpottCommitted and pushed 91bbb61c14 to 8.8.x and 89e91f6c15 to 8.7.x. Thanks!
Backported as this is a bugfix and the BC implications are minimal.