Skip to content

Core Settings

Adding a new Setting to CiviCRM Core.

  1. Add metadata to the appropriate .setting.php file about the new setting
  2. Add it to the appropriate setting page per below
    'settings_pages' => ['event' => ['weight' => 10]]
    
  3. Your setting will not be active until you run flush all caches (e.g cv flush or drush cvapi System.flush)

Warning

Do not use the "URL Preferences" group to store any setting that is not a url string.

Legacy method Adding Setting Config to Admin Forms.

/**  
 * This class generates form components for Miscellaneous  
 *  
 */ 
class CRM_Admin_Form_Setting_Miscellaneous extends CRM_Admin_Form_Setting {
  protected $_settings = array(
   'max_attachments' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,  
   'contact_undelete' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,  
   'versionAlert' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,   
   'versionCheck' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,  
   'empoweredBy' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 
   'maxFileSize' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
   'doNotAttachPDFReceipt' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
   'secondDegRelPermissions' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
   'checksumTimeout' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
  );
}