From 64a05eb14774b8cd935612812b0f22d1e4b174d0 Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 3 Jan 2021 14:02:22 +1300 Subject: [PATCH] Pledge: mark needed fields as required in schema This marks all the fields that are not optional as required. I've been having a bit of a battle adding a v4 api & I hope this will help - but if not, it's correct for them to be marked required anyway --- CRM/Pledge/DAO/Pledge.php | 6 +++++- xml/schema/Pledge/Pledge.xml | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CRM/Pledge/DAO/Pledge.php b/CRM/Pledge/DAO/Pledge.php index f1c70bf347f3..cd7952b522e7 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:186d3064229a2bd8a2de2483b4bb90c6) + * (GenCodeChecksum:6c3c68d4e00946adbfbc368e87d72a36) */ /** @@ -382,6 +382,7 @@ public static function &fields() { 'type' => CRM_Utils_Type::T_STRING, 'title' => ts('Pledge Frequency Unit'), 'description' => ts('Time units for recurrence of pledge payments.'), + 'required' => TRUE, 'maxlength' => 8, 'size' => CRM_Utils_Type::EIGHT, 'where' => 'civicrm_pledge.frequency_unit', @@ -439,6 +440,7 @@ public static function &fields() { 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Pledge Number of Installments'), 'description' => ts('Total number of payments to be made.'), + 'required' => TRUE, 'where' => 'civicrm_pledge.installments', 'export' => TRUE, 'default' => '1', @@ -604,6 +606,7 @@ public static function &fields() { 'type' => CRM_Utils_Type::T_INT, 'title' => ts('Pledge Status Id'), 'description' => ts('Implicit foreign key to civicrm_option_values in the pledge_status option group.'), + 'required' => TRUE, 'import' => TRUE, 'where' => 'civicrm_pledge.status_id', 'export' => FALSE, @@ -624,6 +627,7 @@ public static function &fields() { 'name' => 'is_test', 'type' => CRM_Utils_Type::T_BOOLEAN, 'title' => ts('Test'), + 'required' => TRUE, 'import' => TRUE, 'where' => 'civicrm_pledge.is_test', 'export' => TRUE, diff --git a/xml/schema/Pledge/Pledge.xml b/xml/schema/Pledge/Pledge.xml index fe58bcfeda87..6b967254f5a0 100644 --- a/xml/schema/Pledge/Pledge.xml +++ b/xml/schema/Pledge/Pledge.xml @@ -127,6 +127,7 @@ pledge_frequency_unit Pledge Frequency Unit varchar + true 8 'month' Time units for recurrence of pledge payments. @@ -169,6 +170,7 @@ int unsigned Pledge Number of Installments 1 + true Total number of payments to be made. 2.1 @@ -286,6 +288,7 @@ status_id Pledge Status Id pledge_status_id + true true false int unsigned @@ -310,6 +313,7 @@ Test boolean 0 + true CheckBox