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

Remove 'Select' option from price option visibility drop-down (undefined index visibility_id error)

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.7.26
    • Fix Version/s: 4.7.30
    • Component/s: None
    • Labels:
    • Versioning Impact:
      Patch (backwards-compatible bug fixes)
    • Documentation Required?:
      None
    • Funding Source:
      Needs Funding
    • Verified?:
      No

      Description

      Since CRM-12167 we can make price options 'Public' or 'Admin.

      However, this 'visibility_id' field is not mandatory when creating the options. When it is not set, you receive an 'undefined index' error on the front end registration form.

      Notice: Undefined index: visibility_id in CRM_Event_Form_Registration_Register::buildAmount() (line 598 of /srv/buildkit/build/dmaster/sites/all/modules/civicrm/CRM/Event/Form/Registration/Register.php).

      Steps to recreate:

      • Create a priceset
      • Create a price field, type 'Select'
      • When adding price options, notice that it is possible to change the 'Visibility' to '- select -'
      • Do that, and save
      • Add the price set to an event
      • View the event registration form as an anonymous user
      • Notice the error message

      Mitigation:

      • The form does default to 'public', so it's unlikely anyone would change this to '- select -'

      Steps to fix:

      • Remove the '- select -' option from the visibility drop down on price options.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              john John K.
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: