Quantcast
Channel: Issues for Drupal core
Viewing all 296681 articles
Browse latest View live

Basic Auth module conflicts with server-level "Site Lock" implementations

$
0
0

Problem/Motivation

Many platforms and development environments use Basic Auth configured on the server to provide a Site Lock. This allows making sites available to select people via the public web without exposing the site to the public in general. For example, https://pantheon.io/docs/lock-environment/.

This might manifest if you are not thinking about it as though the user/login form itself is throwing an access denied, or on further investigation and confirmation of permissions that all pages are mysteriously throwing an access denied.

Per http://drupal.stackexchange.com/a/212800/394 and an examination of the Basic Auth provider code, what's happening is that if you use Basic Auth headers, PHP will pick them up and the Basic Auth module in core will be "triggered' to attempt authentication with those credentials. If it fails, the response will be redirected to access denied. After all, a login attempt just failed.

The frustration level this issue can cause makes it a major DX issue when the stars align, and while I marked it as a bug, you could argue it's a support request.

Proposed resolution

This issue is complicated because it could be considered a feature, not a bug. However, there is a common expectation that a "site lock" can be configured without regard for the application configuration.

One solution could be a simple configuration option that allows checking to see if the user account does not exist, and if not treat it as an anonymous request.

Another possibility would be supporting the Drupal site issuing Basic Auth challenges, allowing the site itself to provide the "lock UI".

Remaining tasks

Decide if this is a problem that should be solved. If not solved, this becomes a documentation problem to explain what's going on and recommended workarounds.

User interface changes

?

API changes

?

Data model changes

?


Custom classes for pager links do not work with Claro theme

$
0
0

Problem/Motivation

When using the Claro theme, custom classes added to pager links do not appear. Claro defines its own class for pager links but does not add any custom classes. Normally, custom classes can be added to themes using template hooks.

Steps to reproduce

  1. Install fresh Drupal setup
  2. Enable Claro theme
  3. Create a view with pager enabled
  4. Add a template_preprocess_pager hook and add a test class (see example below)
  5. Go to the view and inspect the pager markup
  6. Result: The test class is not added to the pager
  7. Expected: The test class is added to the pager

Example test Hook:

/**
 * Implements template_preprocess_pager().
 */
function claro_preprocess_pager(&$vars) {
  if (isset($vars['pager'])) {
    if (count($vars['items'])) {
      foreach ($vars['items'] as $key => $value) {
        // print_r('<pre>');
        // var_dump($value);
        if (!empty($value['attributes'])) {
          $vars['items'][$key]['attributes']->addClass('test-pager-class');
        }
        else {
          if (count($value) > 3) {
            foreach ($value as $subKey => $subValue) {
              if (!empty($subValue['attributes'])) {
                $vars['items'][$key][$subKey]['attributes']->addClass('test-pager-class');
              }
            }
          }
        }
      }
    }
  }
}

Screenshots

Before:

After:

Proposed resolution

Update pager.html.twig to inject custom classes. See other themes for examples.

Remaining tasks

  1. Create patch
  2. Test patch
  3. Review patch
  4. Commit

User interface changes

API changes

Data model changes

Release notes snippet

Add multilingual support for caching basefield definitions

$
0
0

Problem/Motivation

When a new node is created BaseField definitions are statically cached in ONE language.
There are however use cases where you'd want more than one language for an entity type (E.g. Dutch & English node).

Some more context how I ran into this:

Our default language is English (we don't want to export Dutch config) and we have a language negotiator with a fallback to Dutch (/nl, /fr, /en, /de).

The first time we run this Behat test all is green, the second time it's failing because "Title" appears (instead of "Titel"):

  Scenario: Webmaster can create a promopage
    Given I am logged in as a "webmaster"
    And group content:
      | title      | moderation_state  | langcode |
      | Test group | published         | nl       |
    When I go to "/nl/node/add/promopage"
    Then I should see the text "Titel"

Strangely, the following test is always green:

  Scenario: Webmaster can create a promopage
    Given I am logged in as a "webmaster"
    When I go to "/nl/node/add/promopage" # <= added this
    Then I should see the text "Titel" # <= added this
    And group content:
      | title      | moderation_state  | langcode |
      | Test group | published         | nl       |
    When I go to "/nl/node/add/promopage"
    Then I should see the text "Titel"

When using another role or a specific test user or change a permission the test succeeds (only the first time). Something is caching wrong config translations.

The error only seems to apply only for basefield overrides. EntityFieldManager::getFieldDefinitions() somehow contains their translations in the wrong language.

We can workaround the issue with drush -y config-set language.negotiation url.prefixes.nl ''

Proposed resolution

After some investigation I discovered that EntityFieldManager::getBaseFieldDefinitions caches the definitions in a class property with labels and their translations) only once (for all languages):

  /**
   * {@inheritdoc}
   */
  public function getBaseFieldDefinitions($entity_type_id) {
    // Check the static cache.
    if (!isset($this->baseFieldDefinitions[$entity_type_id])) {
      // Not prepared, try to load from cache.
      $cid = 'entity_base_field_definitions:' . $entity_type_id . ':' . $this->languageManager->getCurrentLanguage()->getId();
      if ($cache = $this->cacheGet($cid)) {
        $this->baseFieldDefinitions[$entity_type_id] = $cache->data;
      }
      else {
        // Rebuild the definitions and put it into the cache.
        $this->baseFieldDefinitions[$entity_type_id] = $this->buildBaseFieldDefinitions($entity_type_id);
        $this->cacheSet($cid, $this->baseFieldDefinitions[$entity_type_id], Cache::PERMANENT, ['entity_types', 'entity_field_info']);
      }
    }
    return $this->baseFieldDefinitions[$entity_type_id];
  }

