When creating a modal from pressing a form button, the url that is constructed by concatenating form values with the class <form_id>-url returns the url with /nojs/ in the path. This is causing errors when the modal dialog pops up. Drupal.ajax doesn't process the new url to replace nojs with ajax.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

tom friedhof’s picture

Status: Active » Needs review
FileSize
298 bytes

Here is the patch for this. I took the same replacement pattern from ajax.js in Drupal core. Perhaps there is a way to have Drupal.ajax process this url again so the replacement functionality isn't duplicated. Thoughts?

merlinofchaos’s picture

So I think that the reason this was never implemented to do this is that...

if you're in the modal, you've already established that the client is using ajax, and the URLs don't need to have nojs/ajax replacement, and you can just give the proper URL.

I'm trying to think of a use case where this isn't true.

Chris Matthews’s picture

Issue summary: View changes

The 6 year old patch to modal.js still applies cleanly to the latest ctools 7.x-1.x-dev, but the issue might need to be closed as won't fix or works as designed per merlinofchaos' comments above.

Checking patch js/modal.js...
Hunk #1 succeeded at 354 (offset 40 lines).
Applied patch js/modal.js cleanly.