HeyPublisher / amazon-book-store

WordPress plugin: Sell Amazon products in sidebar of your WordPress site
GNU General Public License v2.0
0 stars 1 forks source link

Removing all ASINs from default list results in internal IDs being displayed #21

Closed aguywithanidea closed 4 years ago

aguywithanidea commented 4 years ago

Start by deleting the asins in the default list: image

Click update and you'll see:

image

The asins being displayed are the internal keys from the hash, not the actual asins. For reasons related to how PHP handles merging hashes where the keys are considered numeric to PHP, the code must ensure that the keys remain strings, or the hash gets anonymized upon merge and the keys that were previously numeric ASINs get converted to a numeric sequence, losing the ASIN mapping.

To fix, ensure that the default asins loaded from code when this field is blank strips off the ASIN_ part of the key.