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

        jonathan Jonathan Reissmueller created issue -
        jonathan Jonathan Reissmueller made changes -
        Field Original Value New Value
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Story Points 2
        jonathan Jonathan Reissmueller made changes -
        Fix Version/s 5.7.0-b1 [ 11737 ]
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.7.0 Sprint 1 [ 169 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        abdy Abdy Franco made changes -
        Assignee Abdy Franco [ abdy ]
        abdy Abdy Franco made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        abdy Abdy Franco made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 1 hour, 5 minutes [ 3900 ]
        Worklog Id 16064 [ 16064 ]
        abdy Abdy Franco made changes -
        Status In Progress [ 3 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.7.0 Sprint 1 [ 169 ] 5.7.0 Sprint 1, 5.7.0 Sprint 2 [ 169, 171 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.7.0 Sprint 1, 5.7.0 Sprint 2 [ 169, 171 ] 5.7.0 Sprint 1, 5.7.0 Sprint 2, 5.7.0 Sprint 3 [ 169, 171, 172 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.7.0 Sprint 1, 5.7.0 Sprint 2, 5.7.0 Sprint 3 [ 169, 171, 172 ] 5.7.0 Sprint 1, 5.7.0 Sprint 2, 5.7.0 Sprint 3, 5.7.0 Sprint 4 [ 169, 171, 172, 173 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        abdy Abdy Franco made changes -
        Time Spent 1 hour, 5 minutes [ 3900 ] 1 hour, 17 minutes [ 4620 ]
        Worklog Id 16118 [ 16118 ]
        jonathan Jonathan Reissmueller made changes -
        Status In Review [ 5 ] Closed [ 6 ]

          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