Urgent fix to the fields area to address the extra field options, and fields with 0 being removed. Added the option to add a field and not add it to the database, so it will show in the edit view but will not be stored to the database. This is to use javascript/php to use that field value, and then drop it.

This commit is contained in:
2018-04-13 17:24:06 +02:00
parent 51d13b75f0
commit 694612aff9
31 changed files with 515 additions and 300 deletions

View File

@ -49,23 +49,6 @@ class JFormFieldLang extends JFormFieldList
*/
public function getOptions()
{
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('a.langtag','a.name'),array('langtag','language_name')));
$query->from($db->quoteName('#__componentbuilder_language', 'a'));
$query->where($db->quoteName('a.published') . ' >= 1');
$query->order('a.langtag ASC');
$db->setQuery((string)$query);
$items = $db->loadObjectList();
$options = array();
if ($items)
{
$options[] = JHtml::_('select.option', '', 'Select an option');
foreach($items as $item)
{
$options[] = JHtml::_('select.option', $item->langtag, $item->language_name . ' (' .$item->langtag.')');
}
}
return $options;
return null;
}
}