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
Bug in MetaWizard widget #620
Comments
I cannot reproduce this. Which browser and OS did you test? |
Really? The issue is totally independent from OS or browser. (I'm using Firefox, Chrome and Safari on MacOS.) Did you really click "save" after adding a new language? |
Yes, I did. See https://www.dropbox.com/s/symjuc9yoy6v7j0/626.mov?dl=0 |
Clean install of v4.7.7 and the bug still occurs. Question: After adding a language and saving, does "your" select element contain the recently added language as a disabled option item? "Mine" doesn't, so the JS error is thrown. |
Please improve your reproduction steps:
|
I'm sorry, I didn't provide these informations before, because they don't seem to have impact on the bug:
So to sum it up:
|
Hm, in fact, I cannot delete any language at any point... am I encountering a different error? The JavaScript error is
|
Thank you!
Still wondering why it works @leofeyer ... |
@fritzmg Can you also reproduce it in the latest |
Yeah, same error still happens in |
Guess, it's been there since |
Steps to reproduce:
When deleting the recently added language, a JS error is thrown.
Cause: The
metaDelete()
method in core.js tries to re-enable the language in the select field:contao/core-bundle/src/Resources/public/core.js
Line 2329 in 6742d9e
But the select field does not contain (disabled) language options of currently used languages.
Maybe the language should not be removed from the select field:
contao/core-bundle/src/Resources/contao/widgets/MetaWizard.php
Line 166 in 6742d9e
But instead the active languages should be added with the "disabled" attribute to the select:
contao/core-bundle/src/Resources/contao/widgets/MetaWizard.php
Line 179 in 6742d9e
Maybe something like this:
$options[] = '<option value="' . $k . '"' . ($this->varValue[$k] ? ' disabled="disabled"' : '') . '>' . $v . '</option>';
and removing the
unset()
in L166The text was updated successfully, but these errors were encountered: