Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Because we cannot load modules during the upgrade path but still need to create fields, we need to move all the hook_field_schema() implementations to .install files.
This is a spin-off of #898520: Clean-up the upgrade path: comment.
Comment | File | Size | Author |
---|---|---|---|
#2 | 902264-move-hook-field-schema-install.patch | 18.54 KB | Damien Tournoud |
#1 | 902264-move-hook-field-schema-install.patch | 17.72 KB | Damien Tournoud |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis should do it.
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedOne hunk of the previous patch relied on #898520: Clean-up the upgrade path: comment, and chx noted that field.crud.inc now needs to load the install files too.
Comment #3
chx CreditAttribution: chx commentedThis is an important and trivial stepping stone.
Comment #4
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. One step closer to making the upgrade path work! :)
Comment #5
Crell CreditAttribution: Crell commentedChanging where a hook must live is an API change, and should be announced as one.
Comment #6
rfayTrivial testing says to me that this does not affect the normal module workflow. I'm able to enable, uninstall, etc. a module with this in the wrong place.
So is the effect that if your module is in included in an install profile, it would fail on install of a new system?
One of the biggest problems I notice is that the various CCK modules have this in the .module.
Comment #7
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis is more a best practice kind of thing. hook_field_schema() should, like hook_schema() live in
.install
. It might work if place somewhere else, but we cannot make any guarantee.