I'm getting this error after updating file field paths on a content type and then performing a retroactive update: Fatal error: Call to undefined function field_attach_query() in /sites/all/modules/filefield_paths/modules/image.inc on line 82

I believe the issue is that field_attach_query() is no longer part of Drupal 7 and should be replaced with EntityFieldQuery as described here - http://lists.drupal.org/pipermail/development/2010-June/035734.html

Comments

h0tw1r3’s picture

Status: Active » Needs review
StatusFileSize
new2.43 KB

field_attach_query was removed in Drupal 7 and there is a comment in the code:
// TODO This needs to be replaced with EntityFieldQuery
Second, the file and image module _update functions are switched (image_ is in file.inc, and file_ is in image.inc).
Patch attached addresses both problems.

h0tw1r3’s picture

StatusFileSize
new2.44 KB

Previous patch had a few ^t's sneak into it. Fixed.

W.M.’s picture

I have applied this patch to the latest dev version but got this error message after requesting a retroactive update:

"An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?id=32&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1: INSERT INTO {field_data_field_sblink_url} (entity_type, entity_id, revision_id, bundle, delta, language, field_sblink_url_url, field_sblink_url_title, field_sblink_url_attributes) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, ); Array ( [:db_insert_placeholder_0] => node [:db_insert_placeholder_1] => 9 [:db_insert_placeholder_2] => 9 [:db_insert_placeholder_3] => sblink [:db_insert_placeholder_4] => 0 [:db_insert_placeholder_5] => und [:db_insert_placeholder_6] => http://www.mydomain.com [:db_insert_placeholder_7] => ) in field_sql_storage_field_storage_write() (line 424 of /home/user/public_html/myproject/modules/field/modules/field_sql_storage/field_sql_storage.module)."

Note: I use Link module. CMS is D7.2.

h0tw1r3’s picture

@Geir19 looks like a problem with Link #1055772: Error when calling field_attach_update(). When the field_attach_update hook gets called Link blows up.

W.M.’s picture

@h0tw1r3 Thanks for info.

sachbearbeiter’s picture

@4 i also get the link related error message of #3
@4 the patch of #2 seems to work - thanks a lot

in the issues are a lot of patches to fix errors - i hope, they will move fast into dev ...

h0tw1r3’s picture

Status: Needs review » Fixed

Fix applied to 7.x-1.x-dev in commit 207123b.

Status: Fixed » Closed (fixed)

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