Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x]: Uncaught TypeError: Cannot read properties of undefined (reading 'on') Matrix Blocks #13194

Closed
jamesmacwhite opened this issue May 15, 2023 · 9 comments

Comments

@jamesmacwhite
Copy link
Contributor

What happened?

Description

Since updating to 3.8.10.2 I am unable to click on block within a matrix field which has several types, but not enough to display the add a block menu.

Uncaught TypeError: Cannot read properties of undefined (reading 'on')
at s.constructor.init (MatrixInput.js:122:36)
at s.constructor.constructor (Base.js:20:15)
at s.constructor (Base.js:32:21)
at new s.constructor (Base.js:32:21)
at HTMLDocument. (922094-restaurant:2091:19)
at l (jquery.js?v=1684142192:2:30361)
at c (jquery.js?v=1684142192:2:30663)

The following JS console error is raised upon clicking on any block.

This seems related to #13177 but the reverse problem.

Steps to reproduce

  1. Update to Craft CMS 3.8.10.2
  2. Try and click on a block on a matrix field with several options
  3. The block is not added and a JavaScript console error is raised

None of these blocks work in a site.

image

If a matrix field has many blocks which displays the "Add a block" menu, this works.

Expected behavior

To be able to add a block from any Matrix field.

Actual behavior

No matrix block can be added

Craft CMS version

3.8.10.2

PHP version

8.0

Operating system and version

WSL2 Ubuntu Linux

Database type and version

MySQL 8

Image driver and version

No response

Installed plugins and versions

No response

@i-just
Copy link
Contributor

i-just commented May 15, 2023

Hi, thanks for reaching out. I can’t seem to replicate this behaviour on a clean Craft 3.8.10.2 installation.
Any chance you can check if it also happens when all your plugins are disabled? If so, can you please send over your composer files and config/project directory to support@craftcms.com so we can investigate further?

@jamesmacwhite
Copy link
Contributor Author

@i-just. Thanks, I've just sent over our composer.json and config/project contents.

@i-just
Copy link
Contributor

i-just commented May 15, 2023

@jamesmacwhite, thanks for sending over the files; I can now reproduce it on a clean Craft 3 installation.
It’s only happening if you have (at least) 2 matrix fields on a page, and the first one only has one block and the min and max blocks for this field are both set to 1. I’m looking into it now.

@jamesmacwhite
Copy link
Contributor Author

jamesmacwhite commented May 15, 2023

Ah good find! I'm glad you could reproduce this because I was going crazy!

@jamesmacwhite
Copy link
Contributor Author

@i-just Thanks for the quick PR on this. As this has unfortunately gone onto our production environment, do we have an estimate of a new point release?

@brandonkelly
Copy link
Member

brandonkelly commented May 15, 2023

The PR is merged in. We’ll get a release out shortly!

@jamesmacwhite
Copy link
Contributor Author

Amazing, thank you for rapid response and release.

@brandonkelly
Copy link
Member

Craft 3.8.11 is out with the fix :)

@jamesmacwhite
Copy link
Contributor Author

Awesome, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants