From drupal core 11.3.1, create method of Drupal\markdown\Util\FilterHtml conflict dependency injection interface of the drupal core.
PHP Fatal error: Declaration of Drupal\markdown\Util\FilterHtml::create($allowedHtml = '') must be compatible with Drupal\Core\Plugin\PluginBase::create(Symfony\Component\DependencyInjection\ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) in /app/web/modules/contrib/markdown/src/Util/FilterHtml.php on line 35
Steps to reproduce:
1. Install drupal core 11.3.1
2. Install markdown module.
3. Add a text format to use the markdown filter.
4. Add a node text field to use the text format created in step 3.
5. Add the node, input some markdown to the text field, and view the node.
Issue fork markdown-3564814
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
司南 commentedComment #4
司南 commentedComment #5
joelpittetTry the MR in #3373147: Fix phpstan deprecation errors it might fix this. Thanks for reporting it.
Could you add steps to reproduce the problem?
Comment #6
司南 commentedNo, this is not a phpstan error. #3373147: Fix phpstan deprecation errors is not killing this bug.
Comment #8
joelpittetI see it was a result of #3452852: Add create() factory method with autowired parameters to PluginBase in D11.3. I was tempted to backport and override the create method to match D11 but that still messes with the public signature so... your solution is less code changes and the auto-wiring will work in D11 (though it's use isn't much here). Thanks again for bringing this to my attention.