Ticket #1352 (assigned defect)

Opened 11 months ago

Last modified 7 months ago

Categories management is erroneous after fresh install

Reported by: lakiboy Assigned to: demian (accepted)
Priority: normal Milestone: 0.6.3
Component: SGL - Category Severity: open
Keywords: Cc:


categories_fix_rev2796.diff (2.5 kB) - added by lakiboy on 12/15/06 11:21:11.

Change History

12/15/06 11:21:11 changed by lakiboy

  • attachment categories_fix_rev2796.diff added.

12/15/06 11:33:50 changed by lakiboy

When I install the publisher module and start working with categories i always get some errors. Here is the explaination:

  • it is impossible to delete PublisherRoot -> example category, 'cos there is a sample article, which references to example category. IMO we can just correct a constraint a bit, i.e. SET NULL for item if it's category was deleted
    alter table item add constraint FK_category_item foreign key (category_id)
          references category (category_id) on delete set null on update restrict;
  • when installing publisher without sample data, data.default.my.sql creates PublisherRoot with left_id = 1 and right_id = 4, which is wrong, right_id should be 2, not 4,
  • when installing with sample data, we should first drop PublisherRoot and re-create it with right_id as 4, 'cos child will be created,
  • finally, constraint
    alter table category add constraint FK_parent foreign key (parent_id)
          references category (category_id) on delete restrict on update restrict;
    is weird, 'cos parent_id for root categories is zero and there is no record with category_id = 0, moreover unless you removed it, i got errors while removing some records.

02/20/07 03:34:41 changed by lakiboy

(18:04:00) demianturner: if it's true with cms, it's worth it

Ok. I compared what we have in cms and in publisher. In cms we don't have errors, because:

  • there is no constraint, which references category_id (from another table) i.e. we can delete any node without problems,
  • data.default.my.sql has left_id = 1 and right_id = 2, exactly as i was suggested to do for publisher,
  • sample data is the same, but it seems on first update root node gains correct left_id and right_id,
  • finally, there is no constraint on parent_id, as you can read above, i suggested to remove it for publisher too.

04/11/07 16:52:02 changed by demian

  • status changed from new to assigned.
  • milestone changed from 0.6.2 to 0.6.3.