https://webservices.amazon.com/paapi5/documentation/faq.html. Here it says:
We will be shutting down PA API 4 on October 31, 2019. All your applications and sites using PA API 4 will not work as expected after that. Hence, it is important to upgrade to latest version of PA API.
Is there any upgrade planned for the Drupal 7 version of the module?
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | pa_api_5-3081499-30.patch | 61.95 KB | tashaharrison80 |
| #29 | pa_api_5-3081499-29.patch | 26.54 KB | tashaharrison80 |
| #8 | pa_api_5-3081499-8.patch | 31.8 KB | au_dave |
| #4 | pa_api_5-3081499-3.patch | 34.25 KB | guardiola86 |
Issue fork amazon-3081499
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
guardiola86 commentedComment #3
guardiola86 commentedComment #4
guardiola86 commentedComment #5
au_dave commentedLookup doesn't work without a locale, use the site default.
Comment #6
au_dave commented2 attempt
Comment #7
au_dave commentedComment #8
au_dave commentedComment #9
marcoka commentedOk this is crazy. I did not realized this until today. Will check this and report back. Has any maintainer track of this?
@au_dave is you patch based on guardiolas or is it only your changes?
is it against 2.0 or 2.0 beta-4
Thx.
Comment #10
marcoka commentedgit clone --branch 7.x-2.x https://git.drupalcode.org/project/amazon.git
git apply -v pa_api_5-3081499-8.patch
info: remember to run db upgrades if you upgrade from 1.x
patch works. i put in an associate id for germany and removed any others: /admin/config/services/amazon
It seems he thinks i use an UK one:
Error retrieving Amazon item InvalidAssociate, message: Your access key XYZ is not mapped to Primary of approved associate store. Please visit associate central at https://affiliate-program.amazon.co.uk/assoc_credentials/home.
I am checking that now.
It is because function amazon_http_request(.. has only the urls for US and UK and all other countrys are missing
List here:
@see: https://webservices.amazon.com/paapi5/documentation/common-request-param...
If you add the appropriate locale the lookup will work
Germany example (DE)
I also flushed all amazon_* tables manually and ran chron multiple times to check if it gets the updates. seems to work so far.
Changing the ASIN on an existing node that uses an asin-field, does not work. If edited and saved.
That is because $locale is NULL instead of the right country code when calling various functions.
It seems all is initially hardcoded for UK. The locale logic is completely broken here.
There are also multiple forms for multiple associate ids per country on the admin page. So it seems the intention is to search multiple marketplaces fpr multiple affiliate ids too.
Quickfix
Ok now i get what you did. You can hack the amazon_http_request to just work with one lokale
Example
Lokale DE is hardcoded in that example, also see marketplace url, you hardcoded UK for your case/site. That would be a quick fix for a site using only one locale.
The module still throws a lot of other errors of thta old media insert stuff(that should be removed in my opinion).
Comment #11
marcoka commentedOk, now i get it.
You guys removed the old part that was checking for the default locale. That is the one you select in the dropdown on the admin page.
That seems to be the cause why you hardcoded the locale.
Comment #12
marcoka commentedAmazon seems to have a new offical api. Makes much sense to use it for the future.
https://webservices.amazon.com/paapi5/documentation/quick-start/using-sd...
I think i start a rewrite from scratch with a basic version keeping the asin data lookup field.
Comment #13
marcelovaniYep, that line is needed.
I am a co-maintainer, once this issue is reviewed by the community I will commit it.
I also noticed that there are some assumptions with regards to location, the code should work with any location.
Lastly, the tests are failing.
Comment #14
marcoka commentedI myself can´t make a patch. The patches here are not really great as they patch some things and break the locale functionality completely.
I will rewrite the whole thing. Using the full Amazon provided SDK. Also making it more basic again removing some stuff. It seems the new api doesnt support editorials yet. Also in a rush because amazon has dropped the current api.
I will write it in a way so that i can replace it on my old sites where is used 1.x. After that i also plan on porting it to D8 when i update my sites.
Comment #15
marcelovaniThat is great, I can help with Code reviews but we need more users from the community to test, if possible
Comment #16
marcoka commentedAnother fun fact. The new api uses throtteling, meaning 1 request per second if you are new. Even if you are a longterm affiliate that limit is 1 at the beginning and raises if you generate more sales.
So using the filter/tokens a lot will directly giv you throtteling/request drop on a node where you use 4-5 tokens.
I rewrote the filtermanagement to fix that bundeling the requests.
This new api ....
It seems amazon has postphoned the shutdown btw: https://forums.aws.amazon.com/message.jspa?messageID=921131#921131
But that does not mean we need no upgrade in some time. I will report back when i upload my first rewritten beta in a new project.
Comment #17
marcoka commentedJust a warning. The new throtteling in the api is a nightmare. You get "too many request" all the time, random also.
I just tried sending one request with the sdk, 5 seconds pause, again, "too many requests throtteling"
I have not found a solution yet, but i am searching for one. Also contacted the amazon support, maybe they can tell.
Comment #18
marcoka commentedAnother important fact.
1 Request per second should be possible(official statement in the docs). But that is NOT working. You get throtteled, even with a sleep(5).
The autocomplete function has to be dropped because it triggers searches way too fast and by that is not at all usable.
Comment #19
marcelovaniAre you able to do a batch request for multiple items?
Comment #20
marcoka commentedYes i batched multiple ASINS (up to 10) with one api call. I also rewrote the amazon_filter as the current code did like one request for each ASIN. meaning 10 filter tokens on a page = 10 requests and 100% instant ban on fiirst try.
When i say "ban" i mean their throtteling(token bucket algorithm they use as the docs state), that drops the requests then and returns no results.
I implemented GetItems and SearchItems currently. Both work but random throtteling bans even with big sleep between requests.
https://webservices.amazon.com/paapi5/documentation/operations.html
But also that works ...then after 5 requests with 5 seconds sleep ...throttle ban.
I now wrote directly to the ppaapi support as the normal support was not really understanding me correctly. I will see what they will answer.
Comment #21
marcoka commentedFor anyone using the api i recommend migrating they keys now. You can still use the migrated keys with the old api (v4) and the new api (5).
But it seems that there is a 30 day trial period for the requests in v5 after migrating for the the paapi5.
V4 still works as expected. I myself still use it on sites.
Maybe the amount of requets will get better after that 30 day time because in the new api, the request amount wil rais based on the amount of sales you do(not comission, sales!).
The new shutdown date anncounced seems to be 14th January 2020.
My current cleaned version of this module works, only problems are with some throtteling. I will upload a beta into a new project in the next few days. I removed as lot of stuff and documented that. WIll also publish that.
Comment #22
marcoka commentedOk i created a new project and created the first dev.
https://www.drupal.org/project/amazon_pa
It is also possible to use it as a drop in replacement if you check the detailed update instructions. I also added notes.
Now we need some testers too.
Comment #23
Denis Waßmann commentedHi there - is there anywhere a working Solution for this Problem, or is planed a new Version of the Modul?
Comment #24
marcoka commentedDoesn´t look like it and it is also not trivial. Worked for some weeks on my posted new module for D8 and ported it to D7 too.
Comment #25
Denis Waßmann commentedthx @marcoka - my problem with this is, that i have a community, wher lots of authors have deposited via ASIN their own books. When this modul dosnt work anymore, i have a problem with an important feature on my website. When i use your new module, everything will not work anymore from the amazon-api-Modul, right?
Comment #26
marcoka commentedOk let me explain.
I was using this module here. It was obvious it is not actively maintained but i use it on all my websites.
So i took this module and cleaned up a lot of stuff, read it all and ported it to D8 in a first beta version. That D9 version will be finalized when i update my sites to D8 after some other modules get neccessary patches i need.
The PAAPI5 also provides an SDK from amazon(official) so it makes a lot of sense to use that and i did.
The new API also removed some features that this module here has, like the customer reviews and some other stuff. It is all documentent on the amazons api docs, that by the way is very good.
This is not a trivial update as it took me a lot of time to write that new module.
After that i ported that back to D7. I then updated my sites to my new module. So data will not get lost as i tested with my sites.
I suggest you download your site to a local system and test the update there. Then check if all works and if data is missing or not.
Comment #27
Denis Waßmann commentedoh - that sounds very good - I test it and report - thx
Comment #28
marcoka commentedI also released a D8 version now that i use on my live sites.
https://www.drupal.org/project/amazon_pa
Comment #29
tashaharrison80 commentedThere is a bug in the patch which meant that gallery imagesets weren't being saved into the database. I've fixed it in this patch, but I still don't think this patch is ok to merge because of the locales being effectively hardcoded. It also looks as though there is a better option to this module, so not sure it's worth fixing the locales stuff. My company is using the patch, which is why I'm fixing it, but I can fix the locale stuff if that is required.
Comment #30
tashaharrison80 commentedThe patch on 29 is broken. I think this needs a lot more work though. So I've fixed the small bit that was broken on 8.