In addressfield_field_views_data() the 'sql' storage is used to find tables and columns. It's not always 'sql'. (With field_sql_norevisions you can skip all revisions tables.) Very easy to check which storage is used for this field.

Change

  foreach ($field['storage']['details']['sql'] as $type => $tables) {

to

  $key = key($field['storage']['details']);
  foreach ($field['storage']['details'][$key] as $type => $tables) {

and that's it. No notices and correct views data.

Comments

rudiedirkx’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta4

Not dev.

rudiedirkx’s picture

Version: 7.x-1.0-beta4 » 7.x-1.x-dev
Status: Active » Needs review
StatusFileSize
new631 bytes

Dev too. And patch.

rszrama’s picture

Hmm, is there a chance there might be more than one storage engines? Should we be iterating over that storage details array or hard code the assumption that there will always only be one key?

rszrama’s picture

Issue summary: View changes
Status: Needs review » Postponed (maintainer needs more info)
rudiedirkx’s picture

Status: Postponed (maintainer needs more info) » Needs review

There's only 1, but it's not necessarily 'sql'.

rszrama’s picture

Status: Needs review » Fixed

Alrighty, let's put 'er in then. : )

Thanks for the patch!

Commit: http://drupalcode.org/project/addressfield.git/commitdiff/bada2a9d5d065a...

rudiedirkx’s picture

Woohoo! Grazi.

Everyone should do this, so field_sql_norevisions works without patching everything.

Status: Fixed » Closed (fixed)

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