Download & Extend

Why does tasklist modify the book table ?

Project:Tasklist
Version:5.x-1.0
Component:Code
Category:bug report
Priority:critical
Assigned:add1sun
Status:closed (fixed)

Issue Summary

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 ?

Comments

#1

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.

#2

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

#3

Assigned to:Anonymous» 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.

#4

subscribing

#5

Status:active» needs review

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.

AttachmentSize
tasks_parent_rename.patch 8.2 KB

#6

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?

#7

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

#8

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.

#9

patch commited to HEAD.

#10

Status:needs review» fixed

patch commited to HEAD.

#11

Status:fixed» closed (fixed)