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

Order form summary fetch is triggered many times by option logic

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.5.0-b1
    • Component/s: None
    • Labels:
      None

      Description

      To reproduce:

      1. Create a config option group "Logic"
      2. Create 3 config options and assign them to the option group
      3. Edit option logic and the option group and set rules on at least two of the options
      4. Assign the option group to a package
      5. Assign the package to an order form
      6. Proceed to the order form
      7. Open the browser inspector to monitor ajax requests
      8. Add the package to cart
      9. See that 3+ ajax calls are made to fetch the order summary

      The option logic js triggers the change event for every config option on page load so that logic rules are evaluated. One option to resolve the issue is to change app/views/client/bootstrap/partial_packageoption_js.pdt line 14 from:

              // Trigger option evaluations
              $('input,textarea,select', container_selector).change();
      

      To

              var tempFetchSummary = null;
              if (typeof fetchSummary === "function") {
                  tempFetchSummary = fetchSummary;
                  fetchSummary = function(){};
              }
      
              // Trigger option evaluations
              $('input,textarea,select', container_selector).change();
      
              if (typeof tempFetchSummary === "function") {
                  fetchSummary = tempFetchSummary;
                  fetchSummary();
              } 
      

        Activity

        jonathan Jonathan Reissmueller created issue -
        jonathan Jonathan Reissmueller made changes -
        Field Original Value New Value
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.5.0 Sprint 5 [ 159 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Status Open [ 1 ] In Review [ 5 ]
        Resolution Fixed [ 1 ]
        abdy Abdy Franco made changes -
        Remaining Estimate 0 minutes [ 0 ]
        Time Spent 23 minutes [ 1380 ]
        Worklog Id 15773 [ 15773 ]
        jonathan Jonathan Reissmueller made changes -
        Sprint 5.5.0 Sprint 5 [ 159 ] 5.5.0 Sprint 5, 5.5.0 Sprint 6 [ 159, 160 ]
        jonathan Jonathan Reissmueller made changes -
        Rank Ranked higher
        jonathan Jonathan Reissmueller made changes -
        Status In Review [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:
              Fix Release Date:
              29/Jun/22

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 23 minutes
              23m

                Agile