I am having the following error upon saving a weight changer view:
PDOException: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'sticky' at row 1: INSERT INTO {taxonomy_index} (nid, tid, sticky, created) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => 491 [:db_insert_placeholder_1] => 67 [:db_insert_placeholder_2] => 149 [:db_insert_placeholder_3] => 1277485208 ) in taxonomy_field_update() (line 1754 of /home/public_html/modules/taxonomy/taxonomy.module).

I am using a range of 50 and show weights has the weights to be saved starting at -50.

Comments

davisben’s picture

Could you export your view, use a service like pastebin, and post the link to it here? I'm not sure why it's trying to change the taxonomy_index table. For reference, this module will only work with nodes, not taxonomy terms.

davisben’s picture

Status: Active » Postponed (maintainer needs more info)
gabriel.camby’s picture

Status: Postponed (maintainer needs more info) » Active

Hello there,

I'm having the same error with weight module when saving a content (no view or anything).
I'm using the -90 to 90 weight scale: saving a weight of -90 to 28 is OK.
Weight values over 28 shows the same SQL error than Ron Williams'.

This PDO error is caused by the taxonomy_index sticky column: it can't store a value of -129 (or -130, ... -190) using its tinyint type (127 to -128).

The insert in the taxonomy_index table is triggered by the content type: it is using a taxonomy term reference field.
Removing the reference term field saves the weight OK.

Having a global view of the module should help solve this. I'm afraid I haven't at all.
Can any maintainer check it out?

Thanks!

davisben’s picture

OK, maybe I've been looking at this too long and am missing something simple, but I've seem to hit a wall with this one. @g4be did a good job explaining the issue. The sticky field is encoded into the node weight using hook_node_presave. When node_save is called, that encoded sticky value is inserted into the node table, but the taxonomy_index table also uses that same sticky value. The issue is that the sticky field in taxonomy_index is a tinyint, and can't hold the encoded value, if the weight is too high.

davisben’s picture

Status: Active » Fixed

I ran across the handy function db_change_field() which solves this issue. The update has been committed to 7.x-1.x. Don't forget to run update.php!

Status: Fixed » Closed (fixed)

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