Download & Extend

Port token support to D7

Project:Amazon Module
Version:7.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Pancho
Status:needs work

Issue Summary

Some lines of amazon.module's amazon_token_list() do nothing. For example, $values is never read or returned:

$values['amazon_item']['isbn'] = t('The 10-digit ISBN (International Standard Book Number)');

I assume $values should be $tokens. Looks like a copy/paste error from amazon_token_values.

Comments

#1

Are you using tokens in D7 Amazon? I've never figured out how to use them, so have considered removing the support. However, since there is an open issue that would let you select which field tokens come from in D7 it might end up being useful.

Please explain how you're using tokens, and maybe we can find a path forward with them.

Edit: See #691078: Field tokens

#2

I'm not actually using them, but I was looking over the code and noticed the discrepancy.

#3

Patches are welcome! And a useful use for tokens with Amazon is *way* welcome.

#4

Version:7.x-1.0-beta4» 7.x-1.x-dev
Assigned to:Anonymous» Pancho

I'm gonna take a look at this.the next days.

#5

With tokens, we need correct behavior *and* instructions on the documentation page about how one might use them. I think the field tokens patch is getting closer, and it may require that. #691078: Field tokens.

#6

Title:Not all tokens returned in amazon_token_list()» Port token support to D7
Status:active» needs work

Token support currently doesn't work at all, cause the API has completely changed in D7.
Making it work is unfortunately non-trivial.

Supporting amazon_field (aka asin.module) with tokens requires #691078: Field tokens to be committed at least to contrib token module, so in any case we'd still have the dependency on that. Don't know about amazon_filter, however the problem seems to be that 1:n relations can't be currently mapped, so it's reasonable to put this on hold, too.

While making token support work for amazon_store is indeed possible, it comes for free with using the Entity API, which is anyway planned. So first of all, it makes sense to remove the non-working token code from 7.x-1, then we proceed to #1047642: Use Entity API in amazon_media, and then we come back here.

Removed non-working token support on commit: http://drupal.org/cvs?commit=500940

AttachmentSize
amazon_token_remove.patch 2.95 KB

#7

Subscribing

nobody click here