Filtering is broken on 'Add condition/reaction' and 'Place block' modals

Created on 12 July 2023, over 1 year ago
Updated 16 September 2024, 2 months ago

Problem/Motivation

The table filtering on the 'Add condition', 'Add reaction', or 'Place block' modal results in the following error:

Uncaught TypeError: $(...).once

https://www.drupal.org/project/context/issues/3355665 🐛 Uncaught TypeError: $(...).once is not a function RTBC only fixes once error, but results in another error:

Uncaught TypeError: $input.attr is not a function.

Steps to reproduce

1. Visit `/admin/structure/context`
2. Add a context
3. Press 'Add condition' and try to filter out conditions by typing in 'Filter by condition name'

and/or

3. Add a 'Blocks' reaction
4. Place block
5. try to filter out blocks by typing something in search

Proposed resolution

Solution is to fix javascript that it checks for elements correctly.

🐛 Bug report
Status

RTBC

Version

5.0

Component

Code

Created by

🇳🇱Netherlands tadas.rimkus

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @tadas.rimkus
  • @tadasrimkus opened merge request.
  • 🇳🇱Netherlands tadas.rimkus

    https://www.drupal.org/project/context/issues/3355665 🐛 Uncaught TypeError: $(...).once is not a function RTBC contains a fix to `once` issue.

    The other issue is actual block filtering that happens inside admin/structure/context.
    This small update to javascript fixes that.

  • 🇮🇳India dineshkumarbollu

    Hi

    I Tested the MR!36 in my local site search results are getting. i am attaching screenshots for that.

    Thanks

  • Status changed to RTBC about 1 year ago
  • Tested the MR!36 the block search now works correctly. RTBC.

  • 🇺🇸United States liza

    hi! is there a new patch system? if am using composer to manage modules:
    1. where's the patch for this bug?
    2. if we are not use patch or git apply --and it's not encouraged to add the patch to composer.json-- how exactly are we to apply this patch?

    thanks.

  • 🇬🇧United Kingdom rossb89 Bristol

    @liza if you go to the merge request link in this node (https://git.drupalcode.org/project/context/-/merge_requests/36)

    In the top Right hand side you'll see a blue select list dropdown titled 'Code'.

    Click that, and under the 'download' click 'Plain diff' and that will give you a patch file. You should name it something appropriate rather than just 'mr-36.patch'.

    You should then add e.g. a patches folder in your project (at the top level, outside the webroot), and in composer.json reference the patch from within there. E.g.

    "Search is broken when placing block MR-36 ( https://www.drupal.org/project/context/issues/3374119 🐛 Search is broken when placing block RTBC )": "patches/the-name-of-the-patch-file.patch"

    You technically could hotlink directly to the patch URL BUT if the code changes at all within the merge request then next time you ran composer install you'd get any changes that may have been made, which could cause issues with broken code, etc so it's highly recommended to NOT directly link to the patch from the merge request.

  • 🇬🇧United Kingdom rossb89 Bristol

    Another vote for RTBC.

    This patch works great and does indeed solve search not working and the once issue from the other issue.

  • 🇺🇸United States amanire

    MR!36 works great, thank you!

    But this issue is more widespread than the description here and in https://www.drupal.org/project/context/issues/3355665 🐛 Uncaught TypeError: $(...).once is not a function RTBC indicate. It took me a few tries to track this issue down because of the title. I'm revising it and description for clarity to help others in this situation and better expose its severity to the module maintainers.

  • 🇨🇷Costa Rica maxmendez

    Tested MR!36 and it works perfectly. Thanks!

  • 🇦🇺Australia carlopogus

    Generated patch from MR!36

Production build 0.71.5 2024