I have a node field for an Amazon item. When I create a node View, I add a relationship, and am presented with two very similar options:
Content: Amazon Item
Appears in: node:gift
and
Fields: Amazon Item (field_amazon_item) - asin
Appears in: node:gift
I'm not sure what the difference between them is, so I tried each.
I select "Content: ..." as the relationship.
I change "Show:" to "Fields".
I add "Amazon: product image" as a field, and get this in the preview section:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_field_amazon_item.field_amazon_item' in 'on clause'
And this when I try to view the page:
* SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_field_amazon_item.field_amazon_item' in 'on clause'
* Notice: Undefined variable: preview in views_ui_preview() (line 267 of /path/to/drupal/sites/all/modules/views/includes/admin.inc).
* PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'field_data_field_amazon_item.field_amazon_item' in 'on clause': SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {node} node LEFT JOIN {field_data_field_amazon_item} field_data_field_amazon_item ON node.nid = field_data_field_amazon_item.entity_id AND (field_data_field_amazon_item.entity_type = :views_join_condition_0 AND field_data_field_amazon_item.deleted = :views_join_condition_1) LEFT JOIN {amazon_item} amazon_item_field_data_field_amazon_item ON field_data_field_amazon_item.field_amazon_item = amazon_item_field_data_field_amazon_item.asin LEFT JOIN {amazon_item_image} amazon_item_field_data_field_amazon_item__amazon_item_image ON amazon_item_field_data_field_amazon_item.asin = amazon_item_field_data_field_amazon_item__amazon_item_image.asin AND amazon_item_field_data_field_amazon_item__amazon_item_image.size = :views_join_condition_2 WHERE (( (node.status = :db_condition_placeholder_0) ))) subquery; Array ( [:db_condition_placeholder_0] => 1 [:views_join_condition_0] => node [:views_join_condition_1] => 0 [:views_join_condition_2] => smallimage ) in views_plugin_pager->execute_count_query() (line 140 of /path/to/drupal/sites/all/modules/views/plugins/views_plugin_pager.inc).
So I tried the same with the other relationship, "Field: ...":
I change the "Show:" to "Fields".
I add "Amazon: product image" as a field.
I get this, repeated for each node, when I try to view the page:
Notice: Undefined index: detailpageurl in views_handler->get_value() (line 275 of /Users/shawn/Library/MAMP/htdocs/drupal7_gifts/sites/all/modules/views/includes/handlers.inc).
Comments
Comment #1
rfayI believe this is true for *every* field. I thought it was a new views usability issue, but maybe it's something I'm doing wrong in the Views API. Another thing that got changed?
Comment #2
rfayI just checked in a new version of the Amazon Example feature. It may help you as a basic for views. Still trying to sort out all the new Views 3 API changes.
Comment #3
rfayDereine says that the code in asin.module's hook_views_data:
entity_id, revision_id got renamed to
field_<fieldname>andfield_<fieldname>-revision_idComment #4
shawn dearmond commentedSo this is very odd. Now, when I select the relationship "Fields: Amazon Item (field_amazon_item) - asin" I don't get any errors at all when I start adding fields.
Cool!
It's still weird that the other relationship is there, but I'm glad that this one isn't throwing errors anymore.
Comment #5
rfayOK, dereine helped me with a fix. This is *committed* already. Patch is attached.
Comment #6
rfayPlease test with latest dev or with git clone and see if this solves the problem for you. Thanks.
Comment #7
shawn dearmond commentedTotally works! y'all rock!
Comment #8
PILIMILI commentedI would appreciate if i can get the complete file for asin.module no the patch i am not able for now to apply patches
thanks
Comment #9
rfay@PILIMILI, you see that this is marked "fixed", that means it has already been committed and is in the dev release. In #5 I mentioned that it was already committed also.
In the future, to learn how to apply patches, use Git. Some Windows instructions are at http://drupal.org/node/150036. You use "git apply patchfile.patch"
The instructions at http://drupal.org/patch/apply haven't yet been updated for git.
Comment #10
PILIMILI commentedI am learning
Comment #11
rfayPILIMILI++
Comment #12
PILIMILI commentedthanks in advance ,
I am not a developer I am learning from scratch if could you clarify for me please the below
" this is marked "fixed", that means it has already been committed and is in the dev release. In #5 I mentioned that it was already committed also."
so if "fixed" means running updated modules and is an update available for amazon and views it will fix the issue ??
Comment #13
rfayEvery 12 hours, a new dev release is created on the project page, http://drupal.org/project/amazon.
Right now you see there:
That means that on April 15 a commit was made and a new dev release created.
I don't know exactly how the automated updates will present these to you.
If you don't already know how to use IRC, you probably should learn how, as you could get much quicker answers to these things. http://drupal.org/irc.
Comment #14
PILIMILI commentedImpressive, thanks to show me this path. Every time i had amazon dev installed and run available recommended updates it changes to beta 5 how i could change so i gets only dev version??