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

Price-set validation break in noAmount and noLabel case for non Text type price field

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.1
    • Fix Version/s: 4.4.4
    • Component/s: None
    • Labels:

      Description

      Steps to replicate the issue are as follows:
      1) Create Price set
      2) Create Price field of any non Text type (e.g. select)
      3) Create exactly four priceset options with corresponding Label and Amount filled
      4) Then submit

      Strangely it throws validation error 'Label and value cannot be empty.' on first option as we know there is none such case. Also if we then keep any Label and Amount option null then it got submitted successfully.

      Bug : Occurring at line 567 CRM/Price/Form/Field.php

      if ($countemptyrows == 11)

      { $errors['option_label[1]'] = $errors['option_amount[1]'] = ts('Label and value cannot be empty.'); $_flagOption = 1; }

      As per now at maximum we can create maximum of 15 price field options so in above case 4 options are filled which left 11 field blank >> matches the condition >> triggers validation error. Any blank field number less or greater then 11 bypass the check and create the price field.

        Attachments

          Activity

            People

            • Assignee:
              monish.deb Monish Deb
              Reporter:
              monish.deb Monish Deb
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: