Apply changes to user-contact table first in Contact::update
- The truncateFieldsForTable call in the same method was potentially restricting the fields that could be updated in the user-contact table
This commit is contained in:
parent
dcfb8bb73e
commit
5519b50900
|
@ -243,15 +243,13 @@ class Contact
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
* @todo Let's get rid of boolean type of $old_fields
|
* @todo Let's get rid of boolean type of $old_fields
|
||||||
*/
|
*/
|
||||||
public static function update(array $fields, array $condition, $old_fields = [])
|
public static function update(array $fields, array $condition, $old_fields = []): bool
|
||||||
{
|
{
|
||||||
$fields = DI::dbaDefinition()->truncateFieldsForTable('contact', $fields);
|
|
||||||
$ret = DBA::update('contact', $fields, $condition, $old_fields);
|
|
||||||
|
|
||||||
// Apply changes to the "user-contact" table on dedicated fields
|
// Apply changes to the "user-contact" table on dedicated fields
|
||||||
Contact\User::updateByContactUpdate($fields, $condition);
|
Contact\User::updateByContactUpdate($fields, $condition);
|
||||||
|
|
||||||
return $ret;
|
$fields = DI::dbaDefinition()->truncateFieldsForTable('contact', $fields);
|
||||||
|
return DBA::update('contact', $fields, $condition, $old_fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user