Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-10648

Validate plugin brakes edit in place

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.3.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      @kurund,
      On commit 41408 you applied validate to all forms.
      Unfortunately (at least in the reports, it doesn't seem that it is used in a lot of places yet), it brakes the edit in place.

        1. Step to reproduce:
          Create a report from template for the contibution per price list CRM_Report_Form_Price_Contributionbased
          Chose nickname+contact id
          the nickname is editinplace. but you get an error on blur
          "Cannot read property 'settings' of undefined"
        1. Analysis

      The issue are

      • The validate plugging is dynamically adding itself to all input (that aren't disabled) under the form
      • the table result in the report is under the form
      • the jeditable adds dynamically a form+input

      So when you exit the input field, the validation plugin kicks in, try to access some information on the form, check that on the nearest parent form, that is the "naked" form added by the edit in place, not the proper form

      Got a js error and the world ends.

        1. Solutions
      • On the validate, provide an option to not apply the validate to some field (there is an ignore:className option). In general, it makes the live of integrators way easier when you let an option to disable on of the default behaviour
      • On the edit in place, add the class that is ignored by the validate plugin

      Trying to check if upgrading the validate plugins help first, otherwise, applying the above solution

      X+

        Attachments

          Activity

            People

            • Assignee:
              xavier xavier dutoit
              Reporter:
              xavier xavier dutoit
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: