1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-12 09:34:54 +02:00

Fix for custom fields loading in edit mode.

This commit is contained in:
Cameron
2017-01-24 20:31:58 -08:00
parent 71d531be2d
commit 46cacf5e3f
2 changed files with 20 additions and 11 deletions

View File

@@ -311,10 +311,11 @@
$ui->addTab($tabKey, $this->_tab[$tabKey]);
foreach($this->_config as $key=>$fld)
foreach($this->_config as $k=>$fld)
{
$fld['tab'] = $tabKey;
$fld['data'] = false;
$key = $fld['key'];
if($fld['type'] === 'icon')
{
@@ -333,8 +334,6 @@
$fields[$fieldName.'__'.$key] = $fld;
//$model->fields[$fieldName.'__'.$key] = $fld;
}
$ui->setFieldAttr($fields);
@@ -352,21 +351,18 @@
*/
public function setAdminUIData($fieldname, e_admin_ui &$ui)
{
// $model->getModel()->set($fieldname, null);
// e107::getCustomFields()->setData($row['page_fields']);
$ui->getModel()->set($fieldname, null);
foreach($this->_data as $key=>$value)
{
$ui->getModel()->set($fieldname.'__'.$key, $value);
// e107::getDebug()->log($fieldname.'__'.$key.": ".$value);
}
return $this;
}
@@ -424,7 +420,7 @@
unset($new_data[$fieldname]); // Reset.
$len = strlen($fieldname);
foreach($new_data as $k=>$v)
{
if(substr($k,0,$len) === $fieldname)