Why does tasklist modify the book table ?

scor - March 16, 2007 - 23:45
Project:Tasklist
Version:5.x-1.0
Component:Code
Category:bug report
Priority:critical
Assigned:add1sun
Status:closed
Description

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 ?

#1

moonray - March 19, 2007 - 15:02

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

scor - March 19, 2007 - 19:51

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

#3

add1sun - April 8, 2007 - 19:28
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

BryanPflug - April 8, 2007 - 21:58

subscribing

#5

add1sun - April 8, 2007 - 23:52
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

DanielTheViking - May 5, 2007 - 16:47

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

moonray - May 6, 2007 - 00:21

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

#8

scor - June 7, 2007 - 22:47

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

scor - June 19, 2007 - 06:02

patch commited to HEAD.

#10

scor - June 19, 2007 - 06:02
Status:needs review» fixed

patch commited to HEAD.

#11

Anonymous - July 3, 2007 - 06:15
Status:fixed» closed
 
 

Drupal is a registered trademark of Dries Buytaert.