User Badges not saving point requirements in Database

venusrising - January 28, 2009 - 05:34
Project:User Badges
Version:6.x-1.4
Component:Miscellaneous
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

User Badges not saving point requirements in Database. The badges upload and appear fine, but when trying to set up the points needed for each badge it states.

* Inserted new image
* There was a problem saving the badge information into the database. THIS IS THE ISSUE
* Added all users with badges as well

#1

zadirion - January 28, 2009 - 09:18

I'm not sure if it's the same issue, but here it is:
i upload the badge, and indeed it is uploaded fine, appears in the 'badges' folder. but after that when i go to 'Edit user badges' the message 'You have to upload badge images first.' appears, and i see no place to assign badges to roles. i also tried the 6.x-1.x-dev version, same issue, and furthermore drupal warns me that 'newer version is available' when install the dev version.

LATER EDIT:
my problem was i was uploading a file with an uppercase expression. after looking through the code for a while i found out that the module was using file_scan_directory which in drupal 6.x still uses case-sensitive regexp, so my file wasn't listed since the regexp used in the file_scan_directory call was only using lower case letters as the file extensions". Therefore i suggest the function user_badges_image_selects() in user_badges.module be changed to:

<?php
function user_badges_image_selects() {
 
$selects = array();
 
$dir = file_create_path('badges');
 
$files = file_scan_directory($dir, ".*\.(((J|j)(p|P)(g|G))|((p|P)(n|N)(g|G))|((g|G)(i|I)(f|F)))", array('.', '..', 'CVS'), 0, FALSE);

  foreach (
$files as $file) {
   
$selects[$file->filename] = theme('image', $file->filename, $file->filename, $file->filename);
  }

  return
$selects;
}
?>

i know the regexp looks horrible, but it does the job.
so, the above code fixed my problem, as for yours, venusrising, well, i am also using the latest stable user-points with Rules module and user badges, and i have no problems whatsoever. You should post a more detailed description of your problem, like what modules are you using(including versions) and how to replicate this bug, step by step.
Good luck.

#2

venusrising - January 28, 2009 - 23:14

Thanks for the reply zadirion but the issue I am having is not the same.
We are using user badges 6x-1.4
user points contributed modules
and userpoints.
When uploading the images via the user badge Images upload without incident. The issue arises when we try go to EDIT USER BADGES so we can add the:
name
point requirement
url link to info page
weight etc.
The module will only save One badge (we have 5 we would like to create) and when you try to add another badge nothing happens except for the error
"There was a problem saving the badge information into the database." What we did notice is that the badge that is created will take on the NEW point value of the one we try to create after it i.e. badge created WHITE value 100 then try to create badge BLACK value 1000 what will happen is you will not visually see a change UNTIL you open the White badge and it ow has a value of 1000. Weird?

#3

zadirion - January 30, 2009 - 07:06

well, i am using the same version of userbadges as you are, 6.x-1.4
I am also using Userpoints 6.x-1.0.
But i can create as many badges as i want to. It might be an installation-related problem, so my suggestion would be to uninstall user badges and other modules related to it. but do it using the 'Uninstall' interface on the modules page, not just by simply deleting the folder.
Then install the same modules i have.
It should work, in theory at least.

#4

venusrising - January 30, 2009 - 20:40

I will give that a shot and let you know! Thanks for the feedback zadirion

#5

venusrising - February 1, 2009 - 03:05
Status:active» closed

zadirion
Thanks for the info, that did the trick. I uninstalled the badges module and the user_badges from the contributed module via the uninstall button, re-installed and voila' it works great.

Thanks so much

#6

venusrising - February 14, 2009 - 03:00
Status:closed» postponed (maintainer needs more info)

zadirion
Did you figure out how to get the user points badge module to prmote the user to another level automatically when they achieve a specified number of points?

#7

venusrising - February 22, 2009 - 04:20
Status:postponed (maintainer needs more info)» fixed

http://drupal.org/node/367613#comment-1277332

#8

System Message - March 8, 2009 - 04:30
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

#9

Nuno Veloso - March 13, 2009 - 12:39
Status:closed» fixed

Hello! Sorry for being away but I have been very very busy lately.

This issue is fixed on dev version of Drupal 6 release.

Thank you.

#10

System Message - March 27, 2009 - 12:40
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.