cms icon indicating copy to clipboard operation
cms copied to clipboard

[5.x]: Field of type "Entries" fails when opened in a modal

Open jgpadua opened this issue 1 year ago • 6 comments

What happened?

Description

There is a bug when opening a field of type "Entries" in a modal. Many console error logs are triggered and it's not possible to select the entry. It works fine if I open the modal in a new tab. See the example: CleanShot 2024-08-13 at 15 12 05

Craft CMS version

5.3.3

PHP version

8.3

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions

jgpadua avatar Aug 13 '24 18:08 jgpadua

Can you post a screenshot of the JavaScript errors? Hard to read them in the video.

brandonkelly avatar Aug 13 '24 21:08 brandonkelly

For sure. That is the console error right after clicking on the button to select the entry. CleanShot 2024-08-13 at 20 47 17

And these errors in the sequence are probably a consequence of the first one, but if it helps you in any way, they are generated after clicking on some item in the entries menu. CleanShot 2024-08-13 at 20 49 52

jgpadua avatar Aug 13 '24 23:08 jgpadua

Hm, weird, somehow the menubtn jQuery function has gone missing at that point.

I’m not able to reproduce that locally, but I’m guessing it’s happening because some plugin or module is overriding jQuery on the page.

Try reloading and reproducing with your browser’s Network tab open, and see if you see any requests pulling in a new copy of jQuery are coming down before/when the error occurs.

brandonkelly avatar Aug 15 '24 12:08 brandonkelly

Well, I tested it on Chrome, Safari and Firefox and didn't find anything significant in the network tab. Not sure if this is relevant, but this problem happens in the Globals menu. I did not test it in an entry, but I can try it as well.

Chrome: https://github.com/user-attachments/assets/a1c27fe5-6808-4043-a939-c7469ffb678a

Firefox: https://github.com/user-attachments/assets/e8d70aef-15a1-4f3e-b3be-8c4dc2d41b9f

Safari: https://github.com/user-attachments/assets/6c5d7041-f386-4609-b4fa-9fd843031273

jgpadua avatar Aug 15 '24 21:08 jgpadua

Just did it, added the same option to another field and tested it in a regular entry. Got the same result. https://github.com/user-attachments/assets/cbb263b6-7804-4ede-8be3-1f641ca52bd6

Here is my field config: https://github.com/user-attachments/assets/585f2b65-b7fc-402e-ac3b-bda611cced7b

jgpadua avatar Aug 15 '24 22:08 jgpadua

Any chance you can send a database backup and your Composer files into [email protected]?

brandonkelly avatar Aug 17 '24 17:08 brandonkelly