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

Project Config rebuild matrix blocks without fields #4074

Closed
Anubarak opened this issue Mar 29, 2019 · 1 comment
Closed

Project Config rebuild matrix blocks without fields #4074

Anubarak opened this issue Mar 29, 2019 · 1 comment

Comments

@Anubarak
Copy link
Contributor

Description

Sometimes you have matrix blocktypes without fields such as some dividers or other fixed content that does not need to be edited. Currently when you rebuild the project with such empty blocks an exception is thrown in ProjectConfig line 1713

$blockType['fields'] = $matrixSubFields[$blockTypeUid]

matrixSubFields is an array of all fields, and you build the matrix block types by those fields but since this block type has none you'll receive an undefined index exception.
The simple solution would be to include this

$blockType['fields'] = $matrixSubFields[$blockTypeUid]?? [];

Steps to reproduce

  1. Create a matrix block type without fields
  2. Run project-config/rebuild

Additional info

  • Craft version: 3.1.20.1
  • PHP version: 7.2
@andris-sevcenko
Copy link
Contributor

Thanks!

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

No branches or pull requests

2 participants