asin.module lines 263 and 270 each consist of:
'extra' => array(array('field' => 'etid', 'value' => _field_sql_storage_etid($entity), 'numeric' => TRUE)),

Method "_field_sql_storage_etid" doesn't seem to exist, resulting in a PHP error when attempting to visit the views administration page. I don't know enough to know whether these lines matter so I'm uncommenting them locally and I'll see how it goes :)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rfay’s picture

Have you run update.php yet?

I'll be surprised if this has had an impact on ASIN module, but #986992: Insane etid / {field_config_entity_type} abstraction was a signficant change and resulted in lots of update issues.

jdleonard’s picture

Yes, I ran updates. I'm using d7 rc4.

rfay’s picture

I can't recreate this with a simple experiment. I have emptied amazon_item table and cleared cache and edited and created new amazon items.

Please provide an exact technique to create this error. and test with current dev and current Drupal 7. Please test with a clean D7 if you can as well.

jdleonard’s picture

Status: Active » Closed (cannot reproduce)

I am using a lot of other modules so it may be related to them. I don't have a need for the ASIN module anymore, so I'll let this rest. Thanks for your time!

kahta’s picture

Status: Closed (cannot reproduce) » Active

i ran into the same problem as above.
"Fatal error: Call to undefined function _field_sql_storage_etid() in [...] /sites/all/modules/amazon/asin/asin.module on line 263"
error occurs when i open the views configuration page.
i am using 7.0 and views 7.x-3.0-alpha1

jmickela’s picture

I also have this problem.

Just did a clean install of D7 and all modules I'm using, added some items, tried to access views and got this error.

rfay’s picture

All, we certainly want to solve this.

Please provide the exact views module you're using, and attach a sample exported CCK type and a sample exported view.

kahta’s picture

$fields['node-comic-field_amzn_link'] = array(
'field_config' => array(
'active' => '1',
'cardinality' => '1',
'deleted' => '0',
'entity_types' => array(),
'field_name' => 'field_amzn_link',
'foreign keys' => array(),
'indexes' => array(),
'module' => 'asin',
'settings' => array(),
'translatable' => '1',
'type' => 'asin',
),
'field_instance' => array(
'bundle' => 'comic',
'default_value' => NULL,
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'module' => 'asin',
'settings' => array(),
'type' => 'large',
'weight' => '1',
),
'teaser' => array(
'label' => 'above',
'settings' => array(),
'type' => 'hidden',
'weight' => 0,
),
),
'entity_type' => 'node',
'field_name' => 'field_amzn_link',
'label' => 'Amazon',
'required' => 0,
'settings' => array(
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 0,
'module' => 'asin',
'settings' => array(),
'type' => 'asin_text',
'weight' => '-3',
),
),
);

can't access views.

mqx66’s picture

after amazon field enabled, if I want to access Views, there is a blank page with following message:

Fatal error: Call to undefined function _field_sql_storage_etid() in /home/....../sites/all/modules/amazon/asin/asin.module on line 263

but Amazon along does not cause problem.

Thanks

dwaine’s picture

My site experienced this same error when I added Views version 7.x-3.x-dev to D7 version 1.0. Removing the dev version of Views and then installing Views version 7.x-3.0-alpha1 rectified the problem. My site does not utilize the Amazon module.

I don't know if my issue is the same as the one affecting the Amazon module but thought the solution might help track down the cause. Good luck.

rfay’s picture

Is it possible this is just a views problem?

rfay’s picture

I am able to recreate this problem:

Fatal error: Call to undefined function _field_sql_storage_etid() in /home/rfay/workspace/d7git/sites/all/modules/amazon/asin/asin.module on line 334

The problem seems to be that hook_views_data() needs to be reworked somehow. I'll try to check in with dereine about this.

rfay’s picture

dereine's suggestion in IRC:

<dereine> rfay: short question: this code is basically a c&p from the old with some changed things?
<dereine> it might make sense / help to fix problems to call field_views_field_default_views_data and just change what you need to change
<dereine> see list_field_views_data for an example of this
dawehner’s picture

Basically see the todo in asin.module :)

Checked out a old version of views and made a diff between the codepart of asin and the codepart of views.

The result for me is that the only difference is

a) the relationship to the column_name
b) the relationship via the delta

