updated the compiler to first check if array values is set

This commit is contained in:
2017-10-30 20:50:56 +02:00
parent ccb3f09a34
commit 306a9b9613
19 changed files with 551 additions and 709 deletions

View File

@ -888,8 +888,9 @@ class Get
}
// build update SQL
if ($old_component = $this->getHistoryWatch('joomla_component', $this->componentID) ||
$old_admin_views = $this->getHistoryWatch('component_admin_views', $component->addadmin_views_id))
$old_admin_views = $this->getHistoryWatch('component_admin_views', $component->addadmin_views_id);
$old_component = $this->getHistoryWatch('joomla_component', $this->componentID);
if ($old_component || $old_admin_views)
{
if (ComponentbuilderHelper::checkObject($old_admin_views))
{
@ -4385,10 +4386,10 @@ class Get
{
switch($commentType)
{
case 1:
case 1: // the PHP & JS type
$startReplace .= '/*'.$id.'*/';
break;
case 2:
case 2: // the HTML type
$startReplace .= '<!--'.$id.'-->';
break;
}

View File

@ -1805,7 +1805,7 @@ class Fields extends Structure
// build unique keys of this view for db
$this->dbUniqueKeys[$viewName][] = $name;
}
elseif (($field['settings']->indexes == 2 || $field['alias'] || $field['title'] || $typeName === 'category') && !in_array($field['settings']->datatype, $textKeys))
elseif (($field['settings']->indexes == 2 || (isset($field['alias']) && $field['alias']) || (isset($field['title']) && $field['title']) || $typeName === 'category') && !in_array($field['settings']->datatype, $textKeys))
{
// build keys of this view for db
$this->dbKeys[$viewName][] = $name;
@ -1817,12 +1817,12 @@ class Fields extends Structure
$this->historyBuilder[$viewName] = $viewName;
}
// set Alias (only one title per view)
if ($field['alias'])
if (isset($field['alias']) && $field['alias'])
{
$this->aliasBuilder[$viewName] = $name;
}
// set Titles (only one title per view)
if ($field['title'])
if (isset($field['title']) && $field['title'])
{
$this->titleBuilder[$viewName] = $name;
}
@ -1855,17 +1855,17 @@ class Fields extends Structure
}
}
// build the list values
if ($field['list'] == 1 && $typeName != 'repeatable' && $typeName != 'subform')
if ((isset($field['list']) && $field['list'] == 1) && $typeName != 'repeatable' && $typeName != 'subform')
{
// load to list builder
$this->listBuilder[$listViewName][] = array(
'type' => $typeName,
'code' => $name,
'lang' => $listLangName,
'title' => ($field['title']) ? true : false,
'alias' => ($field['alias']) ? true : false,
'link' => ($field['link']) ? true : false,
'sort' => ($field['sort']) ? true : false,
'title' => (isset($field['title']) && $field['title']) ? true : false,
'alias' => (isset($field['alias']) && $field['alias']) ? true : false,
'link' => (isset($field['link']) && $field['link']) ? true : false,
'sort' => (isset($field['sort']) && $field['sort']) ? true : false,
'custom' => $custom,
'multiple' => $multiple,
'options' => $options);
@ -2004,7 +2004,7 @@ class Fields extends Structure
}
// load the json list display fix
if ($field['list'] == 1 && $typeName != 'repeatable' && $typeName != 'subform')
if ((isset($field['list']) && $field['list'] == 1) && $typeName != 'repeatable' && $typeName != 'subform')
{
if (ComponentbuilderHelper::checkArray($options))
{
@ -2031,22 +2031,23 @@ class Fields extends Structure
// check if field should be added to uikit
$this->buildSiteFieldData($viewName, $name, 'uikit', $typeName);
// load the selection translation fix
if (ComponentbuilderHelper::checkArray($options) && $field['list'] == 1 && $typeName != 'repeatable' && $typeName != 'subform')
if (ComponentbuilderHelper::checkArray($options) && (isset($field['list']) && $field['list'] == 1) && $typeName != 'repeatable' && $typeName != 'subform')
{
$this->selectionTranslationFixBuilder[$listViewName][$name] = $options;
}
// build the sort values
if ($field['sort'] == 1 && $field['list'] == 1 && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform'))
if ((isset($field['sort']) && $field['sort'] == 1) && (isset($field['list']) && $field['list'] == 1) && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform'))
{
$this->sortBuilder[$listViewName][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'custom' => $custom, 'options' => $options);
}
// build the search values
if ($field['search'] == 1)
if (isset($field['search']) && $field['search'] == 1)
{
$this->searchBuilder[$listViewName][] = array('type' => $typeName, 'code' => $name, 'custom' => $custom, 'list' => $field['list']);
$_list = (!isset($field['list'])) ? $field['list'] : 0;
$this->searchBuilder[$listViewName][] = array('type' => $typeName, 'code' => $name, 'custom' => $custom, 'list' => $_list);
}
// build the filter values
if ($field['filter'] == 1 && $field['list'] == 1 && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform'))
if ((isset($field['filter']) && $field['filter'] == 1) && (isset($field['list']) && $field['list'] == 1) && (!$multiple && $typeName != 'checkbox' && $typeName != 'checkboxes' && $typeName != 'repeatable' && $typeName != 'subform'))
{
$this->filterBuilder[$listViewName][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'database' => $viewName, 'function' => ComponentbuilderHelper::safeString($name, 'F'), 'custom' => $custom, 'options' => $options);
}

View File

@ -11607,7 +11607,7 @@ class Interpretation extends Fields
$this->langContent[$this->lang][$langKey] = $langName;
$counter++;
}
if ($view['dashboard_list'] == 1)
if (isset($view['dashboard_list']) && $view['dashboard_list'] == 1)
{
$type = ComponentbuilderHelper::imageInfo($view['settings']->icon);
if ($type)
@ -14004,7 +14004,7 @@ function vdm_dkim() {
foreach ($menuControllers as $menuController)
{
// add menu controll view that has menus options
if ($view[$menuController])
if (isset($view[$menuController]) && $view[$menuController])
{
$targetView_ = 'views.';
if ($menuController === 'dashboard_add')

View File

@ -414,7 +414,7 @@ class Infusion extends Interpretation
$this->placeholders['[[[VIEWS]]]'] = $viewsName_u;
// set the export/import option
if ($view['port'])
if (isset($view['port']) && $view['port'])
{
$this->eximportView[$viewName_list] = true;
if (1 == $view['settings']->add_custom_import)
@ -430,7 +430,7 @@ class Infusion extends Interpretation
}
// set Autocheckin function
if ($view['checkin'] == 1)
if (isset($view['checkin']) && $view['checkin'] == 1)
{
// ###AUTOCHECKIN### <<<DYNAMIC>>>
$this->fileContentDynamic[$viewName_list]['###AUTOCHECKIN###']
@ -933,12 +933,12 @@ class Infusion extends Interpretation
$this->setLockLicensePer($view['settings']->code, $this->target);
// set the site default view
if ($view['default_view'] == 1)
if (isset($view['default_view']) && $view['default_view'] == 1)
{
$this->fileContentStatic['###SITE_DEFAULT_VIEW###'] = $view['settings']->code;
}
// add site menu
if ($view['menu'] == 1)
if (isset($view['menu']) && $view['menu'] == 1)
{
// ###SITE_MENU_XML### <<<DYNAMIC>>>
$this->fileContentDynamic[$view['settings']->code]['###SITE_MENU_XML###'] = $this->setCustomViewMenu($view);