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

@ -149,14 +149,14 @@ class ComponentbuilderModelSnippet 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']))
{
@ -240,6 +240,13 @@ class ComponentbuilderModelSnippet 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;
}
@ -840,7 +847,14 @@ class ComponentbuilderModelSnippet extends JModelAdmin
$data['contributor_name'] = $contributor['contributor_name'];
$data['contributor_email'] = $contributor['contributor_email'];
$data['contributor_website'] = $contributor['contributor_website'];
}
}
// Set the GUID if empty or not valid
if (isset($data['guid']) && !ComponentbuilderHelper::validGUID($data['guid']))
{
$data['guid'] = (string) ComponentbuilderHelper::GUID();
}
// Set the snippet string to base64 string.
if (isset($data['snippet']))