User login

Agaric wants to be able to override Drupal form validation errors

Validation error, please try again. If this error persists, please contact the site administrator.

OK. It persists, and I am the site administrator. What exactly am I supposed to do?

(This occurred because I deleted the cookies in the browser while the form was open, before it was submitted. But what exactly can an administrator do about this problem? Tell the person "Copy all your data and do it again with a new form-- new create content or click on the edit link again." The form error message can do that for me and not make me embarrass me to myself.)

UPDATE: This also happens to me all the time because I leave the form open for a day or a week, and eventually a session expires and for perfectly natural, normal reasons the form is invalidated and I cannot post. This annoys me greatly.

Drupal needs a permission to allow overriding of validation errors, or more specifically the date or session-based validation error. Security is great, but if I'm an admin and I'm logged in and I know it's my form, I should be able to tell Drupal to go ahead and add my node. It's not like posting new content is a dangerous action that can interfere with anything else if the form stays open too long.

TAMIT = There's A Module In That (when you need to develop a module; it is the pre-cursor to the much more loved acronym TAMFT = There's A Module For That).

Vaguely validation-escaping related posts worth a report-back to

Very old one: Drupal HEAD gives validation error on comments, http://drupal.org/node/33250

Long one, mostly about search forms (which we dispatched with) and custom node types: http://drupal.org/node/90808

Resolution

Searched words: 
Drupal override validation error extreme frustration why won't Drupal let me post Validation error, please try again. If this error persists, please contact the site administrator.

Comments

-- Me Too --

Ugh!

I'm developing my own module - for use with client needs - and I'm getting this error - with like NO reference to resolve. I don't care about the error - but I hate to tell the no-programming client - ignore error messages!!!

  • Cheers,

Yes

I've got this problem now (hence I'm on this post).

How could it be done though? The message would need some kind of identifier I suppose, so we could know what it was trying to say to the user, and know how to intercept it, but I don't see how any system like this would make sense...

Would the module developer make a registry of messages which are keyed?

like

hook_messages() {
return array (
'error_msg' => 'I am an error Message',
);
}

And then, when they called drupal_set_message, I could implement hook_message_alter?

On a single-language site, messing with t() is always an option, but that's just fugly.

-J

What we want is hook_message_alter

And the issue proposing hook_message_alter is here: http://drupal.org/node/127262

(In the case above I more want to override the form invalidation itself than the message, but we absolutely need to be able to override messages also, and yes they should have a key like mail messages do and an alter. Think we can sneak this into Drupal 7?)

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.