Fixed saving edit_by in some Controllers

This commit is contained in:
Frank Schubert
2025-01-24 15:04:24 +01:00
parent 22bd84663a
commit 39cf386638
53 changed files with 556 additions and 61 deletions

View File

@@ -41,9 +41,18 @@ class Address extends mfBaseModel {
$this->getCoords();
$this->in_after_save--;
}
protected function beforeUpdate($data) {
if(!array_key_exists("edit_by", $data)) {
$me = new User();
$me->loadMe();
$data["edit_by"] = $me->id;
}
return $data;
}
public function getCoords() {
$update_needed = false;
if($this->id) {

View File

@@ -355,11 +355,7 @@ class AddressController extends mfBaseController {
$data['allow_contact'] = ($r->allow_contact) ? 1 : 0;
$data['allow_spin'] = ($r->allow_spin) ? 1 : 0;
$data['edit_by'] = 1;
if($mode == "add") {
$data['create_by'] = 1;
$address = AddressModel::create($data);
} else {
$address->update($data);