Gossamer Forum
Home : Products : Links 2.0 : Customization :

Modification of Error message & modification form

Quote Reply
Modification of Error message & modification form
(using Links 2.0)

Hi, I tried to search the forum for this info but I couldn't find any. I'd really appreciate help on this.

1)Could you tell me what file the error messages are in? I made some changes (ok, a lot of changes) to my add form, and so I want the error messages to be consistent.

2)When modifying a resource, the URL is used to identify the link to change, right? Is it possible to change this so that it's the Title that is used to identify the link for change?

Thanks so much. Smile
Quote Reply
Re: Modification of Error message & modification form In reply to
I thought when you modify an url, without all the security mods, the link was identified by its ID number.

------------------
-----------------
Lavon Russell
LookHard! Search
www.lh.yi.org
webmaster@lh.yi.org


Quote Reply
Re: Modification of Error message & modification form In reply to
Bmxer,

Quote:
I thought when you modify an url, without all the security mods, the link was identified by its ID number.

No, the default script requires the URL to be entered, and then all the changes. The modify.cgi script will search for a URL match.

Gin,

Quote:
1)Could you tell me what file the error messages are in? I made some changes (ok, a lot of changes) to my add form, and so I want the error messages to be consistent.

All the error messages are contained in add.cgi, sub process_form. They are contained inside the calls to &site_html_add_failure

Quote:
2)When modifying a resource, the URL is used to identify the link to change, right? Is it possible to change this so that it's the Title that is used to identify the link for change?

Change the add form to ask for the Title instead of the URL. If using templates, the code is in modify.html. If not using templates, look in sub site_html_modify_form of site_html.pl. In both cases, the code looks like this:

Quote:
<p>Please enter the URL of the link you wish to update. Make sure it is identical to the one already in the database:</p>
<div class="margin"><input name="Current URL" size="30"></div>

Change it to read:

Quote:
<p>Please enter the Title of the link you wish to update. Make sure it is identical to the one already in the database:</p>
<div class="margin"><input name="Current Title" size="30"></div>

Then, in modify.cgi, sub process_form, change:

Quote:
# Make sure we have a link to modify.
!$in{'Current URL'} and &site_html_modify_failure ("did not specify link to modify") and return;

to read:

Quote:
# Make sure we have a link to modify.
!$in{'Current Title'} and &site_html_modify_failure ("did not specify link to modify") and return;

Then change:

Quote:
if ($data[$db_url] eq $in{'Current URL'}) {

to read:

Quote:
if ($data[$db_title] eq $in{'Current Title'}) {

I hope this helps.
Quote Reply
Re: Modification of Error message & modification form In reply to
Hi Bobsie, I managed to make the above modifications, but it doesn't seem to work. I get an error message:

Title (cannot be left blank)

despite the fact that it isn't blank. Also, I think I failed to identify exactly which errors I was refering to. I actually meant the <%error%> that appear in the add_error.html and modify_error.html. i can't find anything of the sort in add.cgi

Thanks
Quote Reply
Re: Modification of Error message & modification form In reply to
If you mean that I should make sure I typed in the title in the empty space as well, yes I did that too, and it is identical with the existing title.

As for the &site_html_add_failure, one says
($status), the other (Auto submission is not allowed in this directory. Please visit the site to add your entry.) and that is it. There aren't any other calls in the add.cgi.

I was actually looking for the "Email (Invalid format)" or "URL (Can not be left blank)" error messages. I hope that clarifies my meaning.
Quote Reply
Re: Modification of Error message & modification form In reply to
I think what your looking for is in either db.pl or db_utils.pl. Run a search for a few phrases.

------------------
-----------------
Lavon Russell
LookHard! Search
www.lh.yi.org
webmaster@lh.yi.org


Quote Reply
Re: Modification of Error message & modification form In reply to
Gin,

That error about the title may not be referring to the title you are searching for but, rather, for the title you put below in the modified record. Both titles need to be there.

In add.cgi, look for &site_html_add_failure calls. In modify.cgi, look for &site_html_modify_failure calls. In both cases, the error message will be inside parenthesis immediately following the calls. There are a number of those calls in each script.

[This message has been edited by Bobsie (edited August 29, 1999).]
Quote Reply
Re: Modification of Error message & modification form In reply to
Thanks for the reminder, Bmxer. The error messages are in sub validate_record of db_utils.pl. That subroutine is called by add.cgi and modify.cgi and the error messages, if any, are returned as a <ul> list by that subroutine. The add.cgi/modify.cgi check to see if "ok" is returned and, if not, they know there is an error.