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

Better error message then "Notice: Undefined index: type" when forgetting translation for types #612

Open
alexander-schranz opened this issue Jun 1, 2022 · 0 comments
Labels
DX Only affecting the end developer

Comments

@alexander-schranz
Copy link
Member

alexander-schranz commented Jun 1, 2022

Q A
Bug? no
New Feature? no
SuluArticleBundle Version Specific version or SHA of a commit
Sulu Version Specific version or SHA of a commit

Actual Behavior

Currently if you define a new type and forget to configure it in the sulu_article configuration.
The following error appears:

Notice: Undefined index: type

This is confusing developer as they don't know what they did wrong

Expected Behavior

A better error message should be shown so the know they forget to define the type translation in sulu_article config.

Steps to Reproduce

Create a template with a new type but do not configure it in sulu_article.

Possible Solutions

For people running into this issue the solution is always to configure the article type translation.
See https://github.com/sulu/SuluArticleBundle/blob/2.x/Resources/doc/article-types.md#sulu-admin-translations

For the issue the solution is add better checking for type and created configuration. Best would be to fail already in a compilerpass.

This issue appeared in slack and so I want to make sure other can find it here.

@alexander-schranz alexander-schranz added bug Error or unexpected behavior of already existing functionality DX Only affecting the end developer and removed bug Error or unexpected behavior of already existing functionality labels Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Only affecting the end developer
Projects
None yet
Development

No branches or pull requests

1 participant