- Status changed to RTBC
over 1 year ago 10:43am 22 May 2023 - 🇬🇧United Kingdom mustanggb Coventry, United Kingdom
This is still working great, including the change to support
*.install
added in #127.#129 is the patch to review.
- last update
over 1 year ago 2,153 pass - 🇸🇰Slovakia poker10
I think the patch looks good in overall.
In addition to the new alter hook addition, there are two changes comparing with the current code:
1.
@@ -388,9 +404,7 @@ function field_read_fields($params = array(), $include_additional = array()) { // Populate storage information. - module_load_install($field['module']); - $schema = (array) module_invoke($field['module'], 'field_schema', $field); - $schema += array('columns' => array(), 'indexes' => array()); + $schema = field_retrieve_schema($field);
Similar code is on two more places, but here the
$schema
array does not get'foreign keys' => array()
key inicialized. After the patch is applied, the$schema
array gets this key initialized, because the new functionfield_retrieve_schema()
does this by default:+function field_retrieve_schema($field) { ... + $schema = (array) module_invoke($field['module'], 'field_schema', $field); + $schema += array('columns' => array(), 'indexes' => array(), 'foreign keys' => array()); ... +}
I am not suggesting this is wrong or a problem, but better to ensure this specific change would not cause any side-effects.
2.
@@ -130,9 +150,7 @@ function field_create_field($field) { // Collect storage information. - module_load_install($field['module']);
Before the patch, these functions were loading only one
.install
file - for the field. After the patch, all.install
files are loaded (for obvious reasons), so that any alter hook is found and run:+function field_retrieve_schema($field) { + // Make sure the installation API is available. + include_once DRUPAL_ROOT . '/includes/install.inc'; + module_load_all_includes('install'); ... +}
This can have a minor performance effect, but taking into account a fact, that this code is mostly run on field CRUD operations (insert, update, delete) and also in
field_read_fields()
, where the field definition output is cached incache_field
table most of the time, this should be very minor and not a problem at all.Just a small nitpick:
diff --git a/modules/field/field.crud.inc b/modules/field/field.crud.inc @@ -20,6 +20,26 @@ +/** + * Retrieves the schema for a field. + * + * @param array $field + * The field array to get the schema definition against. + * @return array + * The field schema definition array. + */
I think that the
@return
part in the phpdoc should be prepended by a newline.Adding a tag for @Fabianx review.
- last update
over 1 year ago 2,114 pass - last update
over 1 year ago 2,153 pass - last update
over 1 year ago 2,149 pass - last update
over 1 year ago 2,114 pass - last update
over 1 year ago 2,153 pass - last update
over 1 year ago 2,153 pass - last update
over 1 year ago 2,153 pass - last update
over 1 year ago 2,153 pass - last update
over 1 year ago 2,153 pass - last update
over 1 year ago 2,153 pass - last update
over 1 year ago 2,157 pass - last update
over 1 year ago run-tests.sh exception - last update
over 1 year ago 2,157 pass - last update
over 1 year ago 2,157 pass - last update
over 1 year ago 2,157 pass - last update
over 1 year ago 2,157 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago run-tests.sh exception - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago run-tests.sh exception - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,161 pass - last update
over 1 year ago 2,162 pass - last update
over 1 year ago 2,162 pass - last update
over 1 year ago 2,162 pass - last update
over 1 year ago 2,162 pass - last update
over 1 year ago 2,162 pass - last update
over 1 year ago 2,162 pass - last update
over 1 year ago 2,162 pass - last update
about 1 year ago 2,162 pass - last update
about 1 year ago 2,162 pass - last update
about 1 year ago 2,162 pass - last update
about 1 year ago 2,162 pass - last update
about 1 year ago 2,162 pass - last update
about 1 year ago 2,162 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago run-tests.sh exception - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago 2,163 pass - last update
about 1 year ago run-tests.sh exception - last update
about 1 year ago run-tests.sh exception - last update
about 1 year ago 2,165 pass - last update
about 1 year ago 2,165 pass - last update
about 1 year ago 2,165 pass - last update
about 1 year ago 2,165 pass - last update
about 1 year ago 2,165 pass - last update
about 1 year ago 2,165 pass - last update
about 1 year ago 2,165 pass 37:04 34:41 Running- last update
about 1 year ago 2,165 pass - last update
12 months ago run-tests.sh exception - 🇩🇪Germany Fabianx
Approved!
I am fine with that change.
I agree with the great review, but think that the additional columns should not make a problem in practice.
- Status changed to Fixed
12 months ago 11:25am 5 December 2023 - 🇬🇧United Kingdom mcdruid 🇬🇧🇪🇺
Thank you everybody that contributed to this.
Very hard to get credit perfect on an issue that's almost old enough to drive a car (in some places) with well over 100 comments; apologies if I've made mistakes.
- 🇸🇰Slovakia poker10
I have drafted a simple CR here: https://www.drupal.org/node/3406312 →
Automatically closed - issue fixed for 2 weeks with no activity.