Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.1.1
-
Fix Version/s: 3.1.2
-
Component/s: CiviContribute, CiviEvent
-
Labels:None
Description
When attempting to delete a price set option for a price set that is "in use" - we give the user a status message AND the code is supposed to display a list of the 'used by' Events and / or Contrib pages.
However, a regression bug was introduced in r24981 and the user only sees this message - but NO table of Events / Contribution pages:
"Unable to delete the 'Senior 2' Price Field Option - it is currently in use by one or more active events or contribution pages or contributions. If you no longer want to use this Price Field Option, click the event title below, and modify the fees for that event."
I think the problem is that the parent tpl - templates/CRM/Price/Page/Option.tpl defines $context, but table.tbl is looping on $contexts which doesn't seem to be defined. It looks like this rev was never tested since I don't think it can work as coded. An array var would need to be defined to handle possibility of both Events and Contribution pages using the price set.
Also, part of the status message is repeated between Option.tpl and table.tpl. Lines 41 and 46 in Option.tpl should probably be removed, since that text is provided in table.tpl.
SAME bug is also present when trying to delete Price Set FIELD for a price set that is 'usedBy' Event or Contribution page.