Hi everyone,
I find out a little issue using the custom columns feature in backend.
The field "modified_by" is not displayed even if has values.
After a lot of debug I discovered this field is correclty displayed on frontend but not in backend.
I solved doing an override of the items view of the administrator.
The file involved is :
/administrator/components/com_flexicontent/views/items/tmpl/default.php
You can override it putting the file here [in case you're using ISIS template]:
/administrator/templates/isis/html/com_flexicontent/items/default.php
here's the originale code:
Code:
<?php foreach($this->extra_fields as $_field) :?>
<td>
<?php
// Clear display HTML just in case
$field = clone($_field); // quickly make a shallow copy of the fields object to avoid assignments of various member variables being persistent
// Field value for current item
$field_value = isset($row->fieldvalues[$field->id]) ? $row->fieldvalues[$field->id] : false;
// Create field's display HTML, via calling FlexicontentFields::renderField() for the given method name
FlexicontentFields::renderField($row, $field, $field_value, $method=$field->methodname);
// Output the field's display HTML
echo @$field->{$field->methodname};
?>
</td>
<?php endforeach; ?>
Here's my patch [maybe usefull until the bug is officially solved].
I don't know if there's redundancies with similar function already used, anyway the main problem is both $item->muname AND $item->modifier are NULL in backend.
After a while a discover the function supposed to do this [getItemFields]
Code:
<?php foreach($this->extra_fields as $_field) :?>
<td>
<?php
// Clear display HTML just in case
$field = clone($_field); // quickly make a shallow copy of the fields object to avoid assignments of various member variables being persistent
// Field value for current item
$field_value = isset($row->fieldvalues[$field->id]) ? $row->fieldvalues[$field->id] : false;
/*SG MOD*/
$user = JFactory::getUser();
$aid = JAccess::getAuthorisedViewLevels($user->id);
$cicci = array($row);
$_vars = null;
FlexicontentFields::getItemFields($cicci, $_vars, $_view=FLEXI_ITEMVIEW, $aid);
/*end SG MOD*/
// Create field's display HTML, via calling FlexicontentFields::renderField() for the given method name
FlexicontentFields::renderField($row, $field, $field_value, $method=$field->methodname);
// Output the field's display HTML
echo @$field->{$field->methodname};
?>
</td>
<?php endforeach; ?>
SG