From 7cb2fb9b024a79ae3943bce4ae79002bb05e57a6 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Tue, 3 Dec 2013 09:58:29 +0000 Subject: [PATCH] Internal: new setting to tweak the data model by allowing null for all external keys (use with care!) SVN:trunk[3016] --- core/attributedef.class.inc.php | 12 ++++++++++-- core/config.class.inc.php | 10 +++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/core/attributedef.class.inc.php b/core/attributedef.class.inc.php index ff5cfa7eb..807e994c4 100644 --- a/core/attributedef.class.inc.php +++ b/core/attributedef.class.inc.php @@ -1,5 +1,5 @@ Get("is_null_allowed");} + public function IsNullAllowed() + { + if (MetaModel::GetConfig()->Get('disable_mandatory_ext_keys')) + { + return true; + } + return $this->Get("is_null_allowed"); + } + public function GetBasicFilterOperators() { diff --git a/core/config.class.inc.php b/core/config.class.inc.php index 73ded0703..679637724 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -1,5 +1,5 @@ '', 'show_in_conf_sample' => false, ), + 'disable_mandatory_ext_keys' => array( + 'type' => 'bool', + 'description' => 'For developpers: allow every external keys to be undefined', + 'default' => true, + 'value' => true, + 'source_of_value' => '', + 'show_in_conf_sample' => false, + ), 'graphviz_path' => array( 'type' => 'string', 'description' => 'Path to the Graphviz "dot" executable for graphing objects lifecycle',