CRM-9032 Copying price set creates incorrect price field dependency

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.3.6
    • Fix Version/s: None
    • Component/s: CiviEvent
    • Labels:
      None

      Description

      When creating a copy of a complex price set containing 5 price fields, the copy has an unwanted interdependency between two of the price fields that is not present in the original. Choosing an option from field A hides all options from field B and vice versa. Fields C through E are unaffected. At this stage I have not linked the price set to an event - I am simply looking in the preview of the Price Set.

      I have looked through all entries in the price_sets, price_set_fields, and price_set_field_values tables, and can see no difference between the two price sets, other than the key fields.

      Deleting the clone and repeating the copy action results in the same behaviour. I am now looking at creating the clone from scratch instead, but would love it if there was an explanation or (if it's a bug) a fix available.

      Incidentally, dependent fields in price sets would be a great feature - does it exist?

        Attachments

        1. action-shot.png
          44 kB
          Al McNicoll
        2. after.png
          45 kB
          Al McNicoll
        3. before.png
          44 kB
          Al McNicoll

          Activity

          [CRM-9032] Copying price set creates incorrect price field dependency
          David Greenberg added a comment -

          Pretty sure there isn't any "dependent field" capability in price sets at this point. Hence, quite puzzled by the behavior you're reporting. You'll need to replicate this w/ a (hopefully) simpler setup on the public demo.

          You should also view the source of the page (browser -> view source) and check for onclick or onchange javascript statements attached to any of the fields. Also check for javascript errors using Firebug.

          Al McNicoll added a comment -

          OK, so I can't reproduce the problem on the demo site. Unpicking the javascript is a nightmare as it's all minified, but a comparison (using Chrome's inspector) between the demo and our own distro shows that there is an extra change handler on those radio buttons, pointing to the file "undefined:1" - inline js code I'm assuming?

          I'm guessing that at some stage someone has put in a hack on our Civi install to cover a particular scenario and maybe not thought through the consequences. I appreciate that this is perhaps a forum question now, and am OK for this bug to be closed, but if you know which file(s) I should start looking in to find where that code would be sitting, I'd be grateful!

          David Greenberg added a comment -

          A few places to look:

          1. See if a custom php directory and / or custom templates directory has been defined (Global Settings -> Directories)
          2. Check inline in the php and tpl files:
          CRM/Price/Form/Field.php
          templates/CRM/Price/Form/Field.tpl

            People

            • Assignee:
              Donald A. Lobo
              Reporter:
              Al McNicoll

              Dates

              • Created:
                Updated:
                Resolved: