hi,
I haven't reported this earlier cause it was lower on the priority list.

When a user clicks on "Submit" button, the Story URL box borders and url address itself will turn into a Red colour!

The scoop will submit eventually with no problems, but for few seconds between the submit click and the processing time, this box turns red.

It's not a biggie, but it really confuses (maybe even scares or annoys) the end users.

It's probably something to do with drigg.js file

CommentFileSizeAuthor
#8 patch243411.patch859 bytescedricfontaine

Comments

mercmobily’s picture

Hi,

This is a known issue in the Drigg javascript.
It's good to have it in the bug list, but it won't get much priority.
Patches welcome.

mercmobily’s picture

Hi,

Sicjoy, I don't suppose you could look into this?

Merc,

sikjoy’s picture

Assigned: Unassigned » sikjoy

accepting assignment

sikjoy’s picture

Status: Active » Fixed
sikjoy’s picture

Status: Fixed » Active
bflora’s picture

Fixed? Please explain?

sikjoy’s picture

Drigg's javascript validates the form fields when each field loses focus. The URL field is validated via an ajax call to the server. Keep in mind this takes some time. Nothing wrong here.

Drigg's javascript validates the fields once again on submit. The URL validation, being a laggard, can't complete and adds the error class to the URL field.

Well, that's my theory anyway. If I can prove it, I'll eliminate the "on submit" validation and do the final form validation server side.

Off to test...

--sicjoy

cedricfontaine’s picture

StatusFileSize
new859 bytes

We could have the ajax request done in synchronous when submitting. Here is a patch

sikjoy’s picture

Hi cedricfontaine:

While this may work, It defeats the purpose of client side programming. Why not do server side validation when the server is doing the work already?

--sicjoy

cedricfontaine’s picture

I don't think so as it's still ajax and it verifies URL in background. It's very fast and it's an available option in jquery

mercmobily’s picture

Hi,

Guys, I know zip about Ajax. So, I can't *really* review this. And in fact, I can't even tell whether either one of you has a point.

Help me.

Merc.

cedricfontaine’s picture

The XmlHttpRequest (xhr) comes back with an error when submitting. There is no specific error but as sicjoy said, it's probably cause it gets broken by the submit process.
I test and implement a synchronous check on the URL and it's really fast and avoid submit if URL is not good. Of course we can change how it works and remove verification on form submit, but why ? It seems to be a functionality lost.

sikjoy’s picture

I'm not suggesting that we lose any functionality. Nor that we get rid of the client side validation ajax calls during form field blur. These are a nice convenience to the user and don't cause this bug.

The URL validation is done server side already. We are just requesting that it be done via an ajax call then waiting for the server to report back to the client with results.

Drupal already has server side form field validation built in. We should use that instead of the ajax call during form submit.

sikjoy’s picture

Actually, looking at the code, server side validation for the URL field has been done all along via hook_validate() (see drigg.module). The javascript ajax call on form submit that is causing this bug is redundant. I'm commenting it out for now as the Drigg code freeze is imminent.

sikjoy’s picture

Version: 5.x-1.21 » 5.x-1.x-dev
Status: Active » Fixed
mercmobily’s picture

Status: Fixed » Active

Hi

Just to make sure, Kevin... you'ree not commenting out the Ajax checking of the stories, right?
Because it's an _important_ feature of Drigg, which really should stay.

Basically, I prefer having the "red' bug rather than disabling the URL validation *before* the person hits submit.

I can see that www.drigg.org still performs the checks before submit happens... but, please confirm that the pre-submit check will stay. It's frustrating, but I have a very limited understanding of this issue...

Bye,

Merc.

sikjoy’s picture

Status: Active » Fixed

I mentioned this in comment #13, but I should have used more ubiquitous language.

I will not remove any of the client side form field validation that occurs before the form is submitted. That's not what is causing this bug.

I am removing the client side form field validation that is done when the form is submitted. It causes this bug and is redundant with the hook_validate function in drigg.module.

--sicjoy

bflora’s picture

As a publisher interested in having a site like this, I'd MUCH, MUCH, MUCH rather have a site that didn't validate URLs instead of a site that did it in a way that confused, frustrated or thwarted my users.

If someone posts a bad link. It's their problem and they can blame themselves.

If someone tries to post a good link and they're shown a red box indicating there was something wrong with it, they will assume the developer is incompetent and that the site sucks and they'll never come back again. FAIL.

So please, just switch off validation if you can't get it to work right. That would be so, so much better.

mercmobily’s picture

Hi,

bflora, the bug is now fixed. It shouldn't confuse your users anymore.

Merc.

mercmobily’s picture

Hi,

(thanks a million sicjoy!)

Merc.

mercmobily’s picture

Status: Fixed » Closed (fixed)