diff --git a/administrator/components/com_fields/helpers/fields.php b/administrator/components/com_fields/helpers/fields.php index afbc2cefafbd0..d37488a815b09 100644 --- a/administrator/components/com_fields/helpers/fields.php +++ b/administrator/components/com_fields/helpers/fields.php @@ -193,7 +193,7 @@ function ($f) $dispatcher = JEventDispatcher::getInstance(); - // Event allow plugins to modfify the output of the field before it is prepared + // Event allow plugins to modify the output of the field before it is prepared $dispatcher->trigger('onCustomFieldsBeforePrepareField', array($context, $item, &$field)); // Gathering the value for the field @@ -204,7 +204,7 @@ function ($f) $value = implode(' ', $value); } - // Event allow plugins to modfify the output of the prepared field + // Event allow plugins to modify the output of the prepared field $dispatcher->trigger('onCustomFieldsAfterPrepareField', array($context, $item, $field, &$value)); // Assign the value diff --git a/plugins/fields/list/list.php b/plugins/fields/list/list.php index 66a0dc7423ba2..028b7e3c13b97 100644 --- a/plugins/fields/list/list.php +++ b/plugins/fields/list/list.php @@ -18,4 +18,31 @@ */ class PlgFieldsList extends FieldsListPlugin { + /** + * Prepares the field + * + * @param string $context The context. + * @param stdclass $item The item. + * @param stdclass $field The field. + * + * @return object + * + * @since __DEPLOY_VERSION__ + */ + public function onCustomFieldsPrepareField($context, $item, $field) + { + // Check if the field should be processed + if (!$this->isTypeSupported($field->type)) + { + return; + } + + // The field's rawvalue should be an array + if (!is_array($field->rawvalue)) + { + $field->rawvalue = (array) $field->rawvalue; + } + + return parent::onCustomFieldsPrepareField($context, $item, $field); + } }