We should make this language aware.

Extend the list of allowed html tags for result rewrite

$
0
0

Problem/Motivation

I tried to rewrite a field's output in a view's field display mode. I'm tied to the display mode "fields" because I use https://www.drupal.org/project/search_api_solr and here I can't use the content display mode for the view.

Anyway I need to have control over the markup generated for a certain field. So I used the "rewrite result" feature and included my twig template there using "include()".

The one thing not working is that Drupal/Component/Utility/Xss is stripping out my responsive images (picture html tag). The allowed tags are defined in this class and I don't want to add a patch extending these tags since that's dirty coding.

So is there any way to extend the list of allowed tags for the filterAdmin() function in the Xss class? Or would that be a new feature?

Steps to reproduce

1. Create a view.
2. Assign field output mode.
3. Create a field and rewrite the result.
4. Place a picture tag in there (or any other non-allowed tag).
5. The tag is stripped out (as designed in the core, currently).

Proposed resolution

Add a hook to extend the list of allowed tags.

Any help is highly appreciated!

Bye Defcon0

Make the maximum menu depth configurable

$
0
0

Problem/Motivation

Once #2301239: MenuLinkNG part1 (no UI or conversions): plugins (static + MenuLinkContent) + MenuLinkManager + MenuTreeStorage is in, it would be possible to no longer hardcode the maximum depth of menus: MenuTreeStorage::MAX_DEPTH

Proposed resolution

  • Generate the schema using a configured maximum length
  • Try to not allow lowering the size

Remaining tasks

User interface changes

API changes

Postponed until

#2256521: [META] New plan, Phase 2: Implement menu links as plugins, including static admin links and views, and custom links with menu_link_content entity, all managed via menu_ui module

Replace "Lorem Ipsum" Color preview HTML templates with example text in Twig templates

$
0
0

Currently in the Appearance section of Bartik, a live preview of a chosen color scheme is displayed as an image. This section uses Latin placeholder text, "Lorem ipsum . . . ." The problem is getting users to understand the Latin is JUST A PLACEHOLDER. Participants in a Drupal usability study at the University of Minnesota in 2011 expected it to be the live preview of the site with THEIR content. Looking at the Latin text, one participant in the study said, "What's this? French?"

In this thread from May 2011 to December 2014, contributors have narrowed in on recommending a patch to change the Latin text to repetitions of the English words "Sample text." Other suggestions have been to make the text translatable or to embed the content of the actual site as an iFrame. Placing "sample text" is the most simple of the solutions and would look like this:

Sample text

