I was trying to sort my tasks on a drupal5 website, and I saw appearing the same structure as a book at the bottom of my tasklist. It was also inconsistant, the only links appearing being the one of the tasks I just modifyed. So I looked at the SQL queries log appearing after editing a task, and found out a strange query in the book table:

UPDATE tasks SET order_by = 1 WHERE nid = 3
UPDATE book SET parent = 2, weight = 0 WHERE vid = 3

There are also many queries in the book table when displaying the tasklist.

A bit further, if I check the 'create revision' box, I see

INSERT INTO book (nid, vid, parent, weight) VALUES (3, 4, 2, 0)

so for each revisions there is a new record in the book table.
comparatively, when I create/edit/revise a page, there is no insert/update of the book table.

I find it weird that the tasklist module has to mess up with the book table. Is that normal ?

CommentFileSizeAuthor
#5 tasks_parent_rename.patch8.2 KBadd1sun

Comments

moonray’s picture

I remember there being a similar bug with the project module a while back. The issue is with the parent attribute. Whenever book module finds a parent attribute, it assumes the node wants to be a book page, and the hooks get activated.

A patch needs to be written to change all references to parent to something else, for example: parent_task.

scor’s picture

yes that's true, I've already posted a patch for that: http://drupal.org/node/128798

add1sun’s picture

Assigned: Unassigned » add1sun

I'm working on a patch for this changing references to parent into task_parent. Includes a db update as well to rename the parent field in the table. I hope to test and post a patch tonight or tomorrow.

bryanpflug’s picture

subscribing

add1sun’s picture

Status: Active » Needs review
StatusFileSize
new8.2 KB

OK, this seems to be working for me but I haven't really tested it heavily so please report back. I don't have this running anywhere with book module so I just did a few runs on a test site. Also note patch is against HEAD but it will apply with offset on 5.x-1.0. This has a DB upgrade so make sure you run update.php.

Leeteq’s picture

I am about to test this module with Drupal 4.7.6.

Is this bug also relevant for v4.7.x or only for v5?

moonray’s picture

Both. I haven't gotten around to implementing the patch (sorry). Will get to it as soon as I have some spare time.

scor’s picture

Thanks add1sun for this patch. It's working great for me.

Please, can the patch be commited soon so that we can move on with the other issues. I posted patches today, I don't mind remaking the few that might be concerned by this change in the node structure. The 5.x-1.0 tasklist module still has some cumbersome issues that I'd like to work on asap.

Thanks.

scor’s picture

patch commited to HEAD.

scor’s picture

Status: Needs review » Fixed

patch commited to HEAD.

Anonymous’s picture

Status: Fixed » Closed (fixed)