From efcda6b9c2d7a9b0e21424d6dbe61203e98efe83 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Wed, 15 Jul 2020 07:13:52 +1000 Subject: [PATCH] dev/core#1874 Fix fatal error by passing through the string formatType rather than the date format when adding datepicker fields from metadata --- CRM/Batch/DAO/Batch.php | 3 ++- CRM/Campaign/DAO/Campaign.php | 5 ++++- CRM/Core/Form.php | 2 +- CRM/Mailing/DAO/MailingAB.php | 3 ++- CRM/Member/DAO/Membership.php | 3 ++- CRM/Pledge/DAO/Pledge.php | 7 ++++++- CRM/Queue/DAO/QueueItem.php | 4 +++- xml/schema/Batch/Batch.xml | 1 + xml/schema/Campaign/Campaign.xml | 3 +++ xml/schema/Mailing/MailingAB.xml | 1 + xml/schema/Member/Membership.xml | 1 + xml/schema/Pledge/Pledge.xml | 5 +++++ xml/schema/Queue/QueueItem.xml | 2 ++ 13 files changed, 33 insertions(+), 7 deletions(-) diff --git a/CRM/Batch/DAO/Batch.php b/CRM/Batch/DAO/Batch.php index 7ccdf4bae4..995e7cd961 100644 --- a/CRM/Batch/DAO/Batch.php +++ b/CRM/Batch/DAO/Batch.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Batch/Batch.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:1fc78ed79da3731e7c082cf678ae6753) + * (GenCodeChecksum:062be2c63f724430f3a380c015fd6a02) */ /** @@ -274,6 +274,7 @@ class CRM_Batch_DAO_Batch extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDateTime', ], 'add' => '3.3', ], diff --git a/CRM/Campaign/DAO/Campaign.php b/CRM/Campaign/DAO/Campaign.php index 6f875f7991..44b832de21 100644 --- a/CRM/Campaign/DAO/Campaign.php +++ b/CRM/Campaign/DAO/Campaign.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Campaign/Campaign.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:cad676be961a58037e4c460be6f9a450) + * (GenCodeChecksum:6b53e3fb452807fce31fc81bb2b09b38) */ /** @@ -280,6 +280,7 @@ class CRM_Campaign_DAO_Campaign extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDateTime', ], 'add' => '3.3', ], @@ -298,6 +299,7 @@ class CRM_Campaign_DAO_Campaign extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDateTime', ], 'add' => '3.3', ], @@ -426,6 +428,7 @@ class CRM_Campaign_DAO_Campaign extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDateTime', ], 'add' => '3.3', ], diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php index 1f0e6691a5..a3ef1cc1a2 100644 --- a/CRM/Core/Form.php +++ b/CRM/Core/Form.php @@ -1666,7 +1666,7 @@ class CRM_Core_Form extends HTML_QuickForm_Page { } else { $fieldSpec = CRM_Utils_Date::addDateMetadataToField($fieldSpec, $fieldSpec); - $attributes = ['format' => $fieldSpec['date_format']]; + $attributes = ['format' => $fieldSpec['html']['formatType']]; return $this->add('datepicker', $name, $label, $attributes, $required, $fieldSpec['datepicker']['extra']); } diff --git a/CRM/Mailing/DAO/MailingAB.php b/CRM/Mailing/DAO/MailingAB.php index ef5d50908c..4875b11c50 100644 --- a/CRM/Mailing/DAO/MailingAB.php +++ b/CRM/Mailing/DAO/MailingAB.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Mailing/MailingAB.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:81b75b4631b20b4bf2b7ab0bf1a0f286) + * (GenCodeChecksum:fd7f00955d0a5eb4ec56089ccd71f68d) */ /** @@ -344,6 +344,7 @@ class CRM_Mailing_DAO_MailingAB extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'mailing', ], 'add' => '4.6', ], diff --git a/CRM/Member/DAO/Membership.php b/CRM/Member/DAO/Membership.php index 712b6b2cb4..289f9ba231 100644 --- a/CRM/Member/DAO/Membership.php +++ b/CRM/Member/DAO/Membership.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Member/Membership.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:5767971ac9cef7be4adcdbb306b72a74) + * (GenCodeChecksum:9a307c1a63b4df70ae38f36ce4171cb6) */ /** @@ -384,6 +384,7 @@ class CRM_Member_DAO_Membership extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDate', ], 'add' => '4.7', ], diff --git a/CRM/Pledge/DAO/Pledge.php b/CRM/Pledge/DAO/Pledge.php index 56683051e8..a7a0fb7080 100644 --- a/CRM/Pledge/DAO/Pledge.php +++ b/CRM/Pledge/DAO/Pledge.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Pledge/Pledge.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:0df66b3d12c2b147e5f8b5b03f2148a8) + * (GenCodeChecksum:8373762a2a35ef14b0d763eb27db0f34) */ /** @@ -460,6 +460,7 @@ class CRM_Pledge_DAO_Pledge extends CRM_Core_DAO { 'unique_title' => ts('Payments Start Date'), 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDate', ], 'add' => '2.1', ], @@ -478,6 +479,7 @@ class CRM_Pledge_DAO_Pledge extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDate', ], 'add' => '2.1', ], @@ -493,6 +495,7 @@ class CRM_Pledge_DAO_Pledge extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDate', ], 'add' => '2.1', ], @@ -520,6 +523,7 @@ class CRM_Pledge_DAO_Pledge extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDate', ], 'add' => '2.1', ], @@ -537,6 +541,7 @@ class CRM_Pledge_DAO_Pledge extends CRM_Core_DAO { 'unique_title' => ts('Payments Ended Date'), 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDate', ], 'add' => '2.1', ], diff --git a/CRM/Queue/DAO/QueueItem.php b/CRM/Queue/DAO/QueueItem.php index 0d42995555..64ea7e8950 100644 --- a/CRM/Queue/DAO/QueueItem.php +++ b/CRM/Queue/DAO/QueueItem.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Queue/QueueItem.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:137a0dea273fd4cad666fc1091fc8c84) + * (GenCodeChecksum:f71816c891a0730a45d4363883a5756c) */ /** @@ -147,6 +147,7 @@ class CRM_Queue_DAO_QueueItem extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDateTime', ], 'add' => NULL, ], @@ -162,6 +163,7 @@ class CRM_Queue_DAO_QueueItem extends CRM_Core_DAO { 'localizable' => 0, 'html' => [ 'type' => 'Select Date', + 'formatType' => 'activityDateTime', ], 'add' => NULL, ], diff --git a/xml/schema/Batch/Batch.xml b/xml/schema/Batch/Batch.xml index 24fdbf4f61..3bcbc44409 100644 --- a/xml/schema/Batch/Batch.xml +++ b/xml/schema/Batch/Batch.xml @@ -91,6 +91,7 @@ 3.3 Select Date + activityDateTime diff --git a/xml/schema/Campaign/Campaign.xml b/xml/schema/Campaign/Campaign.xml index 0f4648d3cb..c87c03730d 100644 --- a/xml/schema/Campaign/Campaign.xml +++ b/xml/schema/Campaign/Campaign.xml @@ -69,6 +69,7 @@ true Select Date + activityDateTime 3.3 @@ -82,6 +83,7 @@ true Select Date + activityDateTime 3.3 @@ -204,6 +206,7 @@ 3.3 Select Date + activityDateTime diff --git a/xml/schema/Mailing/MailingAB.xml b/xml/schema/Mailing/MailingAB.xml index 14d224f98c..61716bef1e 100644 --- a/xml/schema/Mailing/MailingAB.xml +++ b/xml/schema/Mailing/MailingAB.xml @@ -129,6 +129,7 @@ 4.6 Select Date + mailing diff --git a/xml/schema/Member/Membership.xml b/xml/schema/Member/Membership.xml index f4e769f4b0..e0f35ffb3a 100644 --- a/xml/schema/Member/Membership.xml +++ b/xml/schema/Member/Membership.xml @@ -181,6 +181,7 @@ 4.7 Select Date + activityDate diff --git a/xml/schema/Pledge/Pledge.xml b/xml/schema/Pledge/Pledge.xml index b8e7e2006b..39943c58ef 100644 --- a/xml/schema/Pledge/Pledge.xml +++ b/xml/schema/Pledge/Pledge.xml @@ -202,6 +202,7 @@ 2.1 Select Date + activityDate pledge_start_date Payments Start Date @@ -218,6 +219,7 @@ 2.1 Select Date + activityDate @@ -228,6 +230,7 @@ 2.1 Select Date + activityDate @@ -245,6 +248,7 @@ 2.1 Select Date + activityDate @@ -256,6 +260,7 @@ 2.1 Select Date + activityDate pledge_end_date Payments Ended Date diff --git a/xml/schema/Queue/QueueItem.xml b/xml/schema/Queue/QueueItem.xml index e67bca990a..f5e68e3989 100644 --- a/xml/schema/Queue/QueueItem.xml +++ b/xml/schema/Queue/QueueItem.xml @@ -48,6 +48,7 @@ true Select Date + activityDateTime @@ -57,6 +58,7 @@ date on which this job becomes available; null if ASAP Select Date + activityDateTime -- 2.25.1