diff --git a/system/Controllers/MetaApiController.php b/system/Controllers/MetaApiController.php index 428693d173197201c1d49ac3648925ad4125fe69..d785ae50f741d94d41890105f9843a590d74ccd4 100644 --- a/system/Controllers/MetaApiController.php +++ b/system/Controllers/MetaApiController.php @@ -127,6 +127,7 @@ class MetaApiController extends ContentController $metascheme[$tabname][$fieldname] = true; $metadata[$tabname][$fieldname] = isset($pagemeta[$tabname][$fieldname]) ? $pagemeta[$tabname][$fieldname] : null; + /* # special treatment for customfields if(isset($fielddefinitions['type']) && ($fielddefinitions['type'] == 'customfields' ) && $metadata[$tabname][$fieldname] ) { @@ -134,6 +135,7 @@ class MetaApiController extends ContentController $metadata[$tabname][$fieldname] = $this->customfieldsPrepareForEdit($metadata[$tabname][$fieldname]); } + */ } } @@ -221,6 +223,7 @@ class MetaApiController extends ContentController $errors[$tab][$fieldName] = $result[$fieldName][0]; } + /* # special treatment for customfields if($fieldDefinition && isset($fieldDefinition['type']) && ($fieldDefinition['type'] == 'customfields' ) ) { @@ -232,6 +235,7 @@ class MetaApiController extends ContentController $metaInput[$fieldName] = $this->customfieldsPrepareForSave($metaInput[$fieldName], $arrayFeatureOn); } + */ } } diff --git a/system/Models/Validation.php b/system/Models/Validation.php index e7d5289edecdd21b04ba5d4c6be1ba9eb759a26c..6b2c69d4d1a95295894ab7f4059444b6d677c4cb 100644 --- a/system/Models/Validation.php +++ b/system/Models/Validation.php @@ -63,16 +63,20 @@ class Validation return true; }, 'contains one or more invalid ip-adress.'); - Validator::addRule('customfields', function($field, $value, array $params, array $fields) use ($user) + Validator::addRule('customfields', function($field, $customfields, array $params, array $fields) use ($user) { - foreach($value as $customfield) + if(empty($customfields)) { - if(!isset($customfield['key']) OR empty($customfield['key']) OR (preg_match('/^([a-z0-9])+$/i', $customfield['key']) == false) ) + return true; + } + foreach($customfields as $key => $value) + { + if(!isset($key) OR empty($key) OR (preg_match('/^([a-z0-9])+$/i', $key) == false) ) { return false; } - if (!isset($customfield['value']) OR empty($customfield['value']) OR ( $customfield['value'] != strip_tags($customfield['value']) ) ) + if (!isset($value) OR empty($value) OR ( $value != strip_tags($value) ) ) { return false; } @@ -134,7 +138,7 @@ class Validation } # return valitron standard object - public function returnValitron(array $params) + public function returnValidator(array $params) { return new Validator($params); } diff --git a/system/author/js/vue-shared.js b/system/author/js/vue-shared.js index e86ce6ebe6287139dae2c5e8f842ff77fef1f2e0..87687855b0f2fc46b84273fc7513705e2570826b 100644 --- a/system/author/js/vue-shared.js +++ b/system/author/js/vue-shared.js @@ -368,6 +368,7 @@ Vue.component('component-customfields', { fielderrors: false, fielddetails: {}, disableaddbutton: false, + cfvalue: [{}] } }, template: '