Hi,
Short description
this is a rather strange (but in my installation reproducible) bug: If I use the Amazon-Field for CCK it is only working the first time I access the generated node.
In this case, $node->field_amazon[0] contains an array of information returned by amazon. Whenever I reaccess this node, the array contains only the ASIN and the image-url, the content shows the image. When I edit the node the same thing occurs - first access: Working, second access: Defective.
Circumvention
I am currently circumventing this problem by manually calling the provided methods (Kudos for them! They are very nice, though I haven't been able to find a documentation):
$amazon_info = amazon_item_lookup(_amazon_clean_type($node->field_asin[0]));
print_r($amazon_info); // prints a nice array containing all the information needed to construct the real code
System
OS: Debian Linux unstable with custom 2.6.28.2-kernel
DB: MySQL 5.0.75-1 (Debian standard)
Apache: 2.2.11-2 (Debian standard)
PHP: 5.2.6 (Debian standard)
Drupal: 6.10
Amazon API: 6.x-1.0-beta5
CCK: 6.x-2.1
Quite a couple of other modules (views 6.x-2.3, currency, money, date, read more tweak, imce, wysiwyg, etc etc etc) but I don't think that they interfere. I am using a custom theme (all the node- and page-information from the default theme is printed someplace on the page) and the node is accessed directly and fully (no teaser, no VIEWS-interaction, just node/x-access).
There are no entries in my Drupal log-files.
Amazon-API-settings: Using default settings or custom settings changes nothing.
Steps to reproduce error
- Create content-type containing amazon-textfield. Add "print_r"-statement to the node-template to print the Amazon-field.
- Create node using the generated content-type, inserting a valid ASIN into the amazon-textfield
- Access node - see wonderful Amazon-information array
- Access node again - see only ASIN and "View"-Code
Array
(
[asin] => 3810515809
[view] => <div class="amazon-item amazon-item-book amazon-item-default">
<img ..><div><strong><a href=..>..</a></strong></div>
</div>
)
Comments
Comment #1
Anonymous (not verified) commentedI forgot to mention, that exactly the same behaviour is true when I try to insert Amazon-information via the amazon-filter.
Comment #2
drurian commentedAmazon field should show information from Amazon (there're several templates available).
Comment #3
Anonymous (not verified) commentedWhich does not explain, why a new node shows (and contains) more information then an old one - and this is especially true because the database (yes, I am using locally cached data) contains the full set of information. Apart from that: Changing the "display settings" for the amazon field does not change the display itself or the amount of information presented. In fact, no matter what I choose (e.g. "Large Image") only the small image and sometimes the title is shown.
And the templates made available by the Amazon module (small image, view information; small image, full information; large image; etc) are not really to my liking, but that is a matter of personal preferences.
--edit: I appologize. After editing some more details are shown, but again, only after an edit/creation.
Comment #4
drurian commentedI don't know, I can't reproduce your bug with Amazon fields using cache.
I modified field templates for my theme but didn't add anything to the node template.
Comment #5
rfayI'm going to assume this has been resolved.