Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-08-09 21:37:38

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

r1674 - category oddities (part two)

Note that this is not something unique to r1661, but that’s the one I’m testing now.

<del>It is possible to create a duplicate category name (not when you create a new one, but when you change the category):
1. create a new category with a unique name
2. click that category
3. rename it to an already existing name -> no error, duplicate category name.</del>

fixed in r1663

——-

<del>Textile (?) is used on the category name and title, giving unexpected results:
1. create a category: <notextile><code>-foo-</code></notextile>
2. click category: name = <notextile><code>delfoodel</code></notextile>, title = <notextile><code>-foo-</code></notextile>
3. save again (without changing anything)
4. category title is now <code><del>foo</del></code>, name is still <code>delfoodel</code></del>

<del>I’d expected both name and title to stay <notextile><code>-foo-</code></notextile>.</del>

fixed in r1663

——-

<del>Subcategories are no longer indented:
1. create a new category
2. click category
3. change parent to any of the other categories and save</del>

<del>In 4.0.3, this (now sub)category would be indented, but in this revision it is not.</del>
<del>Nor is it indented in any of the category select/pulldown menus (for example in articles).</del>

<del>However, this is only happening for the first level of subcategories, because the second level and higher levels of subcategorisation are shown indented.</del>

fixed in r1673 (partially in r1664)

Last edited by ruud (2006-08-12 13:44:15)

Offline

#2 2006-08-10 16:11:38

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: r1674 - category oddities (part two)

<del>Most of it is fixed in the current revision r1667, but the indenting of subcategories is still not working in the select/pulldown menu’s. Looking at the way indentation was fixed in r1664, I think the problem lies in /textpattern/lib/txplib_forms.php in the function treeSelectInput, line 108:

<del>I think this:
<code>$sp = ($level > 0) ? str_repeat(sp.sp, $level – 1) : ‘’;</code></del>

<del>Should be:
<code>$sp = str_repeat(sp.sp, $level);</code></del>

fixed in r1673

Last edited by ruud (2006-08-12 12:24:35)

Offline

#3 2006-08-10 17:52:21

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: r1674 - category oddities (part two)

Some other things I just noticed while playing with categories:

——-

<del>You can set the parent to one of the children (subcategories) of the current category, creating a loop in the category tree. This can mess up indentation, but more importantly, it can corrupt the txp_category table. When you remove the wrong category in this situation, some of the other categories are then no longer visible (while still in the txp_category table!)… and when removing one of the remaining categories, the invisible categories can become visible again. This is hard to reproduce, because it seems to depend on the order in which you create categories and create parent-child relations. I do have an example of a different effect:
1. create in this order the categories called: a, b, c, d, e, f
2. set d as parent for e
3. set b as parent for c
4. set e as parent for b
5. set c as parent for d (creating a category loop) -> category c is now invisible, but still lives in the txp_category table
6. even if you remove all the remaining categories, category c stays hidden, while exisiting in txp_category</del>

fixed in r1674

——-

<del>You can set the parent to the currently edited category (the category is then its own parent). This makes the appear to be a subcategory, probably because no longer has ‘root’ as the parent category.
This is a miniature version of the example I gave above.</del>

fixed in r1674

——-

<del>Removing a category which has subcategories, does not change the parent of those subcategories. The parent of those subcategories is then a non-existing category. In some cases the entire branch of categories is gone. To reproduce:
1. create categories a, b, c, d, e, f
2. set c as parent for b
3. set b as parent fo a
4. set d as parent for e
5. set e as parent for f
6. remove both categories c and d simultaneously (leaving no categories with ‘root’ as parent)
7. all categories are gone, but txp_category still shows a, b, e and f</del>

fixed in r1698

——-

When removing a category, it is not removed from articles which have this category set. The same thing occurs when removing a link category, probably also for links and images. Confusing.

Last edited by ruud (2006-08-15 07:17:02)

Offline

#4 2006-08-12 00:33:45

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: r1674 - category oddities (part two)

r1674 fixes some of these issues. Select lists should be properly indented, and you can’t set the parent category to itself or a child.


Alex

Offline

#5 2006-08-12 12:55:18

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: r1674 - category oddities (part two)

Great work. Thanks!

Indenting works fine now.

The circular parent references are much harder to create now, but are still possible if two users are working in the categories tab at the same time:
  1. user-1: clicks a category and see the category parents that are possible at that moment
  2. user-2: changes something in the category tree… or removes a category
  3. user-1: still sees the old list of possible category parents and can create a circular parent reference or set a no longer existing category as parent (which can corrupt txp_category).

Chances of that happening are of course much smaller.

Offline

Board footer

Powered by FluxBB