Fixed error that caused set placeholders method to break in the compiler

This commit is contained in:
Llewellyn van der Merwe 2018-03-18 23:07:18 +02:00
parent de2d957141
commit ce200d2b7c
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
2 changed files with 9 additions and 2 deletions

View File

@ -5427,6 +5427,13 @@ class Get
*/
public function setPlaceholders(&$data, &$placeholder, $action = 1)
{
// make sure the placeholders is an array
if (!ComponentbuilderHelper::checkArray($placeholder))
{
// This is an error, (TODO) actualy we need to add a kind of log here to know that this happened
return $data;
}
// continue with the work of replacement
if (1 == $action) // <-- just replace (default)
{
return str_replace(array_keys($placeholder), array_values($placeholder), $data);

View File

@ -1387,7 +1387,7 @@ class Fields extends Structure
// add the tabs needed
$r_taber = "\t\t\t";
// get field values
$r_fieldValues = $this->setFieldAttributes($fieldData, $view, $r_name, $r_typeName, $r_multiple, $r_langLabel, $langView, $spacerCounter, $view_name_list, $view_name_single, $placeholders, true);
$r_fieldValues = $this->setFieldAttributes($fieldData, $view, $r_name, $r_typeName, $r_multiple, $r_langLabel, $langView, $view_name_list, $view_name_single, $placeholders, true);
// check if values were set
if (ComponentbuilderHelper::checkArray($r_fieldValues))
{
@ -1474,7 +1474,7 @@ class Fields extends Structure
// add the tabs needed
$r_taber = "\t\t";
// get field values
$r_fieldValues = $this->setFieldAttributes($fieldData, $view, $r_name, $r_typeName, $r_multiple, $r_langLabel, $langView, $spacerCounter, $view_name_list, $view_name_single, $placeholders, true);
$r_fieldValues = $this->setFieldAttributes($fieldData, $view, $r_name, $r_typeName, $r_multiple, $r_langLabel, $langView, $view_name_list, $view_name_single, $placeholders, true);
// check if values were set
if (ComponentbuilderHelper::checkArray($r_fieldValues))
{