Uploaded image for project: 'Blesta Core'
  1. Blesta Core
  2. CORE-4786

Send flag for service activation in Services.addAfter and Services.editAfter events

    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.

        Activity

          People

          • Assignee:
            abdy Abdy Franco
            Reporter:
            jonathan Jonathan Reissmueller
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              4/May/23

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 1 hour, 17 minutes
              1h 17m

                Agile