Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.7.0-b1
-
Component/s: None
-
Labels:None
Description
Plugins often want to know when a service is being activated. We should a boolean 'service_activated' that contains this info so the plugin doesn't have to do it's own evaluation.
Something like changing
// Trigger the Services.addAfter event
$this->executeAndParseEvent('Services.addAfter', ['service_id' => $service_id, 'vars' => $vars]);
To
// Trigger the Services.addAfter event
$this->executeAndParseEvent(
'Services.addAfter',
[
'service_id' => $service_id,
'vars' => $vars,
'service_activated' => ($vars['status'] ?? null) == 'active'
]
);
And similar for edit that checks if the status is being changed from pending to active.