Continuing the quest to a cleaner upgrade path.

The system upgrade path is a large and convoluted one. It mixes upgrades of the base system itself with upgrades of the upload module and database engines.

We need to clean-up this:

  • Make sure that all the critical updates are at the beginning of the process
  • Move the PostgreSQL-specific updates out of there and back to the PostgreSQL driver
  • Refrain from using any API functions that rely on hooks. The one I spotted are: node_type_get_types(), theme_get_setting(),
  • Redo all the numbering

Comments

damien tournoud’s picture

Priority: Normal » Critical

Critical because of the use of API functions which result depend on the list of modules being enabled.

damien tournoud’s picture

StatusFileSize
new2.81 KB

The critical part is actually very tiny. If feel like this patch is minimum set of changes necessary.

This depends on the field helper functions introduced by #898520: Clean-up the upgrade path: comment, so it will not pass the test bot.

berdir’s picture

Do we want to merge the changes to 7060 with this issue: #895176: Upgrade fails because of integrity constraint violation in system_update_7060 ?

I'm unsure about the conditional creation of fields, the other issue (and the duplicate one I linked in #10) has shown that this is a problem if anything goes wrong with the update function and someone tries it a second time (Maybe he messed around manually with the schema), it explodes.

I guess we could actually make the _field_* helper functions intelligent enough to silently handle the case (maybe return TRUE/FALSE?) when a field already exists? Instead of throwing an ugly exception...

webchick’s picture

Status: Active » Needs review

There's a patch here.

Status: Needs review » Needs work

The last submitted patch, 898584-upgrade-cleanup-system.patch, failed testing.

berdir’s picture

Discussed #3 with chx and we came to the conclusion that the best thing to do is separate out the field creation calls into their own update function so failures during processing of the files doesn't lead to re-creating the fields.

fsilva’s picture

Status: Needs work » Needs review
Issue tags: -D7 upgrade path

#2: 898584-upgrade-cleanup-system.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 898584-upgrade-cleanup-system.patch, failed testing.

ksenzee’s picture

Status: Needs work » Needs review

#2: 898584-upgrade-cleanup-system.patch queued for re-testing.

Status: Needs review » Needs work
Issue tags: +D7 upgrade path

The last submitted patch, 898584-upgrade-cleanup-system.patch, failed testing.

ksenzee’s picture

Status: Needs work » Needs review
StatusFileSize
new1.1 KB

Sorry for the double retest. Here's a patch that uses the new update helper function names and removes the fixes to 7060 in favor of #895176: Upgrade fails because of integrity constraint violation in system_update_7060, which I hope to have a new patch for shortly as well.

Status: Needs review » Needs work

The last submitted patch, 898584-11-upgrade-cleanup-system.patch, failed testing.

David_Rothstein’s picture

Should this use variable_get('theme_default', 'garland') rather than 'bartik', since this runs on a site upgrading from Drupal 6?

chx’s picture

Status: Needs work » Needs review
StatusFileSize
new1.12 KB

now update node get types return type objects not type strings. Trivial fix after realizin' that.

chx’s picture

Ah. Changed bartik to garland.

catch’s picture

Status: Needs review » Reviewed & tested by the community

7060 is handled elsewhere, garland change looks good, RTBC.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed #16 to HEAD. Thanks!

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

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