Problem/Motivation

jQuery once is removed from drupal 10. There are two occurrences where .once() is still used

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mvogel created an issue. See original summary.

mvogel’s picture

Status: Active » Needs review
StatusFileSize
new1.83 KB

see the patch for refactoring

sumit-k’s picture

StatusFileSize
new74.2 KB

Verified patch. Working fine for me.

sumit-k’s picture

Status: Needs review » Reviewed & tested by the community

Lysenko made their first commit to this issue’s fork.

lysenko’s picture

After applying patch #3, almost everything works fine, but I get a minor error

Error: cannot call methods on autocomplete prior to initialization; attempted to call method 'destroy'

It is caused by this line:
$(context).find("input.form-autocomplete").autocomplete("destroy");

I prepared a small distortion

        var autocompleteForm = $(context).find("input.form-autocomplete");
        if (autocompleteForm.hasClass('ui-autocomplete')) {
          autocompleteForm.autocomplete("destroy");
        }

lysenko’s picture

Status: Reviewed & tested by the community » Needs review

I did move the changes from the patch #2 into merge request also did add the fix for the error: "Cannot call methods on autocomplete prior to initialization; attempted to call method 'destroy'"

o_timoshchuk’s picture

Status: Needs review » Reviewed & tested by the community

+1 RTBC Working fine for me.

vasike’s picture

Status: Reviewed & tested by the community » Needs work

small comment on MR ... so maybe a cleanup and a second look to go back to RTBC

vasike’s picture

Version: 8.x-1.4 » 8.x-1.x-dev
Status: Needs work » Reviewed & tested by the community

I think we're back to RTBC

vasike’s picture

Priority: Normal » Critical

i think this is critical, as without it, it's doesn't work on D10

  • vasike committed a17e41d5 on 2.0.x authored by Lysenko
    Issue #3345731 #comment-15173067 Fixed an error: Error: cannot call...
vasike’s picture

Version: 8.x-1.x-dev » 2.0.x-dev
Status: Reviewed & tested by the community » Fixed

MR merged, but in the new version of the module.
so closing for now.

feel free to re-open, if needed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.