Rmove fields for none private cutomfields when name refers to a single custom field

This commit is contained in:
Hadi Nategh 2017-10-06 16:27:37 +02:00
parent 8eca71d461
commit 8dff1a154e

View File

@ -169,6 +169,14 @@ class Customfields extends Transformer
{
unset($fields[$key]);
}
// Rmove fields for none private cutomfields when name refers to a single custom field
$matches = null;
if (($pos=strpos($form_name,self::$prefix)) !== false &&
preg_match($preg = '/'.self::$prefix.'([^\]]+)/',$form_name,$matches) && !isset($fields[$name=$matches[1]]))
{
unset($fields[$key]);
}
}
// check if name refers to a single custom field --> show only that
$matches = null;