Follow up from #1735118: Convert Field API to CMI

do we want to make it run as early as possible - and how ?. This could be an non issue too.

Means getting rid of the old _update_7000_field_*() helper CRUD functions, and rewriting the current upgrades that run on the "old storage" (currently, "custom blocks" & "user picture").


yched’s picture

We do need to get rid of _update_7000_field_*() helpers IMO.

We will most probably need to provide 8000 equivalents that work on top of "fields are stored in CMI now", at least for contrib (when their upgrades run, the core "field to CMI" upgrade has run already).
And keeping both sets of functions, one for the upgrades that happen to run before "field to CMI", the other for those that happen to run after, seems like a total WTF.

The clearest road IMO is to make sure the "field to CMI" upgrade runs as early as possible, and state that all upgrades, core or contrib, that need to mess with field definitions, do so on top of the new storage, period.

It just seems we don't have too many options to ensure this. This is not suited for update_fix_d8_requirements(), and other than that all modules, including system, are equal in front of update_build_dependency_graph().
So unless I'm missing something, it just means every impacted update needs to declare an explicit dependency on field_upgrade_8003 ?

swentel’s picture

Identified as well in the config conversion: sql storage runs before the config upgrade, which revealed notices because in case there are deleted fields the uuid is not yet created, hence the addition of _update_8000_field_sql_storage_tablename() in that patch.

see the comment here and interdiff:

swentel’s picture

Issue tags: +Field API


yched’s picture

Title: Decide on when the upgrade runs for Field API to configuration » Remove old _update_7000_field_*() helper functions.

Opened #1969662: Provide new _update_8000_*() CRUD helpers for Field and Instance definitions for the preliminary, required step, and keeping that one postponed.

yched’s picture

Title: Remove old _update_7000_field_*() helper functions. » Run "Field API : CMI" upgrade as early as possible.

Better retitle :-)

yched’s picture

#625958: Support Uploading Multiple Files for HTML5 Browsers via #multiple attribute added file_update_8002(), that runs *after* "field -> CMI". I posted a followup patch over there that makes the dependency explicit.

So now we have a mix of updates that manipulate field / instance definitions both before and after field_update_8003...

swentel’s picture