Added GUID to selected views, and started updating JCB accordingly.

This commit is contained in:
2020-01-03 03:41:55 +02:00
parent a317ba855f
commit 46e52db097
122 changed files with 7142 additions and 6262 deletions

View File

@ -450,14 +450,14 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
{
// set load data option
$options['load_data'] = $loadData;
// // check if xpath was set in options
// check if xpath was set in options
$xpath = false;
if (isset($options['xpath']))
{
$xpath = $options['xpath'];
unset($options['xpath']);
}
// // check if clear form was set in options
// check if clear form was set in options
$clear = false;
if (isset($options['clear']))
{
@ -541,6 +541,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$form->setValue($redirectedField, null, $redirectedValue);
}
}
// Only load the GUID if new item
if (0 == $id)
{
$form->setValue('guid', null, ComponentbuilderHelper::GUID());
}
return $form;
}
@ -1186,6 +1193,14 @@ class ComponentbuilderModelFieldtype extends JModelAdmin
$data['metadata'] = (string) $metadata;
}
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid']))
{
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}
// Set the properties items to data.
if (isset($data['properties']) && is_array($data['properties']))
{