The DB update from Date 5.x-1.8 to 6.x-1.0-beta fails at line 334 of date.install (Call to undefined function content_alter_db_field()).

(CCK 6.x-1.0-alpha)

Comments

webernet’s picture

Title: Fatal error in update_5203 » Fatal error in update_5202
spcalpo’s picture

I'm having the same problem right now with update 5202. (I am updating from drupal 5.7 to 6.2)

Hoping there'll be a fix for this soon... or is there a better version for me to install (cvs, head)? The version of date I had in drupal 5.7 was Date 5.x-1.8, and the one I am updating to is 6.x-1.0-beta.

EDIT: I believe the problem is that the function content_alter_db_field() (a CCK function which date uses to update fields) is in a 5.x version of CCK but not the 6.x one. Looking at the 6.x version of content.admin.inc, but haven't yet quite figured how the new content_alter* functions work to duplicate what content_alter_db_field() did.

Sally

karens’s picture

Status: Active » Fixed

I just released a new 6.2-beta2 version for Date, so update to the latest code for Date and also get the latest -dev version of the Views module, which has some date-related changes that are needed for the Date views handling. If you use the Calendar module, get the new 6.2-beta2 version of that as well.

If you still have problems after that, open a new issue marked with the beta2 version so I know it's still a problem there.

webernet’s picture

Title: Fatal error in update_5202 » Fatal error in update_5202 (Calling CCK 5.x API function)
Version: 6.x-1.x-dev » 6.x-2.0-beta2
Status: Fixed » Active

This is still an issue. (date.install, line 375)

content_alter_db_field() doesn't exist in CCK 6.x.

The obvious work around is to update from 5.x-1.x to 5.x-2.x prior to the update to 6.x-2.x.

Calling API functions in updates is bad practice since there is no guarantee the same functions will still be around or work the same way when the update is actually run.

karens’s picture

Title: Fatal error in update_5202 (Calling CCK 5.x API function) » Get rid of content_alter_db_field() in date.install
Priority: Normal » Critical

@webernet - I know it's bad practice, but CCK has to do it too because the changes needed are way too complex to do this any other way.

Looks like I need to change the function in the D6 install file to match the D6 CCK version, that would make it work right even if you hadn't run that update in D5.

karens’s picture

Status: Active » Fixed

Fix committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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