Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Suggestion: Adding Link - error_loop tag

Quote Reply
Suggestion: Adding Link - error_loop tag
I have different areas in my LSQL setup, with different kinds of links, and they have different fields which are required. Obviously, I cannot set the fields as not null, since sometimes they are allowed to be empty.

Anyway, I can make a hook on "user_add_link" to check the validity of certain fields, that's all fine. The problem is that I cannot add anything to the "error" tag (well, I could, but it would be awkward). It would be very handy to have a error_loop tag available, then I could just push my own errors into the error_loop tag.

By the way, there is a "bug" in sub add_link in Links/User/Add.pm. There are two <ul></ul> tags around possible errors, one would be enough I think....

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Suggestion: Adding Link - error_loop tag In reply to
You can add to the error tag with:

return { error => 'Bla Bla' };

...I've used this before if I remember rightly.
Quote Reply
Re: [Paul] Suggestion: Adding Link - error_loop tag In reply to
The problem with this is that the error tag is formatted, something like

<ul><li>my error </ul>

So I can't just add to it.

What I came up with is the following: I have a pre hook on "user_add_link", where I do some checks on the data integrity. If we have an error, it will not continue to the main code, and display this error. If everything is fine, it continues, and maybe there are errors from the main code.

The only disadvantage is that it doesn't show all errors at a time, users first have to correct the "custom errors" (i.e. the ones I check for), and only then do they see possible "general errors". Does that make sense?

Thanks for your input anyway.

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] Suggestion: Adding Link - error_loop tag In reply to
Yogi, there are still many hard coded things in LSQL.
If the formatting would be not hard coded, but it would be changeable in the config, then everything would be much easier...

There are many similar hardcoded formatting problems in LSQL, which should be corrected as possible.

I don't know, what the GT staff & Alex is working nowadays, but they seems very busy. I don't see too often Alex on the forum nowadays, nor I did not answered any support e-mails in last few weeks...

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...