* Admin - Fix deleting custom field from list's context menu changed the modified date on all fields

This commit is contained in:
nathangray 2019-06-24 11:35:30 -06:00
parent 4058d0f659
commit 065fa2f78d

View File

@ -170,11 +170,7 @@ class admin_customfields
unset($content['content_types']['create']); unset($content['content_types']['create']);
unset($content['content_types']['name']); unset($content['content_types']['name']);
} }
// No common type change and type didn't change, try an update // No common type change and type didn't change, do nothing
elseif($this->content_type && is_array($content) && $this->content_type == $content['old_content_type'])
{
$this->update($content);
}
} }
// Custom field deleted from nextmatch // Custom field deleted from nextmatch
@ -192,10 +188,10 @@ class admin_customfields
); );
$cmd->run(); $cmd->run();
unset($this->fields[$name]); unset($this->fields[$name]);
Framework::refresh_opener('Deleted', 'admin', $data['id'] /* Conflicts with Api\Accounts 'delete'*/);
} }
} }
// save changes to repository
$this->save_repository();
} }
$content['nm']= Api\Cache::getSession('admin', 'customfield-index'); $content['nm']= Api\Cache::getSession('admin', 'customfield-index');
@ -650,8 +646,6 @@ class admin_customfields
$config->read_repository(); $config->read_repository();
$config->value('types',$this->content_types); $config->value('types',$this->content_types);
$config->save_repository(); $config->save_repository();
Api\Storage\Customfields::save($this->appname, $this->fields);
} }
/** /**