Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Where _ is the id number I used.
In my particular case I entered the following badge by using autocompletion:
Proscrit (Badge ID 12)
I tried id's from 1 to 15 but it didn't work either. Maybe if I could check what is the id somehow.
Comment | File | Size | Author |
---|---|---|---|
#16 | bagdes.jpg | 111.94 KB | gaguime |
#10 | user_badges-invalid-id-1698724-9.patch | 867 bytes | indyana |
2.jpg | 46.9 KB | mermemladeK | |
1.jpg | 101.99 KB | mermemladeK |
Comments
Comment #1
mermemladeK CreditAttribution: mermemladeK commentedStill getting the same problem after installing 7.x-2.x-dev.
Any updates on this issue?
This is an example of error message:
14 is not a valid badge ID. Try using the autocomplete function (requires javascript).
(I used autocomplete)
Comment #2
mermemladeK CreditAttribution: mermemladeK commentedIt got solved, not sure how, but I guess after cleaning badges, images, completely uninstalling it and restalling lates dev it worked. Or maybe it was another module, who knows now...
Comment #3
kewalk CreditAttribution: kewalk commentedI would like to repeat..1 am getting the same error as above
Comment #4
shabana.navas CreditAttribution: shabana.navas commentedA fix for this will be submitted very shortly.
Comment #5
kewalk CreditAttribution: kewalk commentedThank you. However, this module is quite slow on its track of development, especially regarding issues such as those mentioned above. It is to note that this issue has been around for a long long time. I understand that the maintainers are busy but may be a little attention can help. Once again, we are thankful for this wonderful module, but its testing our patience. I for example, made do, with flags as badges. Not correct or elegant, but it worked. Just waiting for this module to function at least the minimum functionality and then would use it.
Comment #6
mermemladeK CreditAttribution: mermemladeK commentedThat's great Shabana!
Kewalk: while I agree on what you say, I don't think you should blame it on Shabana because I think he's just new blood in this project and so far providing patches and apparently even an update.
Comment #7
kewalk CreditAttribution: kewalk commented@mermemladeK...i do not blame any one...it just that its a tad slow...and as i said earlier i understand the time concerns but this being a module which has great potential is lacking behind...once again i am thankful for the module...waiting for it being functional...i am glad to assist in any way whatsoever...
Comment #8
indyana CreditAttribution: indyana commentedFor anyone still seeing this, could you provide more details on the Badges settings used or the environment? I just installed the 7.x-2.x-dev module, planning to troubleshoot, but I'm unable to replicate it.
Comment #9
indyana CreditAttribution: indyana commentedStill not able to replicate this, but I did notice something while going through the code. To determine if the badge ID is valid, we do a db_select matching the id to the "bid" field in table user_badges_badges, then perform a rowCount on the results. Documentation indicates that this is not the preferred method of determining the results of a SELECT operation. rowCount may not return the actual result count on some database systems and can only reliably be used for DELETE, INSERT, or UPDATE queries.
See:
http://drupal.org/node/1251174
"To count the number of rows returned from a SELECT statement use"
Comment #10
indyana CreditAttribution: indyana commentedHere's a patch that reflects the change mentioned above.
Added
->countQuery()
before executing the query to change it into a count query, then changed rowCount to->fetchField()
to get the count result.This works exactly the same way in my local installation. I'm hopeful it might solve this issue for some folks, but, as I haven't been able to replicate this, I cannot be certain. Please comment with your results if you try this patch.
Reached a deadend here. Other information that could be helpful for context would be Drupal core version, PHP version, and database version. If you're comfortable with looking in the database tables, you could also take a peek in table user_badges_badges to see if the specified ID ("bid") is correct.
Comment #11
indyana CreditAttribution: indyana commentedComment #12
shabana.navas CreditAttribution: shabana.navas commentedComment #13
gaguime CreditAttribution: gaguime commentedI have applied the patch but it doesn't help. My site is in english
Comment #14
shabana.navas CreditAttribution: shabana.navas commentedComment #15
shabana.navas CreditAttribution: shabana.navas commentedPlease provide your exact steps for replicating this issue as I haven't been able to duplicate the error.
Comment #16
gaguime CreditAttribution: gaguime commentedI have created four badges. when I try to assign them to either
a role: http://dentalhealthdubai.com/commons/admin/config/people/user_badges/roles
an user: http://dentalhealthdubai.com/commons/user/1/edit/badges
I get the message: "un" is not a valid badge. Try using the autocomplete function (requires javascript).
You can find the
I am kind of knew here and I don't know why autocomplete is not activated though
thanks
Comment #17
shabana.navas CreditAttribution: shabana.navas commentedHave had some issues to take care of the last few days, will take a look at this as soon as I get some time.
Comment #18
shabana.navas CreditAttribution: shabana.navas commentedI have added the same badges and still not getting any errors when I try to assign a badge to a role or user. This might be obvious, but, do you have javascript enabled in your browser? Make sure you also clear cache, just in case. I don't think you really need this patch anyway as it doesn't do anything fundamentally different. There must be some other problem.
Can you check the user_badges_badges table and report back what records you have there?
Comment #19
wikibi CreditAttribution: wikibi commentedOk, I FINALLY figured it out. The "read me" text should explain more thoroughly how to do this. Wanted to use this wonderful module in drupal 6 (had same problem) finally now able to use for drupal 7. Blah, blah let me get to the point.
1- Go to admin/config/people/user_badges press "add new badge" and submit a URL to your badge or upload.
2- The badge will appear under "List."
3- Now this is the fun part - Under the "Name" column copy the badge name.
This will allow you to use autocomplete function in the next step!
AND HERE I WAS THINKING HOW TO KICK IN THE AUTOCOMPLETE??
4- Click on the "roles" link and "paste" the badge name. The autocomplete will show you the badge.
Solved!
Would be great to have this module work with userpoints.
Comment #20
shabana.navas CreditAttribution: shabana.navas commentedSo, are you saying you just had the problem of not being able to select the badge name via the autocomplete? Is this issue just a pure case of not using the autocomplete when entering a badge?
Basically, the autocomplete puts the badge id at the end, and, I think perhaps, people just paste in the badge name before the autocomplete could kick in and the badge id, which should be there at the end, is left out, giving you the error.
I guess if that is the problem, I can just add a description underneath the textfield to let users know that they need to wait for the autocomplete to load.