Make label field on relationship type required again (accidentally removed
authoreileen <emcnaughton@wikimedia.org>
Wed, 23 May 2018 04:27:13 +0000 (16:27 +1200)
committereileen <emcnaughton@wikimedia.org>
Sun, 27 May 2018 21:50:47 +0000 (09:50 +1200)
CRM/Admin/Form/RelationshipType.php
CRM/Member/Form/MembershipStatus.php

index ed13ef49a3667a6aa5d8b426e84a0acf552ad911..387905615ceef991482bc44fe458ccaafd5d32ad 100644 (file)
@@ -49,6 +49,7 @@ class CRM_Admin_Form_RelationshipType extends CRM_Admin_Form {
    *    or is not a core field on the form's entity).
    *  - help (option) add help to the field - e.g ['id' => 'id-source', 'file' => 'CRM/Contact/Form/Contact']]
    *  - template - use a field specific template to render this field
+   *  - required
    * @var array
    */
   protected $entityFields = [];
@@ -60,7 +61,8 @@ class CRM_Admin_Form_RelationshipType extends CRM_Admin_Form {
     $this->entityFields = [
       'label_a_b' => [
         'name' => 'label_a_b',
-        'description' => ts("Label for the relationship from Contact A to Contact B. EXAMPLE: Contact A is 'Parent of' Contact B.")
+        'description' => ts("Label for the relationship from Contact A to Contact B. EXAMPLE: Contact A is 'Parent of' Contact B."),
+        'required' => TRUE,
       ],
       'label_b_a' => [
         'name' => 'label_b_a',
index 5a47ed7e973467681f2d41261b2ad0d386fdadff..10b468febd9c5530001950861151f9d24065bb32 100644 (file)
@@ -63,6 +63,7 @@ class CRM_Member_Form_MembershipStatus extends CRM_Core_Form {
    *    or is not a core field on the form's entity).
    *  - help (optional) add help to the field - e.g ['id' => 'id-source', 'file' => 'CRM/Contact/Form/Contact']]
    *  - template - use a field specific template to render this field
+   *  - required
    * @var array
    */
   protected $entityFields = [];
@@ -90,7 +91,7 @@ class CRM_Member_Form_MembershipStatus extends CRM_Core_Form {
    * We do this from the constructor in order to do a translation.
    */
   public function setDeleteMessage() {
-    $this->deleteMessage = ts('WARNING: Deleting this option will result in the loss of all membership records of this status.') . ' ' . ts('This may mean the loss of a substantial amount of data, and the action cannot be undone.') . ' ' . ts('Do you want to continue?');
+    $this->deleteMessage = ts('You will not be able to delete this membership status if there are existing memberships with this status. You will need to check all your membership status rules afterwards to ensure that a valid status will always be available.') . " "  . ts('Do you want to continue?');
   }
 
   public function preProcess() {