Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Possible bug in modify.cgi

Quote Reply
Possible bug in modify.cgi
I just noticed this odd and rather destructive behavior in modify.cgi

If a user modifies a link that is allocated in more than one category, it is then removed from all categories except the category in which the user invokes modify.cgi.

GT people: is there a fix for this please? We can't use modify.cgi while it has this bug in it.
Quote Reply
Re: [YoYoYoYo] Possible bug in modify.cgi In reply to
One possible solution might be to replace
Code:
$category = "$name <input type=hidden name='CatLinks.CategoryID' value='$id'>";
with just
Code:
$category = "$name ";
in Modify.pm, sub _category_list -- iff there are no side-effects elsewhere.

It results in an error: You did not specify a category for this link.

However, we don't want users to specify a category at this stage (we will add an extra column for users' suggestions and comments), so that is not an error for us. Can we bypass this error?

Quote Reply
Re: [YoYoYoYo] Possible bug in modify.cgi In reply to
An unsatisfactory workaround is to set user_direct_mod = No.
It doesn't remove the error -- just prevents it from occurring, and limits what users can do.
Quote Reply
Re: [YoYoYoYo] Possible bug in modify.cgi In reply to
hello

modify.pm needs always the
<input type=hidden name='CatLinks.CategoryID' value='$id'>";

because the script specifies the category of the link.

this is a different table.
you always need this, if you remove this, you make it impossivble to add a link in a category.

Quote Reply
Re: [ridesworld] Possible bug in modify.cgi In reply to
> you make it impossivble to add a link in a category

But the link is already in a category -- this is modify.cgi, not add.cgi.

We don't need the user to do something that has already been done. We want to prevent the user from destroying something that has already been done.

Quote Reply
Re: [YoYoYoYo] Possible bug in modify.cgi In reply to
Hello

I know what you mean, but if you wish to change category, you should use the
'CatLinks.CategoryID' to specify the new category.

Quote Reply
Re: [ridesworld] Possible bug in modify.cgi In reply to
I don't want to change the category. I want to keep the categories as they are.

Our users should not have the option of changing the category for the link, or adding a new category -- just the URL, title, description.

What happens now in modify.cgi is if a user changes anything, the categories get invisibly destroyed. It happens because there is a hidden input field for CatLinks.CategoryID.

But if we remove the hidden input field, we get an error message telling us we have not specified a value which already exists in the database, and which we do not want to be changed.