Skip to content

Commit

Permalink
Defined $input as field was undefined later on then slimmed down ->in…
Browse files Browse the repository at this point in the history
…put usage to $input->
  • Loading branch information
Tony Partridge - xtech86 committed Dec 2, 2016
1 parent 535acc6 commit a89cd09
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions administrator/components/com_fields/helpers/fields.php
Expand Up @@ -72,7 +72,7 @@ public static function getFields($context, $item = null, $prepareValue = false,
JModelLegacy::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_fields/models', 'FieldsModel');

self::$fieldsCache = JModelLegacy::getInstance('Fields', 'FieldsModel', array(
'ignore_request' => true)
'ignore_request' => true)
);

self::$fieldsCache->setState('filter.published', 1);
Expand Down Expand Up @@ -106,7 +106,7 @@ public static function getFields($context, $item = null, $prepareValue = false,
if (self::$fieldCache === null)
{
self::$fieldCache = JModelLegacy::getInstance('Field', 'FieldsModel', array(
'ignore_request' => true)
'ignore_request' => true)
);
}

Expand Down Expand Up @@ -240,6 +240,9 @@ public static function prepareForm($context, JForm $form, $data)
// Extracting the component and section
$parts = self::extract($context);

$input = JFactory::getApplication()->input;


if (! $parts)
{
return true;
Expand Down Expand Up @@ -303,7 +306,7 @@ public static function prepareForm($context, JForm $form, $data)
*/
$form->setFieldAttribute('catid', 'onchange', "categoryHasChanged(this);");
JFactory::getDocument()->addScriptDeclaration(
"function categoryHasChanged(element){
"function categoryHasChanged(element){
var cat = jQuery(element);
if (cat.val() == '" . $assignedCatids . "')return;
jQuery('input[name=task]').val('field.storeform');
Expand Down Expand Up @@ -333,7 +336,7 @@ public static function prepareForm($context, JForm $form, $data)

// Organizing the fields according to their category
$fieldsPerCategory = array(
0 => array()
0 => array()
);

foreach ($fields as $field)
Expand Down Expand Up @@ -458,7 +461,7 @@ public static function prepareForm($context, JForm $form, $data)
'ignore_request' => true)
);

if ((!isset($data->id) || !$data->id) && JFactory::getApplication()->input->getCmd('controller') == 'config.display.modules'
if ((!isset($data->id) || !$data->id) && $input->getCmd('controller') == 'config.display.modules'
&& JFactory::getApplication()->isSite())
{
// Modules on front end editing don't have data and an id set
Expand Down Expand Up @@ -566,10 +569,10 @@ public static function getFieldsPluginId()
{
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('extension_id'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('folder') . ' = ' . $db->quote('system'))
->where($db->quoteName('element') . ' = ' . $db->quote('fields'));
->select($db->quoteName('extension_id'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('folder') . ' = ' . $db->quote('system'))
->where($db->quoteName('element') . ' = ' . $db->quote('fields'));
$db->setQuery($query);

try
Expand Down

0 comments on commit a89cd09

Please sign in to comment.