When trying to add a new badge (Badge1) I get 2 errors:

Notice: Undefined property: stdClass::$bid in user_badges_edit_form_submit() (line 367 of /***/sites/all/modules/user_badges/user_badges.admin.inc).

PDOException: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1: INSERT INTO {user_badges_badges} (bid, name) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1_0, :db_insert_placeholder_1_image, :db_insert_placeholder_1_weight, :db_insert_placeholder_1_href, :db_insert_placeholder_1_unhideable, :db_insert_placeholder_1_fixedweight, :db_insert_placeholder_1_doesnotcounttolimit, :db_insert_placeholder_1_tid); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1_0] => Badge1 [:db_insert_placeholder_1_image] => public://Badge Icon 16x16.jpg [:db_insert_placeholder_1_weight] => 0 [:db_insert_placeholder_1_href] => [:db_insert_placeholder_1_unhideable] => 0 [:db_insert_placeholder_1_fixedweight] => 0 [:db_insert_placeholder_1_doesnotcounttolimit] => 0 [:db_insert_placeholder_1_tid] => ) in user_badges_edit_form_submit() (line 378 of /***/sites/all/modules/user_badges/user_badges.admin.inc).

Environment: Drupal 7.8

CommentFileSizeAuthor
#7 1279532.patch2 KBnancydru

Comments

Refineo’s picture

I also got a list of warnings right after the first issue when I reloaded admin/user/user_badges/add.
the same list of warnings on admin/user/user_badges:

    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in _form_set_class() (line 3993 of /***/includes/form.inc).
    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in _form_set_class() (line 3993 of /***/includes/form.inc).
    Warning: implode() [function.implode]: Invalid arguments passed in theme_radios() (line 2728 of /***/includes/form.inc).
    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in _form_set_class() (line 3993 of /***/includes/form.inc).
    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in _form_set_class() (line 3993 of /***/includes/form.inc).
    Warning: implode() [function.implode]: Invalid arguments passed in theme_radios() (line 2728 of /***/includes/form.inc).
    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in _form_set_class() (line 3993 of /***/includes/form.inc).
    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in _form_set_class() (line 3993 of /***/includes/form.inc).
    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in _form_set_class() (line 3993 of /***/includes/form.inc).
    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in _form_set_class() (line 3993 of /***/includes/form.inc).
    Warning: array_merge() [function.array-merge]: Argument #1 is not an array in _form_set_class() (line 3993 of /***/includes/form.inc).
    Warning: implode() [function.implode]: Invalid arguments passed in theme_radios() (line 2728 of /***/includes/form.inc).
Miria’s picture

I also get these errors (after uploading badge images with seemingly no problem) when trying to "Add" a badge.

Notice: Undefined property: stdClass::$bid in user_badges_edit_form_submit() (line 367 of /misc/33/341/964/930/2/user/web/. . ./sites/all/modules/user_badges/user_badges.admin.inc).

PDOException: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1: INSERT INTO {user_badges_badges} (bid, name) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1_0, :db_insert_placeholder_1_image, :db_insert_placeholder_1_weight, :db_insert_placeholder_1_href, :db_insert_placeholder_1_unhideable, :db_insert_placeholder_1_fixedweight, :db_insert_placeholder_1_doesnotcounttolimit, :db_insert_placeholder_1_tid); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1_0] => Test1 [:db_insert_placeholder_1_image] => public://test1-badge.png [:db_insert_placeholder_1_weight] => 10 [:db_insert_placeholder_1_href] => test1 [:db_insert_placeholder_1_unhideable] => 1 [:db_insert_placeholder_1_fixedweight] => 1 [:db_insert_placeholder_1_doesnotcounttolimit] => 0 [:db_insert_placeholder_1_tid] => ) in user_badges_edit_form_submit() (line 378 of /misc/33/341/964/930/2/user/web/. . ./sites/all/modules/user_badges/user_badges.admin.inc).
Road Kill’s picture

Title: Cannot add a new badge (admin/user/user_badges/add) » PDOException: SQLSTATE[21S01]:
Priority: Normal » Critical

Hi great module the upload works fine but if you try to use the add function and submit I get The website encountered an unexpected error. Please try again later. If I go into the watchdog I see this error.

PDOException: SQLSTATE[21S01]: Insert value list does not match column list: 1136 Column count doesn't match value count at row 1: INSERT INTO {user_badges_badges} (bid, name) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1_0, :db_insert_placeholder_1_image, :db_insert_placeholder_1_weight, :db_insert_placeholder_1_href, :db_insert_placeholder_1_unhideable, :db_insert_placeholder_1_fixedweight, :db_insert_placeholder_1_doesnotcounttolimit, :db_insert_placeholder_1_tid); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1_0] => Blogger [:db_insert_placeholder_1_image] => public://blogger-icon.png [:db_insert_placeholder_1_weight] => 0 [:db_insert_placeholder_1_href] => [:db_insert_placeholder_1_unhideable] => 1 [:db_insert_placeholder_1_fixedweight] => 0 [:db_insert_placeholder_1_doesnotcounttolimit] => 0 [:db_insert_placeholder_1_tid] => ) in user_badges_edit_form_submit() (line 378 of /var/www/vhosts/spice4life.co.za/httpdocs/sites/all/modules/user_badges/user_badges.admin.inc).

Road Kill’s picture

Hello anybody work here.

Miria’s picture

No one else is using 7.x-1.x-dev and/or having this issue? Hope more people can test to help maintainer(s) resolve this error soon.

Spitfire’s picture

I'm getting same error when trying to add new badge. What values needs to be in DB for it to work? To see if it can be done manually

nancydru’s picture

Priority: Critical » Major
Status: Active » Needs review
StatusFileSize
new2 KB

This patch should fix it.

Caution: use this module in a test environment only, and don't get carried away. I think the images are not being uploaded as permanent files, so they will be deleted overnight.

Also, this patch is based on the code from #1304520: Coder finds.

Refineo’s picture

Status: Needs review » Reviewed & tested by the community

I applied #1306032: Cumulative D7 Changes and adding new badge works now. Issue solved. Thank you !

nancydru’s picture

Great, thanks.

nancydru’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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