Block of text (re-arrange sentences so line lengths don't repeat)
This is a block of example content. This content is here to demonstrate what actual content would look like in the color scheme you configure. This is an example link, is is here to demonstrate how background colors you configure may affect the readability of links. This content is here to demonstrate what actual content would look like in the color scheme you configure. This is an example link, is is here to demonstrate how background colors you configure may affect the readability of links. This is a block of example content.

EntityForm::getEntityFromRouteMatch() does not support route-level parameters

$
0
0

This is a followup to #2651716: Entity::getEntityFromRouteMatch() should support bundles, which added partial support for bundle-based entity routes : it only supports them when the bundle is part of the route path, but not when it is a constant parameter, because it only checks using $route_match->getRawParameter() instead of $route_match->getParameter().

Using $route_match->getRawParameter() is needed because some parameters are likely to be upcasted, but to support route-defined (vs request-defined) parameter values, a pair of extra calls to $route_match->getParameter() appears to be required.

Convert select query extenders to backend-overrideable services

$
0
0

Problem/Motivation

While working on #3217531: [PP-2] Deprecate Connection::getDriverClass mechanism, make its callers abstract, and use standard autoloading, we came across the fact that Connection::getDriverClass is also used to resolve overrides to select query extenders. This is not easily solvable with direct autoloading because the to-be-overridden class resides outside of the database driver namespaces; also, while the db driver specific classes are all necessarily extensions of the Core\Database ones, the extenders may be freely added by any module.

Proposed resolution

Try using backend-overrideable services, adding a factory for each extender that will then instantiate extender objects.

Remaining tasks

None

User interface changes

None

API changes

Using the full class name as the parameter value in the method Drupal\Core\Database\Query\Select::extend() has been deprecated. Also the method Drupal\Core\Database\Connection::getPagerManager() has been deprecated.

Data model changes

None

Release notes snippet

Select query extenders are now managed through backend-overrideable services. When extending a query, consuming code need to switch from hardcoding the extension class to calling the extender service with the type of extension required. Contrib and custom database drivers overriding the extenders need to implement their own service. See https://www.drupal.org/node/3218001


Allow text fields and textareas to use the other's widgets.

$
0
0

It's super frustrating when you want to have a text field (255chars) but the only way to see the entire 255 chars in that field is a really really reeeeally long textfield. Text areas are a thing. We should be able to use them (and not just for longtext text fields).

in Drupal 7, to use a textarea you need to create a whole new field and migrate all your data into it, but the underlying data structure is exactly the same!! This should not be necessary. Let's add the textarea widget as an option for text fields (but leave the existing widget as default)

PHP8 compatibility. TypeError: count(): Argument #1 ($value) must be of type Countable|array' in field_default_form()

$
0
0

The problem has been fixed, when sent restapi request to create node.
During investigation I found, thati if to _field_invoke() will come $op = 'form', $entity_type = "node", $entity with field $entity->{$field_name}[$langcode] with string value. For example, $entity->field_category= array("en"=>"1"). $items will be equal to string value "1" in code of _field_invoke():
$items = isset($entity->{$field_name}[$langcode]) ? $entity->{$field_name}[$langcode] : array();
$result = $function($entity_type, $entity, $field, $instance, $langcode, $items, $a, $b);
So $function = 'field_default_form' we call function ield_default_form(), where we see strings with code:

    $field_state = array(
      'field' => $field,
      'instance' => $instance,
      'items_count' => is_array($items) ? count($items) : count(array($items)),
      'array_parents' => array(),
      'errors' => array(),
    );

As a result count($items) we will get TypeError on php8: count(): Argument #1 ($value) must be of type Countable|array, string given in count() ... In 7.4 version on this step count($items) ="1".
I suggest to change formation of $field_state element with key "'items_count'" to:
'items_count' => is_array($items) ? count($items) : count(array($items)),

Move DateTimeItem and DateRangeItem constants onto interfaces.

$
0
0

Problem/Motivation

DateTimeItem and DateRangeItem both have class constants. These should be on interfaces.

Proposed resolution

- Move the DateTimeItem constants onto DateTimeItemInterface as-is.

- Create DateRangeItemInterface, and move DateRangeItem constants as-is.

- Update usages to refer to the interface or static:: as appropriate.

Remaining tasks

User interface changes

API changes

Data model changes

StringFormatter shows link for entities that might not have a canonical URL

$
0
0

Problem/Motivation

The Drupal\Core\Field\Plugin\Field\FieldFormatter\StringFormatter checks in its ::settingsForm method on the entity type, whether it has a canonical link template. That is correct.

However, it also checks for canonical link template existence within ::viewElements on the entity type. Since single entity instance are allowed to define whether they have a canonical link template on their own via EntityInterface::hasLinkTemplate, the StringFormatter should respect that accordingly.

Steps to reproduce

Proposed resolution

Replace the check on entity type level within StringFormatter::viewElements by a check on the entity itself.
Meaning changing this line

if ($this->getSetting('link_to_entity') && !$entity->isNew() && $entity_type->hasLinkTemplate('canonical')) {
to
if ($this->getSetting('link_to_entity') && !$entity->isNew() && $entity->hasLinkTemplate('canonical')) {

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

[meta] Release Drupal 11, possibly in 2024

[meta] Requirements for tagging Drupal 11.0.0-beta1

$
0
0

Must-haves prior to tagging 11.0.0-beta1

We can eventually file child metas for these, but a list is sufficient for now.

  1. Fully support PHP versions above the Drupal 11 minimum
  2. Update or decouple/remove PHP (Composer) dependencies.
    • Symfony:
      • Update to Symfony 7
    • Shift incorrect production dependencies to dev:
      • None at present
    • Re-evaluate other backend dependencies in the year prior to the release.
  3. Update or decouple/remove frontend dependencies.
    • jQuery UI:
    • jQuery
  4. Remove all deprecated code, libraries, and BC layers.
    • (needs issue) [META] Remove deprecated modules and themes from the Drupal 11 branch
    • (needs issue) [META] Remove deprecated classes, methods, procedural functions and code paths outside of deprecated modules on the Drupal 11 branch
  5. Resolve critical 10.x -> 10.x upgrade path bugs.
  6. (needs issue) Remove old upgrade paths up to 10.x.0 and add new database dumps.
  7. Resolve any significant outstanding bugs for new platform requirements (PHP, Composer, etc.)
  8. Resolve any 11.0.x-only security or data integrity issues.
  9. Resolve other D11-only upgrade blockers.
  10. Update all dependencies (backend and frontend) to their latest versions immediately before tagging 11.0.0-beta1.

Should-haves prior to tagging 11.0.0-beta1

These become beta targets if they are not completed by the deadline, and may contribute to other adjustments to the schedule (TBD).

  1. Issues TBD.

Refactor Claro's accordion stylesheet

$
0
0

Problem/Motivation

This is part of the CSS modernization initiative, and intended to be worked on by our Google Summer of Code student only. This is intended to be a straightforward first issue to easily onboard the student.

Steps to reproduce

The stylesheet at https://git.drupalcode.org/project/drupal/-/blob/10.0.x/core/themes/clar... needs to be refactored to make use of modern CSS and Drupal core's PostCSS tooling.

Proposed resolution

  • Use CSS Logical Properties where appropriate
  • Use CSS nesting where appropriate

Remaining tasks

  • We need two patches. One for Drupal 9.5.x and one for Drupal 10.0.x
  • We need a followup issue to refactor this component in Drupal 10.0.x to make use of component-level CSS custom properties.

User interface changes

None. There should be no visual differences.


Roadmap to CKEditor 5 stable in Drupal 9

$
0
0

This lays out what remains to be done after #3231364: Add CKEditor 5 module to Drupal core lands in Drupal core.

This plan was originally taken from the IS at #2966864: Add optional support for CKEditor 5 in D9 so we can remove CKE 4 from Drupal 10, and after that from #3201824: Roadmap to core.

Roadmap to Stable

  1. Ensure that sites can update from using CKE4 to CKE5 safely when using no contributed CKEditor modules
    1. #3268306: [upstream] [GHS] Custom/unofficial HTML tags not retained: <drupal-media>, <drupal-entity>, <foobar>
  2. ✅ Ensure contrib modules can do everything: translations, automatic upgrade path from CKE4 …
    1. Currently none
  3. ✅ Ensure CKE5 equivalent plugins of CKE4 generate/support equivalent markup: #3222801: [META] Ensure CKE5 equivalent plugins of CKE4 generate/support equivalent markup
    1. Currently none
  4. Ensure CKE5 functionality matches that of Drupal core's CKE4:
    1. #3222756: [upstream] Allow using images from external source
    2. #3222797: Upgrade path from CKEditor 4's StylesCombo to CKEditor 5's Style
  5. ✅ Documentation gates:
    1. Currently none
  6. ✅ Theming CKEditor 5
    1. Currently none
  7. Accessibility
    1. #3283800: [upstream] CKE5 dropdowns keyboard support
    2. #3283801: [upstream] CKE5 dropdown focus handling is not fully accessible
    3. #3283802: [upstream] CKE5 iOS dictation not working
    4. #3283803: [upstream] CKE5 toggleable toolbar items not enough contrast
    5. #3283804: [upstream] CKE5 dropdown screenreader support
  8. Test coverage, reliability and maintainability matching or exceeding CKEditor 4's:
    1. #3268983: [regression] FilterHtml throws Unsupported operand types error when * used in tag attribute
  9. ✅ Low-hanging fruit major UX improvements over CKEditor 4:
    1. Currently none
  10. Superior configuration UX:
    1. #3245967: Messages upon switching to CKEditor 5 are overwhelming
  11. ✅ Performance
    1. Currently none.

Roadmap after Stable

  1. Upstream Drupal improvements that would simplify or improve CKEditor 5:
    1. #3226673: API addition: \Drupal\editor\Plugin\EditorPluginInterface::getDefaultSettings() should accept old Editor + Format to generate smart defaults
    2. #3230829: editor_form_filter_format_form_alter() does not remove "editor_plugin" from form state when needed
    3. #3231322: Fix a @todo: move a form alteration to the CKEditor 5 plugin's subform definition
    4. #3231341: Deprecate EditorLinkDialog and EditorImageDialog in Drupal 9, remove in Drupal 10
    5. #3231342: Introduce ConfigEntityForm to standardize use of validation constraints for config entities
    6. #3231347: Add Editor::setFilterformat()
    7. #3231354: [META] Discuss: merge the Editor config entity into the FilterFormat config entity
    8. #3246260: [PP-1] Simplify CKEditor5ImageController once #2940383 lands
    9. #3263668: [PP-1] Re-enable inline form errors in assessActiveTextEditorAfterBuild function→ blocked on Vertical Tabs bug: #2911932: Correct vertical tab does not focus on form validation
    10. #3269101: [PP-1] Ensure enabled CKEditor 5 plugins remain available by calculating corresponding dependencies→ blocked on Text Editor module bug: #2950795: CKEditor 4+5 plugin module dependency not added to text format configuration
  2. Obsoleteness of upgrade path in Drupal 11:
    1. #3239012: [late 2023] Deprecate the upgrade path from CKEditor 4
  3. Performance:
    1. #3224261: [PP-2] Front-end performance: concatenate CKEditor 5 JS assets for every unique configuration
  4. Media improvements
    1. #3196593: Ease the transition to Media: save image uploads in CKEditor 5 as media entities when media is enabled? (or module specific solution if core issue won't land)
    2. #3073901: Determine an upgrade path from CKEditor image button to media library (or module specific solution if core issue won't land)
  5. Low-hanging fruit major UX improvements over CKEditor 4:
    1. #3227354: Add support for ckeditor5-autoformat
    2. #3274635: Use CKEditor 5's native <ol type> and <ul type> UX
  6. Superior configuration UX:
    1. #3225033: Whenever "Enable image uploads" is enabled for a text editor, the editor_file_reference filter should be enabled
    2. #3227948: Hide incompatible filters
  7. Maintainability:
    1. #3248432: [drupalImage] Split DrupalImageEditing into multiple plugins
    2. #3273746: Move media-embed-error class styling from core themes to CKEditor 5
    3. #3275237: Don't convert, instead use response.entity_type in DrupalImageUploadEditing

Completed

This section mimics the structure of the above sections.

💯 Roadmap to Alpha

  1. ✅ Create the ckeditor5 module
  2. ✅ Create an @Editor PHP plugin with the ID ckeditor5.
  3. ✅ Create a Drupal.editors JS plugin with the ID ckeditor5.
  4. ✅ Getting CKE5 (CKEditor 5) to load at all on the /node/add/article form.
  5. #3201820: Manually test that CKE 5 can be used in off-canvas
  6. ✅ Enable a Drupal + CKE5 ecosystem
    1. #3196178: Provide test module to verify contrib can extend CKEditor5
    2. #3200008: Validation and editor settings
  7. ✅ A CKE5 configuration UI
    1. #3198297: Toolbar UI for selecting and sorting buttons
  8. ✅ Ensure Quick Edit integration works
    1. #3201648: Add test coverage for Quick Edit integration
    2. #3205090: Field html not restored when cancelling Quick Edit
  9. ✅ Evaluate CK4 plugins and match features
    1. #3194650: Support media elements and browse media library
    2. #3194111: Support inline image upload
    3. #3201646: Add support for image caption (<img data-caption>)
  10. #3201821: Add JavaScript test coverage for CKE 5
  11. #3206686: IE11 warning for CKE5 in Drupal 9

💯 Roadmap to Beta

  1. #3215506: Plugins should be enableable based on toolbar configuration
  2. ✅ Ensure filter_html's HTML restrictions are respected inside CKE5 — tackled in #3201637: Figure out how to prevent data loss during upgrade/migration path
  3. #3206687: Toolbar UI accessibility review
  4. #3201641: Improve the HTML filter configuration UX
  5. Enable translation features for CKEditor 5
    1. #3202664: CKEditor 5's UI language should match Drupal's interface translation

Roadmap to Stable

  1. Ensure that sites can update from using CKE4 to CKE5 safely when using no contributed CKEditor modules
    1. Ensure that Arbitrary HTML is not lost: #3216021: Automatically use CKE5's General HTML Support feature on text formats without any TYPE_HTML_RESTRICTOR filter + add `sourceEditing` button
    2. #3201637: Figure out how to prevent data loss during upgrade/migration path
    3. #3216015: Generate CKEditor 5 configuration based on pre-existing text format configuration
    4. #3245079: Automatic upgrade path always enables all <h*> tags when only >=1 was enabled before
    5. #3245320: Automatic upgrade path always disables image uploads — in the UI
    6. #3228464: API for contrib projects to load CKEditor translations
    7. #3227822: [GHS] Ensure GHS works with our custom plugins, to allow adding additional attributes
    8. #3268174: Bug in CKE 4 → 5 upgrade path "format" does not always map to "heading", it could map to "codeBlock" too, or both, or neither
    9. #3269868: [drupalImage] Some Image attributes are lost in edge cases where image upcasts into inline image
    10. #3273527: Upgrade path never configures the ckeditor5_heading plugin to allow <h1>
    11. #3273312: Upgrading from CKEditor 4 for a text format that has FilterInterface::TYPE_MARKUP_LANGUAGE filters enabled
    12. #3268318: [drupalMedia] <a> with GHS allowed attributes downcast wraps data-caption with <a>
    13. #3230230: Enable table captions; override CKE5's default downcast to generate <table><caption></table> instead of <figure><table><figcaption></figure>
    14. #3268311: [upstream] [drupalMedia] GHS-enabled markup in data-caption crashes CKEditor 5
    15. #3272516: Deprecate FilterInterface::getHTMLRestrictions()' forbidden_tags functionality
    16. #3273510: CKEditor 5 crash when multiple alignment buttons are activated due to duplicate configuration thanks to #3259593: Alignment being available as separate buttons AND in dropdown is confusing
    17. #3247634: [upstream] [drupalImage] Unlinking linked inline images while GHS is enabled: wrapping <a> is impossible to remove
    18. #3271418: [upstream] [drupalMedia] Linked media wrapped with <div> doesn't upcast correctly
    19. #3274651: Impossible to enable <ol type> or <ul type> with GHS: switch to List's successor, DocumentList
    20. #3276217: [drupalMedia] add tests to confirm GHS attributes are retained in linked media
    21. #3273983: Do not assume that plugin supporting <tag attr> also supports <tag> in SourceEditingRedundantTags and upgrade path
  2. Ensure contrib modules can do everything: translations, automatic upgrade path from CKE4 …
    1. #3226335: Follow-up for #3216015: allow contrib & custom Drupal modules providing CKEditor 4 plugins to specify their CKEditor 5 equivalents + settings to be migrated
    2. #3228778: Drupal-specific CKEditor 5 plugins should be able to use Drupal's JS translation API: Drupal.t()
    3. #3245723: Follow-up for #3201637: omitting PrimitiveTypeConstraint violations for filter settings is implemented too broadly
    4. #3245807: DX: allow contrib modules to subclass \Drupal\Tests\ckeditor5\Kernel\ValidatorsTest
    5. #3274278: Migrate "codetag" contrib CKEditor 4 plugin to built-in equivalent in core's CKEditor 5
    6. #3273325: CKE5 and contrib: better "next action" description on upgrade path messages
  3. Ensure CKE5 equivalent plugins of CKE4 generate/support equivalent markup: #3222801: [META] Ensure CKE5 equivalent plugins of CKE4 generate/support equivalent markup
    1. Infra: #3215466: Attribute values not accounted for in CKEditor5PluginManager::getProvidedElements
    2. Infra: #3207660: Allow using a subset of the tags supported by the enabled CKEditor 5 plugins
    3. #3222851: <cite>
    4. #3222847: <img width height>
    5. #3222838: Configure basicStyles.Italic to output <em> instead of <i>
    6. #3222842: <a hreflang> + <blockquote cite>
    7. #3222847: <img width height>
    8. #3220293: Make all supported heading types visible in the UI
    9. #3222840: <ol start>
    10. #3222852: <dl> <dt> <dd> by introducing "Manually editable HTML tags" configuration on Source Editing
    11. #3224256: <h* id> (or more generically: <$block id>)
    12. #3222808: Follow-up for #3201646: markup in image captions is lost
    13. #3228346: Follow-up for #3222852: revert ineditable attributes (<blockquote cite> and <a hreflang>) now that Source Editing plugin can handle arbitrary elements & attributes
    14. #3246168: Images are not linkable through UI; already linked images are unlinked (data loss!)
    15. #3246169: Embedded media are not linkable through UI; already linked embedded media are unlinked (data loss!)
    16. #3259493: [GHS] Unable to limit attribute values: ::allowedElementsStringToHtmlSupportConfig() does not generate configuration that CKEditor 5 expects
    17. #3246365: [drupalMedia] Show the Image Media's default alt text that is being overridden
    18. #3260853: [GHS] Partial wildcard attributes (<foo data-*>, <foo *-bar-*>, <foo *-bar>) and attribute values (<h2 id="jump-*">) not yet supported
    19. #3260869: Resolve mismatch between <$block> interpretation by CKEditor 5 and Drupal
    20. #3268860: Elements wrapping <drupal-media> are not retained
    21. #3268307: $block wildcard resolves into a superset of the actual $block tags
  4. Ensure CKE5 functionality matches that of Drupal core's CKE4:
    1. #3201646: Add support for image caption (<img data-caption>)
    2. #3211050: Add "Alignment" plugin
    3. #3211125: Add "Block Indentation" plugin, but only allow list indentation
    4. #3211282: Add plugins which are provided as a part of essential plugin: Undo/Redo
    5. #3211610: Add "Horizontal line" plugin.
    6. #3227871: Add ckeditor5-paste-from-office to allow pasting from Microsoft Office & Google Docs
    7. #3227875: Add ckeditor5-remove-format to allow removing formatting from pasted content
    8. #3227890: Add ckeditor5-special-characters to allow inserting special characters for users that do not know the native picker
    9. #3247246: Attribute value encoding not compatible with Xss::filter()
    10. #3248448: Dialog loading text is unstyled
    11. #3260554: [drupalMedia] Support alignment on <drupal-media>
    12. #3246380: [drupalMedia] Media previews do not update after alt text was modified
    13. #3224652: [drupalImage] Add ckeditor5-image's imageresize plugin to allow image resizing
    14. #3246385: [drupalMedia] Support captions on <drupal-media>
    15. #3264775: [drupalMedia] Toolbar should be visible when element inside <drupalMedia> is focused
    16. #3264727: [drupalMedia|drupalImage] Allow removing data-align in the UI, and making an image inline
    17. #3245950: [upstream] <script> tag support in GHS
    18. #3256566: [upstream] <style> tag support in GHS
    19. #3263384: Add ckeditor5-code-block package and CodeBlock plugin
    20. #3245720: [drupalMedia] Support choosing a view mode for <drupal-media>
    21. #3276974: [drupalMedia] Media View Modes don't work if alignment not enabled
    22. #3269657: [drupalMedia] The CKEditor 4 → 5 upgrade path for the media_embed filter should not forcefully allow the `data-view-mode` attribute on `<drupal-media>`
    23. #3274937: Get CKEditor 5 to work in (modal) dialogs
  5. ✅ Documentation gates:
    1. #3205654: ckeditor5_hook_help()
    2. #3201186: Create ckeditor5.api.php (the core equivalent of README.md) + CKEditor5PluginDefinition::toArray()
    3. #3243850: hook_ckeditor5_plugin_info_alter()'s example sets ['drupal']['config'], but that's not one of the documented definition properties
    4. #3248430: Improve Drupal.ckeditor5 documentation
    5. #3248425: Ensure that all classes and functions in Drupal-specific CKEditor 5 plugins are documented
  6. Theming CKEditor 5
    1. #3202666: Follow-up for #3198297 Improve admin CSS DX
    2. #3194084: Support functionality equivalent to ckeditor_stylesheets
  7. Accessibility
    1. #1872206: Improve CKEditor toolbar configuration accessibility
    2. #3218252: Toolbar configuration fieldset aria cleanup
    3. #3218260: Safari focus outline on buttons leaves artifacts after blur
    4. #3207451: Toolbar UI Button size accessibility
    5. #3238257: Fragment link pointing to <textarea> should be redirected to CKEditor 5 instance when CKEditor 5 replaced that textarea
    6. #3245735: Follow-up for #3222852: validation errors are not associated with the correct form element
    7. #3258030: Text fields using CKEditor 5 do not get visual error indicator
    8. #3258668: Extraneous closing parentheses and curly brace in visually-hidden button description text
    9. #3231321: Improve keyboard accessibility in a particular edge case
    10. #3261942: Compatibility issues with inline form errors
    11. #3218297: Voiceover + Safari reads aria-describedby twice when focusing toolbar button
    12. #3248440: [drupalMedia] Media embed attributes are rendered in container div in editing view
    13. #3239423: Toolbar UI accessibility review: round 2
    14. #3270112: Excessive aria-live announcing from ckeditor5-admin-help-message live region
    15. #3270110: Toolbar config items missing "press arrow to do {x}" instructions for screenreaders
    16. #3270108: Editor does not load when using Edge + WHCM
    17. #3222757: [drupalImage] Make image alt text required or strongly encouraged
  8. Test coverage, reliability and maintainability matching or exceeding CKEditor 4's:
    1. #3206522: Add FunctionalJavascript test coverage for media library
    2. #3201641: Improve the HTML filter configuration UX
    3. #3228920: Improve internal consistency: consistent variable names and return type syntax
    4. #3231327: Plugin definition DX: validate ckeditor5.drupal.elements items
    5. #3231362: Refactor ImageUpload's ::validateImageUploadSettings() into the proper validate and submit methods
    6. #3228505: Plugin definition DX: automatically check for plugin definitions whether their ::getDefaultSettings() matches the config schema
    7. #3243867: ckeditor5_module_implements_alter() looks like it has incorrect logic
    8. #3245400: Add an @throws PHPDoc everywhere exceptions are thrown
    9. #3246280: Defense in depth: add anti-CSRF token to this module's routes
    10. #3246521: Make plugin.manager.ckeditor4to5upgrade.plugin a private service
    11. #3246524: Make more (all?) classes @internal
    12. #3247711: Simplify and accelerate builds: update our use of the CKEditor 5 DLL manifest
    13. #3248188: Plugin definition DX: validate drupal.conditions
    14. #3248423: Decide how CKEditor 5-provided types should be referenced
    15. #3259174: Add missing CKE5 SmartDefaultSettings test coverage (wildcard tag with unsupported attribute)
    16. #3228334: Refactor HTMLRestrictionsUtilities to a HtmlRestrictions value object
    17. #3206523: Add FunctionalJavascript test coverage for image upload
    18. #3267721: Add DrupalCI step for ensuring that CKEditor 5 build files are build correctly
    19. #3231337: [drupalMedia] Remove manual dataDowncast from DrupalMediaEditing
    20. #3231328: SmartDefaultSettings should select the CKE5 plugin that minimizes creation of HTML restriction supersets
    21. #3228580: Follow-up for #3222852: additional test coverage for real-time validation race conditions
    22. #3265626: Changes to "Manually editable HTML tags" lost if form is submitted without triggering AJAX
    23. #3231334: Global attributes (<* lang> and <* dir="ltr rtl">): validation + support (fix data loss)
    24. #3229078: Unit tests for all @CKEditor5Plugin plugin classes
    25. #3247683: Disable CKEditor 5's automatic link decorators (in Drupal filters should be used instead)
  9. Low-hanging fruit major UX improvements over CKEditor 4:
    1. #3261599: Use CKEditor 5's native <ol start> support (and also support <ol reversed>)
  10. Superior configuration UX:
    1. #3201641: Improve the HTML filter configuration UX
    2. #3216015: Generate CKEditor 5 configuration based on pre-existing text format configuration
    3. #3226694: Follow-up for #3216015: refactor SmartDefaultSettings to return messages rather than sending them
    4. #3248177: Language toolbar item cannot be removed from the toolbar
    5. #3259443: Plugin settings do not appear when a configurable plugin is added AFTER removing all buttons
    6. #3261585: Remove IE11 warning for CKEditor 5 in Drupal 10, since Drupal 10 does not support IE anyway
    7. #3260857: Expand SourceEditingRedundantTagsConstraintValidator to also check attributes and attribute values
    8. #3261943: Confusing behavior after pressing "Apply changes to allowed tags" with invalid value
    9. #3228691: Restrict allowed additional attributes to prevent self XSS
  11. Performance
    1. #3248469: Research if the CKE off-canvas CSS reset could be optimized
    2. #3264512: Enable aggregation for CKEditor 5 assets
    3. #3260032: CKEditor 5 adds ie11.user.warnings library to every page, triggering a FOUC even for anonymous users
  12. ✅ Moving things into core that can only happen once it is in core:
    1. #3231324: Use core icons where possible after moving to core
    2. #3231325: Use pre-existing filter format config from YAML instead of duplicating it in PHP

Add trim to all text field submissions

$
0
0

Problem

  • Form handlers and API code manually calls trim() on values too many times.
  • It's unclear who is responsible for trimming text values / user input.
  • The lack of custom trim() calls can trigger error messages that are hard to recognize and resolve by a user, in case a submitted form value contains leading or trailing white-space (which is not visible/apparent).

Proposed solution

  1. Introduce a generic #trim property for all form elements that accept #input.
  2. Make #trim default to TRUE for all form element types that accept text as user input.
  3. Process #trim directly in form_handle_input_element(). If the resulting #value is an empty string, trigger the regular processing flow that would be triggered for no user input - including #required validation.
  4. Allow code that does not want this behavior to opt-out by setting #trim to FALSE. (There's no use-case for that in core, but still...)
  5. Remove all manual calls into trim() from API code. Whoever is calling into APIs is expected to provide proper (trimmed) values.

Original summary:

If the user registers and by mistake includes and extra space before or after their email address, the system will reject the email address with an error message that is difficult to understand (as there is nothing obvious wrong with the email address). I have seen this several times when I paste my email address into the email address box and mistakenly include a trailing space. I just tried it on the Drupal.org site and got the error:

"The e-mail address testaccount@test.org is not valid."

My guess is that this problem might affect 2-3% of all users who ever try to set up Drupal accounts and leave them a bit frustrated.

It would be very easy to have the form on the page user/register trim the spaces off of the email address, to solve this problem.

Redirects being built as http://localhost:8888/drupal8 and not considered safe by RedirectResponseSubscriber

drupal_rewrite_settings should replace existing variables in settings.php, not just append

$
0
0

Problem/Motivation

The core installer in D8 appends the database configuration at the end of the settings.php file, instead of after the $databases structure is documented, currently around line 220. For a person new to setting up Drupal this makes managing the settings file more confusing than it needs to be. For example, the documentation around the $databases variable is near the top of the file whereas the variable is added at the end.

Note: D7 and older used to work that way, so this is a regression.

Steps to reproduce

Run the site installer with a codebase that does not have an existing settings.php file present.

Proposed resolution

Change drupal_rewrite_settings() so that it replaces variables that already exist in the file rather than appending them.

Remaining tasks

Work out a fix to drupal_rewrite_settings() that replaces variables which already exist in the file.
Add test coverage.

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Release notes snippet

TBD

Abstract and refactor Olivero's text color styles with new "text-color" custom properties

$
0
0

Background

The Olivero theme utilizes CSS variables in a very basic fashion. We declare colors like --color--primary-30, --color--primary-40, --color--primary-50, --color--primary-60,
--color--gray-5, --color--gray-10, --color--gray-20, --color--gray-45, --color--gray-60, etc.

We then utilize these variables directly within the component styles like

.breadcrumb__link {
  color: var(--color--primary-40);
}

Task

This task is to create an abstraction layer between the color custom properties and the component's CSS rules.

So, in the case above, we'd define a new variable scoped to :root something like --color-text-primary-medium and set that to var(--color--primary-40)

Then within the component stylesheet, we'd set the rule to use the new --color-text-primary-medium property.

.breadcrumb__link {
  color: var(--color-text-primary-medium); /* Needs to maintain a 4.5:1 contrast ratio against --color-xyx */
}

To be determined

Still to be determined are all of the variables that we will need to create. We may also have the opportunity to consolidate colors (if we do this, we'll need Olivero designer sign off).

Resources

A list of CSS color properties, selectors, and values is at https://docs.google.com/spreadsheets/d/19zkRfD4CogL8ZUbIirpHpAH2Xh9ma6Va...

Viewing all 296681 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>