Problem/Motivation
Uncaught TypeError: Cannot read properties of undefined (reading 'Effects')
at Object.attach (field_group.js?s6qg5s:34:32)

Steps to reproduce
- Create content with media field
- Try to add existing media
- Click on the arrow button to go to the next page with existing media
Proposed resolution
?
| Comment | File | Size | Author |
|---|---|---|---|
| add-existing-media-error.png | 211.51 KB | krzysztof domański |
Issue fork field_group-3412511
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:
- 3412511-filtering-and-pagination
changes, plain diff MR !44
Comments
Comment #4
heikkiy commentedTested and this seems to fix the error.
Comment #5
maxilein commentedCan you please make a patch.
Comment #6
heikkiy commented@maxilein You can get the patch file from the MR: https://git.drupalcode.org/project/field_group/-/merge_requests/44.patch
Note that it's always recommended to save the patch file in local repository and use it from there. The MR patch can change if new commits are added to it might break existing functionality and it's also a possible attack vector because someone could slip malicious code to the MR.
Comment #7
anybodyComparing this with https://git.drupalcode.org/issue/field_group-3412511/-/blob/3412511-filt... the fix totally makes sense to me.
I'd vote to order the variables like in the libraries.yml for better compareability and future changes?
Comment #8
nils.destoop commentedThe commit adds dependencies in the javascript code to once, and drupalSettings. While it is not always used.
I see 3 things that need to happen:
- once should be added in the field_group.field_ui.js file, as it is used there
- drupalSettings should be added to field_group.js
- libraries.yml should be updated as there is no direct dependency to some of those libraries
Comment #9
nils.destoop commentedI pushed a fix for this on the main branch