Fixed the clone method that gave the error Call to undefined method ComponentbuilderModelImport_joomla_components::updateAfter()

This commit is contained in:
2018-05-04 22:27:49 +02:00
parent cc35295cf6
commit 7cb78222ea
10 changed files with 53 additions and 25 deletions

View File

@ -57,6 +57,8 @@ $query->where($db->quoteName('a.published') . ' >= 1');
$query->order('a.langtag ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
// make sure the English GB is added
$wasAdded = false;
$options = array();
if ($items)
{
@ -64,8 +66,17 @@ if ($items)
foreach($items as $item)
{
$options[] = JHtml::_('select.option', trim($item->langtag), $item->language_name . ' (' .$item->langtag.')');
if ('en-GB' === trim($item->langtag))
{
$wasAdded = true;
}
}
}
// now add it if not already added
if (!$wasAdded)
{
$options[] = JHtml::_('select.option', 'en-GB', 'English GB (en-GB)');
}
return $options;
}
}