Everything else are bugfixes in views.

So based on this i removed the data and filled in the two relationships.
This isn't tested yet :(
Sadly i have no idea how to setup all this, but my IDE showed me that every variable, which is used in this code, is defined.

Mh the diff is really hard to understand! It's much better if you apply the patch and see the output.

rfay’s picture

This one is based on your instructions (and taxonomy_field_views_data() in taxonomy.views.inc) but not on #14. It seems to work ok, but I haven't thoroughly tested it. Would be interested in your feedback, @dereine.

#14 has some problems with using variables that haven't been defined, so doesn't work out of the box, and you were making it while I was doing this one on the plane.

I don't understand what the

+      $data[$table]['delta']['relationship'] = array(

stuff is. Is that necessary?

rfay’s picture

Status: Active » Needs review
TomSherlock’s picture

Status: Needs review » Active

Please ignore this comment.

rfay’s picture

@TomSherlock, you probably have an old views module. Please upgrade to the latest views. Your issue will be caused by the same Drupal core code change, but not be related to Amazon.

TomSherlock’s picture

Status: Active » Needs review

Thanks for the immediate reply.

Actually it was more basic than that: after updating from rc1 to 7.0 I also began updating views. But never finished it. So when I went back to it, I forgot. The old views folder had been removed and the compressed archive for the new views folder had not yet been unpacked. So, carelessness on my part.

dawehner’s picture


-        $data[$table]['delta']['relationship'] = array(
-          'base' => 'amazon_item',
-          'table' => $table,
-          'field' => 'delta',

No idea, but i just had this code, so i thought it was there by intention.

kahta’s picture

thanks :)
amazon.hook_views_data_1011280_15.patch
works for me

rfay’s picture

rfay’s picture

Priority: Normal » Critical
Status: Needs review » Fixed

OK- I committed this one because it's critical, https://drupal.org/cvs?commit=485270

But I haven't personally tested a number of things yet, and would appreciate if you could all test the dev release when it's built shortly.

Things that need to be tested:

Ordinary views using no relationships
Nodes with relationships to amazon item (testing all types of field)
Views of amazon items (testing all types of fields)

Status: Fixed » Closed (fixed)

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

zabelc’s picture

Status: Closed (fixed) » Active

I hate to say it but I just got an auto-update to the Amazon module (7.x-1.0-beta4 dated 2011-02-07), and this error reappeared.

That said the patch killed it, so perhaps the patch was accidentally overwritten in CVS.

rfay’s picture

Status: Active » Fixed

@zabelc, there has been no new release of Amazon since December, so this fix isn't in anything but the dev release. If you got an "auto-update" dated 2011-02-07, then there's something wrong with the update system, and we should file a bug against that. I'm setting back to fixed, but interested in what happened. See the releases on http://drupal.org/project/amazon.

That said, it *is* time for a release.

PILIMILI’s picture

Status: Fixed » Needs review

I am still working on installing amazon I had tray on drupal 7.x-1.0 beta4 when selecting: structure and then views i get the following error
Fatal error: Call to undefined function _field_sql_storage_etid() in C:\wamp\www\drupal-7.0 Rosa\sites\all\modules\amazon\asin\asin.module on line 263

and in drupal 7.x dev when i get to views to set up relationships (I am Using Views 7.x.-3 x dev)
the option content amazon_item is not there What info you need i do not have clear what you mean by content type and the view.

rfay’s picture

The etid fix was committed... Sorry that we haven't made a new release yet. We'll have one coming soon. In the meantime, please use the dev release.

PILIMILI’s picture

Status: Needs review » Fixed

When you say use the dev release are you referring to Drupal 7.x dev if this is the case how i can fix the module views to set up relationships (I am Using Views 7.x.-3 x dev)
the option content amazon_item is not there.
please let me know what i can do to fix it

rfay’s picture

Amazon 7.x-1.x-dev

PILIMILI’s picture

FileSize
64.31 KB

For the issue before I am using Amazon 7.x-1.x-dev where i can not set in views the relationship because content amazon_item
is no available (please see the picture attached )

rfay’s picture

It's called field_amazon here and it's in your screenshot...

PILIMILI’s picture

Thanks

Status: Fixed » Closed (fixed)

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