backdrop-contrib / backup_migrate

Port of the Drupal backup_migrate module to Backdrop
GNU General Public License v2.0
7 stars 14 forks source link

backup_migrate.js uses `load()` method, which is deprecated in jQuery 3 #122

Closed argiepiano closed 11 months ago

argiepiano commented 11 months ago

There used to be 2 load() methods in pre-jQuery 3. The one without parameters was equivalent to trigger('load'). The one with at least one parameter was used for ajax requests. jQuery 3 removed the one without parameters, meaning that the 3 instances of load() in backup_migrate.js are trying to use the ajax loading, with a subsequent error which stops other javascript stuff from running.

The solution is to change those to trigger('load');

argiepiano commented 11 months ago

PR submitted. There are some test failures that need to be looked into.

argiepiano commented 11 months ago

Tests are passing - not sure why they failed before.

@cellear, can you please test this patch?

  1. BEFORE applying the patch, be sure you are using jQuery version 3 at admin/config/development/jquery
  2. Before applying, visit admin/config/system/backup_migrate/restore. You will see that the "Advanced Options" fieldset is disabled. This is a consequence of the bug. Inspect the browser console, and you'll see js errors produced by this bug.
  3. Apply the patch and clear caches. Visit that page again. Click around. The fieldset will now works. No errors in the console.

Thanks!

argiepiano commented 11 months ago

OK, resubmitted the PR as I had created a branch in the base repo instead of my fork. PR #124

indigoxela commented 11 months ago

Oh, nice catch! This causes a console error on /admin/config/system/backup_migrate/restore:

Uncaught TypeError: e is undefined

I can confirm that applying the patch fixes the error, and the "Advanced options" collapsed fieldset works properly. :+1:

Works for me!

argiepiano commented 11 months ago

Thanks for testing!