Hello,

it's me again ^ ^

I get the following error in Chrome, caused by the script file "page--ajax.tpl.php"

Uncaught TypeError: Cannot call method 'replace' of undefined

I remove this script. I no longer error and everything works perfectly. What is this script?

Comments

serjas’s picture

Category: bug » support
Status: Active » Needs review

You can remove the script .. Its to alter form action incase a validation error comes

serjas’s picture

Assigned: sebastien247 » Unassigned
Category: support » bug
serjas’s picture

Status: Needs review » Closed (fixed)
paularmand’s picture

I got the same error, and removing the script indeed "solves" it.

I have got another issue, which I presume could be linked to the removal of the script however. The issue: when an error is given by a view (only tested views) loading via an ajax link (through this module), it does some strange things to the DOM as from that moment clicking on other ajax-links results in strange behavior (nothing loading, or stuff loading at the wrong place). Is my gut feeling that it's related correct? If so, can this issue be reopened?

Ps1: Can't give any url from the site as it's localhost development for the time being.

Thanks for the module btw, tried to make my own ajax module, and ran into problems... your module is definitely way better ;)

rob c’s picture

Status: Closed (fixed) » Needs review

I've added this

if (formAction) {
}

End result now is:

if (formAction) {
formAction = formAction.replace("?ajax=1", "");
$("form").attr('action', formAction);
}

No errors + works with loading form validation. (i really needed that to work, axing the script breaks that)
Hope it helps.

serjas’s picture

Assigned: Unassigned » serjas
serjas’s picture

Status: Needs review » Needs work
serjas’s picture

Status: Needs work » Needs review

Issue fixed and committed to 7.x-1.x-dev. Thanks to Rob

serjas’s picture

Status: Needs review » Closed (fixed)