[prev in list] [next in list] [prev in thread] [next in thread]
List: bricolage-devel
Subject: [Bricolage-Devel] Problem with deleted categories
From: Matt Vella <mvella () about-inc ! com>
Date: 2002-10-28 21:06:06
[Download RAW message or body]
Problem (from our QA Dept):
If you delete a category and create another one that is spelled the same but
has a different case, then the preview will be in the old category not the new
one.
to reproduce:
1) create a category called "TEST"
2) create a cover story type in that category, then preview it,then save it.
example: http://preview.motortrend.com/TEST//index.html
3) delete the story
4) delete the category "TEST"
5) create category "test"
6) create a cover story type in that category, then preview it
The preview page will pull in the old "TEST" category story:
http://preview.motortrend.com/TEST//index.html
------------------------------------------------------------------------------------------------------------------
Source of this problem:
1. From Bric::Util::Burner::Mason and Bric::Util::Burner::Template -
# Create a resource for the distribution stuff.
my $res = Bric::Dist::Resource->lookup({ path => $file}) ||
Bric::Dist::Resource->new({ path => $file,
uri => $uri});
2. From Bric::Dist::Resource ($get_em sub, used by lookup)-
elsif ($k eq 'path' || $k eq 'uri') {
# A text comparison.
push @wheres, "LOWER($k) LIKE ?";
push @params, lc $v;
}
3. Unique index in database:
Index "udx_resource__path"
Column | Type
--------+------
lower | text
unique btree
If you look at the above 3 things together, it becomes apparent
case-insensitivity (and the fact that bricolage never erases anything
from the db) is the root of the problem.
It seems to me that if LOWER and lc were not used in #2, there would not
be a problem, EXCEPT for the fact that there is a case-insensitve unique
index on 'path' in the resource table.
This problem is quite a tangle.
Would it be possible to solve this by altering #2 (getting rid of lc and
LOWER) and changing the index in #3 to case-sensitive?
Thanks,
Matt
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Bricolage-Devel mailing list
Bricolage-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bricolage-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic