field__fieldname delegation exclude fields.ini setting ?!
Posted: Tue May 17, 2011 4:22 pm
Hello,
I discovered the hard way that if you implement a field_fieldname delegation function, aka a calculated field, multi-level properties ( those with : such as column:name ) are ignored / disabled.
This is probably due a collision between:
and
property data from the fields.ini does not get splitted in the _atts array
Is there any elegant workaround this problem?
best,
(d)oekia
I discovered the hard way that if you implement a field_fieldname delegation function, aka a calculated field, multi-level properties ( those with : such as column:name ) are ignored / disabled.
This is probably due a collision between:
- Code: Select all
Table::getField()
...
if ( $delegate !== null and method_exists($delegate, "field__$fieldname")){
if ( isset($this->_atts[$fieldname]) ){
$schema = array_merge_recursive_unique($this->_newSchema('calculated',$fieldname), $this->_atts[$fieldname]);
} else {
$schema = $this->_newSchema('calculated', $fieldname);
}
return $schema;
}
...
and
- Code: Select all
Table::getProperty()
...
$path = explode(':', $propertyName);
$arr =& $field;
while ( count($path)> 0 ){
$temp =& $arr[array_shift($path)];
unset($arr);
$arr =& $temp;
unset($temp);
}
return $arr;
property data from the fields.ini does not get splitted in the _atts array
Is there any elegant workaround this problem?
best,
(d)oekia