md-systems / redirect

DEPRECATED: Redirect moved back to drupal.org, use the official repository.
https://www.drupal.org/project/redirect
21 stars 29 forks source link

[#80] Fix AJAX call and remove focus() on redirect form #81

Closed juampynr closed 8 years ago

juampynr commented 8 years ago

Fixes https://github.com/md-systems/redirect/issues/79.

The AJAX response was causing a bunch of PHP warnings starting with this one:

Notice: Undefined index: #attached in Drupal\Core\Render\MainContent\AjaxRenderer->renderResponse() (line 68 of /var/www/drupal8/core/lib/Drupal/Core/Render/MainContent/AjaxRenderer.php).

This is because we were returning an array, which was interpreted by core as an AjaxResponse object. Once this was fixed, there was a weird behavior with ajax.js focusing on the field every time the ajax request would finish. The full details of this issue can be found at https://www.drupal.org/node/2627788. I included a fix for this too.

Berdir commented 8 years ago

Strange, we only recently made a fix for this. Tested, works fine.