mirror of
https://github.com/e107inc/e107.git
synced 2025-08-12 09:34:54 +02:00
Issue #5382 History/Revert changes.
This commit is contained in:
@@ -4587,15 +4587,19 @@ class e_admin_controller_ui extends e_admin_controller
|
||||
* @param int $id The ID of the specific record being backed up.
|
||||
* @param string $action The action performed on the record (e.g., 'update' or 'delete').
|
||||
* @param array $data An associative array of field data to be included in the history record.
|
||||
* @param bool $posted Whether the data has been posted and requires additional filter based on current $fields values or not.
|
||||
* @return bool True on successful creation of the backup record, false on failure.
|
||||
*/
|
||||
protected function backupToHistory($table, $pid, $id, $action, $data)
|
||||
protected function backupToHistory($table, $pid, $id, $action, $data, $posted = true)
|
||||
{
|
||||
foreach($data as $field=>$var)
|
||||
if($posted)
|
||||
{
|
||||
if(empty($this->fields[$field]['data'])) // exclude data not in the table.
|
||||
foreach($data as $field=>$var)
|
||||
{
|
||||
unset($data[$field]);
|
||||
if(empty($this->fields[$field]['data'])) // exclude data not in the table.
|
||||
{
|
||||
unset($data[$field]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user