diff --git a/CRM/Contribute/Form/ContributionPage.php b/CRM/Contribute/Form/ContributionPage.php
index c965e60d1ca..f1490ee44ce 100644
--- a/CRM/Contribute/Form/ContributionPage.php
+++ b/CRM/Contribute/Form/ContributionPage.php
@@ -87,6 +87,13 @@ public function getDefaultEntity() {
return 'Contribution';
}
+ /**
+ * Explicitly declare the form context.
+ */
+ public function getDefaultContext() {
+ return 'create';
+ }
+
/**
* Set variables up before form is built.
*/
diff --git a/CRM/Contribute/Form/ContributionPage/Amount.php b/CRM/Contribute/Form/ContributionPage/Amount.php
index 29fdd78efec..538569eb2cb 100644
--- a/CRM/Contribute/Form/ContributionPage/Amount.php
+++ b/CRM/Contribute/Form/ContributionPage/Amount.php
@@ -152,12 +152,13 @@ public function buildQuickForm() {
else {
$this->assign('price', TRUE);
}
- $this->add('select', 'price_set_id', ts('Price Set'),
- [
- '' => ts('- none -'),
- ] + $price,
- NULL, ['onchange' => "showHideAmountBlock( this.value, 'price_set_id' );"]
- );
+
+ $this->addField('price_set_id', [
+ 'entity' => 'PriceSet',
+ 'options' => $price,
+ 'onchange' => "showHideAmountBlock( this.value, 'price_set_id' );",
+ ]);
+
//CiviPledge fields.
$config = CRM_Core_Config::singleton();
if (in_array('CiviPledge', $config->enableComponents)) {
diff --git a/CRM/Event/Form/ManageEvent/Fee.php b/CRM/Event/Form/ManageEvent/Fee.php
index 46420b809a3..16572e178d7 100644
--- a/CRM/Event/Form/ManageEvent/Fee.php
+++ b/CRM/Event/Form/ManageEvent/Fee.php
@@ -290,12 +290,12 @@ public function buildQuickForm() {
else {
$this->assign('price', TRUE);
}
- $this->add('select', 'price_set_id', ts('Price Set'),
- [
- '' => ts('- none -'),
- ] + $price,
- NULL, ['onchange' => "return showHideByValue('price_set_id', '', 'map-field', 'block', 'select', false);"]
- );
+ $this->addField('price_set_id', [
+ 'entity' => 'PriceSet',
+ 'options' => $price,
+ 'onchange' => "return showHideByValue('price_set_id', '', 'map-field', 'block', 'select', false);",
+ ]);
+
$default = [$this->createElement('radio', NULL, NULL, NULL, 0)];
$this->add('hidden', 'price_field_id', '', ['id' => 'price_field_id']);
for ($i = 1; $i <= self::NUM_OPTION; $i++) {
diff --git a/CRM/Member/Form/MembershipBlock.php b/CRM/Member/Form/MembershipBlock.php
index 83df3d77a15..04eb474ebb9 100644
--- a/CRM/Member/Form/MembershipBlock.php
+++ b/CRM/Member/Form/MembershipBlock.php
@@ -189,7 +189,13 @@ public function buildQuickForm() {
else {
$this->assign('price', TRUE);
}
- $this->add('select', 'member_price_set_id', ts('Membership Price Set'), (['' => ts('- none -')] + $price));
+ //$this->add('select', 'member_price_set_id', ts('Membership Price Set'), (['' => ts('- none -')] + $price));
+
+ $this->addField('member_price_set_id', [
+ 'entity' => 'PriceSet',
+ 'name' => 'price_set_id',
+ 'options' => $price,
+ ]);
$session = CRM_Core_Session::singleton();
$single = $session->get('singleForm');
diff --git a/CRM/Price/DAO/PriceSet.php b/CRM/Price/DAO/PriceSet.php
index f6eeeb91db8..a4b704dd7a1 100644
--- a/CRM/Price/DAO/PriceSet.php
+++ b/CRM/Price/DAO/PriceSet.php
@@ -6,7 +6,7 @@
*
* Generated from xml/schema/CRM/Price/PriceSet.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen
- * (GenCodeChecksum:b8036fb0c2f5ad76f8f3bdf93f9db0f0)
+ * (GenCodeChecksum:2465848603f66c170842a63e347ab3e7)
*/
/**
@@ -154,7 +154,7 @@ public static function &fields() {
'id' => [
'name' => 'id',
'type' => CRM_Utils_Type::T_INT,
- 'title' => ts('Price Set ID'),
+ 'title' => ts('Price Set'),
'description' => ts('Price Set'),
'required' => TRUE,
'where' => 'civicrm_price_set.id',
@@ -162,6 +162,9 @@ public static function &fields() {
'entity' => 'PriceSet',
'bao' => 'CRM_Price_BAO_PriceSet',
'localizable' => 0,
+ 'html' => [
+ 'type' => 'Select',
+ ],
],
'domain_id' => [
'name' => 'domain_id',
diff --git a/xml/schema/Price/PriceSet.xml b/xml/schema/Price/PriceSet.xml
index 27b8852eb93..25266f1dbfc 100644
--- a/xml/schema/Price/PriceSet.xml
+++ b/xml/schema/Price/PriceSet.xml
@@ -8,11 +8,14 @@
true
id
- Price Set ID
+ Price Set
int unsigned
true
Price Set
1.8
+
+ Select
+
id