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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damien Tournoud’s picture

Status: Active » Needs review
Issue tags: +D7 upgrade path
FileSize
17.72 KB

This should do it.

Damien Tournoud’s picture

One 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.

chx’s picture

Status: Needs review » Reviewed & tested by the community

This is an important and trivial stepping stone.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. One step closer to making the upgrade path work! :)

Crell’s picture

Issue tags: +API change

Changing where a hook must live is an API change, and should be announced as one.

rfay’s picture

Trivial 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.

Damien Tournoud’s picture

This 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.

Status: Fixed » Closed (fixed)
Issue tags: -API change, -D7 upgrade path

Automatically closed -- issue fixed for 2 weeks with no activity.