This error message has been diplayed:

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'nid' at row 1: INSERT INTO {sgrid} (nid, rank, view_display) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => component_map_page ) in sgrid_view_sgrid_form_submit() (line 73 of /Applications/MAMP/htdocs/map drupal-7.14/sites/all/modules/sgrid/sgrid.module).

Moving elements around works, logged in as admin user #1.
Drupal 7.14

Cheers
Rolf

Comments

Countzero’s picture

Assigned: Unassigned » Countzero
Priority: Major » Normal
Status: Active » Needs work

You probably tried to save without reordering anything first.

It's a known bug : I'll try to commit a fix these days.

jpshayes’s picture

I am getting the same error. I am reordering before saving

Using Views 7.x-3.3 and the S Grid module released on May 12th.

TimVS’s picture

I am also getting this error,
after reordering.

TimVS’s picture

I did some debugging and found the following,

The js needs a this element:
<span class="sgrid-nid">{your nid}</span>

When you add it manualy in the view, everythung works, but this isn`t the way to go.

After a littlebit of digging if found that the views_view_row_sgrid_style.tpl.php file isn`t called.
I`m trying to debug this, but i`m new to Drupal so it is hard to find

So maybe anyone else has some sugestions why these file isn`t called?

Tim VS

Countzero’s picture

Well, sorry guys, I've been very busy these days. Will try to pay this issue some attention ASAP.

Edit : there is indeed something wrong with the template file for the row. Investigating this right now.

Edit 2 : Solved this error but I stumbled on another one, probably related. Not sure the fix will come today.

Countzero’s picture

Status: Needs work » Needs review

Should be solved in latest commit.

stan turyn’s picture

Status: Needs review » Active

Still the same error on save.

iaminawe’s picture

I am also still receiving the same error with the latest dev.

Countzero’s picture

Sorry to ask this, but did you guys cleared your caches, including Views' ?

Countzero’s picture

Status: Active » Postponed (maintainer needs more info)

Could you tell me if things got better after cache clearing ?

obisean’s picture

I'm using the latest dev and still get this error after clearing all caches

Countzero’s picture

Status: Postponed (maintainer needs more info) » Active

Something I forgot to ask you : did you corrrectly set the Row Style to "Sgrid style" ?

I really mean the ROW style, not the view style. It would explain why the row template is not called, and is a frequent mistake.

obisean’s picture

Sorry for the delayed response I did explicitly set the Sgrid Style row, but I still get this error on save:

PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'nid' at row 1: INSERT INTO {sgrid} (nid, rank, view_display) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => 0 [:db_insert_placeholder_2] => yarn_color_cards_admin_page ) in sgrid_view_sgrid_form_submit() (line 73 of /mnt/www/html/pycdev/docroot/sites/all/modules/sgrid/sgrid.module).

obisean’s picture

I just realized this might be because this is a view of commerce products. Could that possibly be the issue? The grid sort criteria is not showing up at all in this view. However, it appears in regular content views.

Countzero’s picture

Status: Active » Needs work

Yes, it's probably the issue.

Explanation : Commerce is heavily Entity based, and Sgrid assumes too much about the content being nodes.

Entities have entity ids, nodes have nids. Bottomline : Sgrid should adapt its behaviour depending on what kind of objects are managed by the view.

I'm working on heavy code changes these days. I'll try to correct this behaviour also.

Thanks for your feedback and puting me on the right track.

obisean’s picture

Thanks for all your hardwork, this is an amazing module. Borrowing heavily from draggableviews hook_views_data_alter implementation, I managed to get this module working with all entities (commerce products included). I'll submit a patch this evening if you would like. I'm very new to drupal (only a couple weeks in) so you may need to tidy up the code a bit.

Countzero’s picture

Status: Needs work » Needs review

Sorry : I forgot to update this issue. I commited something this morning (european time) which could solve the problem. Would you be kind enough to test it ?

And BTW, thanks for your interest. I'll review your patch with pleasure.

obisean’s picture

I tried out your most recent commit. Unfortunately, it still did not work with the commerce product view. However sortable grids does seem to work with commerce product views using the attached patch; which associates all entity types with the sortable grid. Again, I'm very new to Drupal so this may not be the best way, but it works for me. Thanks again for the great module

i-dont-use-this-account’s picture

#12 fixed my issue. Didn't even know there was a row style.

I noticed all the ids of sgrid_item_ weren't receiving values.