Follow-up of [#194362]
Quoting myself from there:
The new editor entity is only created on the ajax callback/configure button.
If you disable JS, add a new format, select an editor and don't click on "Configure" but directly on save, you get a "Fatal error: Call to undefined method stdClass::save() in .../core/modules/editor/editor.module on line 220 ".
The same will happen if you add a test where you leave out the drupalPostAjax() there.
I'm not sure what's the best thing to do, but you should be able to provoke fatal errors through the UI even if you're doing it "wrong" ;) Either add a validation along the lines of "You must configure the editor" and reload the form with the configuration thingy updated or create the editor entity on demand if it doesn't exist yet.
Comment | File | Size | Author |
---|---|---|---|
#7 | 1950634-7.patch | 3.69 KB | Wim Leers |
Comments
Comment #1
webchickThat sounds major...
Comment #2
BerdirWell, it's a fatal error yes.
But you can only trigger it if you disable JS and do *not* click on the button that's there right beside the editor selection form but go right to the submit button at the end of the form, so not sure about major :)
Comment #3
webchickRight, well that's why major and not critical. :D
Comment #4
Wim LeersI'll fix this.
Comment #5
dcam CreditAttribution: dcam commentedhttp://drupal.org/node/1427826 contains instructions for updating the issue summary with the summary template.
Comment #6
Wim LeersI'll fix this this week.
Comment #7
Wim LeersFixed, with test coverage.
One-line fix, but additional validation and test coverage of course add up. As you (or dawehner) recently said: it's impossible to have one-line Drupal core patches anymore, because then you're missing the regression tests! :)
Comment #8
jessebeach CreditAttribution: jessebeach commentedI manually tested 8.x HEAD to confirm the bug still exists. It does.
I manually tested the patch in #7 with JavaScript disabled. Selecting the CKEditor on the Text Format configuration form without pressing the Configure button before saving the form results in a form validation error rather than a fatal error.
I ran the tests that are introduced in this patch. They pass.
It's ready for commit.
Comment #9
alexpottCommitted 814089c and pushed to 8.x. Thanks!
Comment #10
Wim LeersComment #11
Wim Leers.