Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Moving categorie into child of itself

Quote Reply
Moving categorie into child of itself
Hello,

In Browser.pm on line 665 you will see the following code snippet:

# finally check that category_to ain't a category_from descendant
my $from_full_name = $info_from->{Full_Name};
my $to_full_name = $info_to->{Full_Name};
if ($to_full_name =~ m,^\Q$from_full_name\E/,) {
return $self->javascript_error ( message => Links::language ('BROWSER_MOVECHILD'), tree_go => -1, info_go => -1 );
}

this disabled that you can move a category to a child of itself.

But i can do this without error message in the normal admin.

my question is:
Is this a known issue, or is there a code snippet for it to copy in a module (I think Links::category.pm) ??
Quote Reply
Re: [ridesworld] Moving categorie into child of itself In reply to
I've tested this on my local computer & you've right.

When you build, it will repair the normal structure, but the links in the damaged category are gone, until you modify the category again & place it in a normal order.
Quote Reply
Re: [ericho] Moving categorie into child of itself In reply to
Hello

Yes it will repair the structure as good as it can, but this it not normal.

is their anybody who have a piece of code to paste in Links::Category.pm which report an error message if you modify a category in a child of itself?
Quote Reply
Re: [ridesworld] Moving categorie into child of itself In reply to
Hello

I found a piece of code in the header of Links::Category.pm that should give a warn, but this code is never used

the code is:

'CORRUPTCAT' => "Loop detected! Category ID %s is a subcategory of itself!",


I think this is a part of former links-SQL distributions.
Does anybody have pieces of code that uses CORRUPTCAT, and why it's removed in the current versions??