Skip to content
Snippets Groups Projects

Issue #2845319: The highlighting of the 'Home' menu-link does not respect query strings and fragment identifiers

Open Issue #2845319: The highlighting of the 'Home' menu-link does not respect query strings and fragment identifiers
2 unresolved threads
Open Ben Mullins requested to merge issue/drupal-2845319:2845319-the-highlighting-of into 9.3.x
2 unresolved threads
4 files
+ 47
48
Compare changes
  • Side-by-side
  • Inline
Files
4
  • 1a834c9e
    Issue #3273312 by Wim Leers, Dom., ifrik, mpp, seanB, lauriii: Upgrading from... · 1a834c9e
    Alex Pott authored
    Issue #3273312 by Wim Leers, Dom., ifrik, mpp, seanB, lauriii: Upgrading from CKEditor 4 for a text format that has FilterInterface::TYPE_MARKUP_LANGUAGE filters enabled
    
    (cherry picked from commit e8ed42cc)
@@ -8,6 +8,8 @@
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\editor\EditorInterface;
use Drupal\filter\FilterFormatInterface;
use Drupal\filter\Plugin\Filter\FilterAutoP;
use Drupal\filter\Plugin\Filter\FilterUrl;
use Drupal\filter\Plugin\FilterInterface;
use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;
@@ -74,6 +76,13 @@ public function validate($toolbar_item, Constraint $constraint) {
/**
* Checks no TYPE_MARKUP_LANGUAGE filters are present.
*
* Two TYPE_MARKUP_LANGUAGE filters are exempted:
* - filter_autop: pointless but harmless to have enabled
* - filter_url: not recommended but also harmless to have enabled
*
* These two commonly enabled filters with a long history in Drupal are
* considered to be acceptable to have enabled.
*
* @param \Drupal\filter\FilterFormatInterface $text_format
* The text format to validate.
* @param \Drupal\ckeditor5\Plugin\Validation\Constraint\FundamentalCompatibilityConstraint $constraint
@@ -85,6 +94,9 @@ private function checkNoMarkupFilters(FilterFormatInterface $text_format, Fundam
FilterInterface::TYPE_MARKUP_LANGUAGE
);
foreach ($markup_filters as $markup_filter) {
if ($markup_filter instanceof FilterAutoP || $markup_filter instanceof FilterUrl) {
continue;
}
$this->context->buildViolation($constraint->noMarkupFiltersMessage)
->setParameter('%filter_label', (string) $markup_filter->getLabel())
->setParameter('%filter_plugin_id', $markup_filter->getPluginId())
Loading