forked from extern/egroupware
Set value to a new location using a prefix to avoid changing the original, should fix contact-templates
This commit is contained in:
parent
bd6af0b94b
commit
afcad4b50f
@ -73,13 +73,25 @@ abstract class etemplate_widget_entry extends etemplate_widget_transformer
|
|||||||
|
|
||||||
// Find out which record to load
|
// Find out which record to load
|
||||||
$value = self::get_array(self::$request->content, $form_name, false, true);
|
$value = self::get_array(self::$request->content, $form_name, false, true);
|
||||||
|
if(!$value)
|
||||||
// Get the record itself
|
|
||||||
$data =& self::get_array(self::$request->content, $data_id, true, false);
|
|
||||||
if(!$data)
|
|
||||||
{
|
{
|
||||||
$data =& static::get_entry($value, $attrs);
|
// Try here... legacy / fallback / just make it work
|
||||||
|
$value = self::get_array(self::$request->content, $data_id, true, false);
|
||||||
|
$data = static::get_entry($value, $attrs);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Get the record itself
|
||||||
|
$data = self::get_array(self::$request->content, $data_id, true, false);
|
||||||
|
if(!$data)
|
||||||
|
{
|
||||||
|
$data = static::get_entry($value, $attrs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the new value so transformer can find it. Use prefix to avoid changing the original value
|
||||||
|
$new_value =& self::get_array(self::$request->content, self::ID_PREFIX .$this->id, true, false);
|
||||||
|
$new_value = $data;
|
||||||
$this->id = self::ID_PREFIX . $this->id . "[{$attrs['field']}]";
|
$this->id = self::ID_PREFIX . $this->id . "[{$attrs['field']}]";
|
||||||
|
|
||||||
$old_type = self::getElementAttribute($this->id, 'type');
|
$old_type = self::getElementAttribute($this->id, 'type');
|
||||||
|
Loading…
Reference in New Issue
Block a user