Fixed saving edit_by in some Controllers
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user