Open threeqube opened 9 years ago
I think there will be more badges with same names coming down the pike so we should definitely figure out a solution for this. Today, adding a badge from a new org with an existing badge name. Will do what I did for the programming for beginner's badge. https://www.mainestateoflearning.org/admin/badge/programming-for-beginners-spl
All links to badges now include issuer name. For example: /breakwater-enrichment-program-b-aerial-dance-basic-choregraphy
findBadgeByShortName function removes everything before and including "-b-".
This is on stage.
Hmmm...not sure if this is on stage yet. Just tried creating an "Intro to Chemistry" badge on stage which already exists under Breakwater Learning and after creating the new "Intro to Chemistry" badge, it went to the Breakwater "Intro to Chemistry" badge.
Actually I do think it's on stage. Don't think it's working quite yet though. Still seeing the issue.
It appears that all of the badge functionality in open badger is based on the badges having a unique name. Everything (or everything I've seen so far) is based on short-name lookup, so even though the urls have issuer name, when the badge gets looked up, it will find the first instance of that name. That's no good. It should really use a unique id or a unique badge name. 3 options I can think of: 1) Don't use duplicate badge names (What happened when you did use the same badge name initially?) 2) Change all the code to use the badge _id - not sure what the implications are of this throughout the code. Could be fairly time consuming 3) Ensure that all badges when created (as well as all existing badges) have a unique short name - probably something like: portland-trails-badge-name.
1 & 3 are probably the best options. Option 1 because I can revert the url code quickly and add code that checks for the name before saving and give an error message if it's a duplicate name. Option 3 because it will allow you to have duplicate names. I'd have to write a script to change all the short-names for all the badges but it'd still be less time than option 2 (which is probably how you want to do it in the future).
Leaning towards option 3.
@kayaelle speculates this has to do with the short code name of the badge that also becomes the human readable url.
From @kayaelle: "Not open badger at all. It's the short code name. Maybe the there need to be issuer + short code name or we add a new field for URL that can default to short code but be modified in the admin. I vote for the latter."