Patch (to be ported)
Project:
Amazon Store
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
29 May 2011 at 17:05 UTC
Updated:
30 May 2011 at 23:58 UTC
Jump to comment: Most recent file
I'm creating an issue to consolidate and track fixes for these separate issues. I'll close them and mark them as dupes of this one.
#1172106: Browse Info Panel needs to handle missing Browse Node Name fields
#1167830: Panels Amazon Browse widget outputs extraneous separator at end of browse list
#1167828: Amazon Browse widget navigation order is reversed
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | browse-info-bugfixes-and-improvements-1172442-1.patch | 1.58 KB | mcurry |
Comments
Comment #1
mcurry commentedHere's a patch that addresses all three issues.
For issue #1172106: Browse Info Panel needs to handle missing Browse Node Name fields:
The patch introduces a new variable named
'amazon_store_missing_browsenode_name_text'(as yet not configurable via any admin UI) that controls the text shown on browse nodes that do not have a name field or the name field is empty.The default value is
t('Unknown Category'). I'm open to suggestions for a better default, but for now that should be an improvement over an empty name. Adding this to the admin settings page will allow the site admin to customize it. If this patch is accepted and committed, I'll create a task to add an admin settings entry for this value.The other issues are straightforward fixes.
#1167828: Amazon Browse widget navigation order is reversed : Reverse the string being built by prepending, rather than appending, the current Browse Node name.
#1167830: Panels Amazon Browse widget outputs extraneous separator at end of browse list : Don't output a separator if this is the first browse node in the ancestor tree (which is actually the last item we will output, since we are now building the string in reverse, per the fix for #1167828: Amazon Browse widget navigation order is reversed).
Update1
If you look at the patch, you'll see I took the liberty of changing double quotes (") to single quotes (') in string constants that didn't use variable substitution or escapes, since there's no need for double quotes there.
It's a code style thing, but I recall that it's more efficient to parse single-quoted strings since the PHP parser doesn't have to look for '$' tokens or a variety of escapes.
Comment #2
mcurry commentedI've committed the patch. Marking as "to be ported" to 7.x.