-
-
Notifications
You must be signed in to change notification settings - Fork 824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Schema handler fixes #18932
Schema handler fixes #18932
Conversation
This cleans up the tableName lookup to use the method used throughout this class. The extra optimization (local caching in the $tables variable) was actually less efficient because CRM_Core_DAO::getFieldValue caches its results, and is used elsewhere so the value is likely to already be cached. The bug is that the same table name was repeatedly being passed into $logging->fixSchemaDifferencesFor().
(Standard links)
|
@@ -145,7 +137,7 @@ public static function bulkSave($bulkParams, $defaults = []) { | |||
$logging->fixSchemaDifferencesFor($tableName, ['ADD' => $addedColumns[$tableName]]); | |||
} | |||
|
|||
Civi::service('sql_triggers')->rebuild($params['table_name'], TRUE); | |||
Civi::service('sql_triggers')->rebuild($tableName, TRUE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eileenmcnaughton this looks like it was a real bug to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes - it would have only updated one - probably in practice that was enough
* @return bool | ||
*/ | ||
public static function alterFieldSQL($params, $indexExist = FALSE, $triggerRebuild = TRUE) { | ||
CRM_Core_Error::deprecatedFunctionWarning('function no longer in use / supported'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep - deprecated Jul 2019
Cover in testBulkCreate() is adequate here & code makes sense so as long as tests pass all good |
Overview
Updates and a minor bug fix to custom field saving.
Before
Unused function hanging around.
Wrong param passed to
fixSchemaDifferencesFor()
.Overly complicated optimization that may have actually been less efficient.
After
Cleaner.