Problem/Motivation
Creating a new Markdown text format produced the below error.
Steps to reproduce
- On a new site, I logged in as User 1, navigated to Admin->Configuration->Content authoring->Text formats and editors.
- I typed "Markdown" for the Name and let it generate the machine name automatically.
- For enabled filters I ticked Markdown Easy and Limit allowed HTML tags and correct faulty HTML .
- I changed to order to put Markdown first.
- Under Markdown settings I changed the flavor to GitHub.
- I clicked save, and the error below is displayed. Note that the format does save.
Warning: Undefined array key "#title" in _markdown_easy_filter_format_form_submit() (line 46 of modules/contrib/markdown_easy/markdown_easy.module).
_markdown_easy_filter_format_form_submit(Array, Object)
call_user_func_array('_markdown_easy_filter_format_form_submit', Array) (Line: 114)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 52)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('filter_format_add_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 166)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
lostcarpark commentedComment #3
keshavv commentedI have followed all the steps mentioned, But I cannot reproduce it. In my case the value of
#titlefield is present.There is no error log as well.
Comment #4
ultimike@lostcarpark - do you get this error consistently?
Were you testing on a fresh D10 install?
Do you have any other modules enabled that might mess with the
$form['#title']of text format forms?-mike
Comment #5
lostcarpark commentedIt was a fresh install of D10 under DDEV.
I think I've figured out how to reproduce:
The error above will be displayed.
Note that in the Markdown Easy description, it says "It is strongly recommended to configure the 'Limit allowed HTML tags and correct faulty HTML' filter so that it runs after this filter", but it doesn't mention "Convert line breaks into HTML". It's only when Markdown Easy is enabled that the message about the other module is shown (and in a warning when the format is saved without it).
If you en
Comment #6
ultimike@lostcarpark - I've found and fixed the issue and added a test - want to give this a quick looksie?
thanks,
-mike
Comment #8
lostcarpark commentedRepeated the steps in #5, and verified no longer getting error message. Looks good now.
Comment #9
lostcarpark commentedAlso ran tests and verified passing. The change and the new test look good to me. Moving to RTBC.
Comment #11
ultimikeSweet - thanks - merging.
-mike
Comment #13
ultimike