I am getting an error when running database update 7102

I have debugged it down to these lines in synonyms.install

function synonyms_update_7102() {
  $field = field_info_field('synonyms_synonyms');
  $field['locked'] = FALSE;
  field_update_field($field);

field_info_field returns NULL, so field_update_field fails with

Executing synonyms_update_7102 [notice]
Undefined index: field_name field.crud.inc:222 [notice]
Attempt to update a non-existent field. [error]

via drush, or

synonyms module
Update #7102
Failed: FieldException: Attempt to update a non-existent field. in field_update_field() (line 224 of .../html/modules/field/field.crud.inc).

via the UI

CommentFileSizeAuthor
#4 2626460-4.patch616 bytespeter.walter

Comments

peter.walter created an issue. See original summary.

peter.walter’s picture

Issue summary: View changes
sashken2’s picture

I have same error too.

peter.walter’s picture

Status: Active » Needs review
StatusFileSize
new616 bytes

See attached patch which makes the update conditional on the field existing.

  • bucefal91 committed a18ae87 on 7.x-1.x
    Issue #2626460 by peter.walter: fixing broken update hook.
    
bucefal91’s picture

Status: Needs review » Fixed

Thank you, guys. and I am tremendously sorry, I must have only tested it with enabled default field. Thank you for reporting it.

I confirm your patch solves it. I have committed your patch into the repository and then tagged a new release: 7.x-1.4 so the folks who haven't updated yet get to update with a functional update hook.

Fiufff.. I feel so ashamed for publishing a broken release :) (it's my 1st time and I've already made conclusions about it). I rushed it for no real reason, as a matter of fact I coded the update path just a few weeks ago and that code spent only few days (or even hours) in the dev snapshot before I released it as 7.x-1.3... and I didn't get not a single feedback from community on the update path #2592623: v12 to latest dev upgrade Though I did test myself.

Status: Fixed » Closed (fixed)

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