biblio_save_node() creates a new node when it imports a biblio item and later saves it with node_save(). It fails however to set some of the node object with the proper type (promote, moderate, sticky, status) which causes some nasty behavior upon saving. For example when importing a biblio node with some taxonomy terms, you might get SQLSTATE[HY000]: General error: 1366 Incorrect integer 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); because sticky is not set.

CommentFileSizeAuthor
#1 972312_1_bibliocast.patch1.15 KBscor
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

scor’s picture

Status: Active » Needs review
FileSize
1.15 KB
scor’s picture

Status: Needs review » Fixed

Fixed this with http://drupal.org/cvs?commit=451334

In the long run it would be probably cleaner to call node_object_prepare() which would saves us a few lines of code in biblio_save_node() and avoid duplicating that logic.

scor’s picture

Status: Fixed » Needs work

setting to needs work to evaluate the node_object_prepare() approach.

scor’s picture

Priority: Normal » Major

marked #952354: Biblio node_options do not follow core definitions as duplicate:

Biblio nodes are posted as unpublished by default. In fact it seems biblio unsets the default node_options value. On node/add/biblio (after selecting a type), the publishing options (published, promoted, sticky) are all unset.
rjerome’s picture

Status: Needs work » Fixed

I've implemented node_object_prepare in biblio_save_node()

http://drupalcode.org/project/biblio.git/commit/9d8f096

Ron.

Status: Fixed » Closed (fixed)

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