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

Using GET Method On Form Elements With Ajax Callback

$
0
0

Problem/Motivation

Non-ajax response is returned from the Ajax callback of form elements when "httpMethod" property is set to "GET". This is likely due to the Form Builder class not recognizing the correct request method of the request and causing user input to be loaded from the wrong request property. ($request->query vs $request->request). Because of that, the event subscriber of the form builder is skipped.

Steps to reproduce

Add "a #ajax" callback to any form element in form alter with "httpMethod" set to "GET"

Proposed resolution

Ajax callback should return the same response as using "POST" method.

With the change Ajax request type can be set to GET (POST by default) in place, we want to improve the performance of our forms which include elements that we have "#ajax" callback added programmatically. The callbacks of these elements are mainly used to refresh a view programmatically based on user's selection. However, after adding the "httpMethod" parameter to the "#ajax" array, the AJAX callback began returning the HTML of the home page instead instead of the old JSON response.

After doing a bit of debugging inside the Core's code, we found that the "formBuilder" class depends on the "isMethodType" method from "formState" class to determine where user input is stored and then determine whether a request is a regular or AJAX request based on if the user input is empty or not.

isMethodType used

methods

We then found that the "method" property retains its default value of "POST" regardless if the request is using GET or POST method and we don't see that the property is being set or updated anywhere. The actual method of the HTTP request is stored in another property called "requestMethod". Given our findings, since "isMethodType" is the method that's being used in formBuilder, we believe that the issue we encountered with our custom code's AJAX callback not being triggered stems from the "formBuilder" failing to locate user input in the request, leading it to misidentify the request as a regular one instead of an AJAX request.

I'm not sure if this is something that was overlooked in the previous issue or using GET isn't recommended (or allowed) in custom #ajax callbacks?

Any enlightenment would be appreciated.


Menu Link autocomplete widget does not honour content type available menus settings

$
0
0

Problem/Motivation

When adding a new menu link to a Menu, the Link autocomplete widget should not return results for nodes whose Content Type does not have that parent menu checked off under the Available Menus.

The node edit page honours the available menus for a content type, but when trying to add nodes to a menu from the menu link form the autocomplete returns 10 results encompassing all content types. This becomes unruly when more than 10 nodes have similar names with no way to filter the results.

Steps to reproduce

For a proposed Content Type of 'News': /admin/structure/types/manage/news
Edit > Menu Settings > Available Menus
- Uncheck all available menus

Add a menu link to the Main navigation: /admin/structure/menu/manage/main/add
- Start typing the title of a 'News' node in the Link autocomplete widget
- News nodes return in the autocomplete despite being unchecked in all the available menus

Proposed resolution

Have the menu link autocomplete widget only return nodes that belong to content types that have the parent menu checked off in the available menus.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Allow multiple submits of form[method="dialog"]

$
0
0

Problem/Motivation

Drupal has build in protection of submitting forms twice.
This applies to ''submit.singleSubmit'' and "form:not([method~="GET"])".
The second means all forms which are not method GET. This would include get (because case insensitive i not used) post, dialog and a form without a method (defaults to GET).

This feature prevents you from closing dialogs twice.

Steps to reproduce

<dialog>
<form method="dialog">
  <button>close</button/>
</form>
</dialog>

Proposed resolution

'form:not([method~="GET" i]):not([method~="dialog" i])'

allow submitting dialog twice
also check for method="get"

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Pages with multiple instances on CKEditor 5 are unnecessary slow

$
0
0

Problem/Motivation

We have nodes with paragraphs which contain ckeditor 5 instances.
Now i know i could load the paragraphs in a closed state but this is not what we're doing.

We're currently optimizing the author performance and benchmark the application with Blackfire and saw that a lot of code is executed for each instance of Ckeditor which i think we should be able to cache for each text editor format?

See the attachments of the timeline and the zoom into the getAttachments functions which i think we should be able to statically cache for each text editor format?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Migrate translated entity reference from D7 to D8

$
0
0

Problem/Motivation

When migrating entity reference fields from a multilingual D7 site to a multilingual D8 site, I get the following error:

"Value is not a valid entity." line 106 on core/lib/Drupal/Core/Entity/Plugin/DataType/EntityReference.php

This happens because core expects the entity reference value expects either a scalar value(like an ID) or an object typed as EntityInterface and the migration is sending it an array with ID and langcode.

Proposed resolution

I imagine one solution would be to allow sending both ID and langcode as parameters for an entity load, but I'm not sure how that would work exactly. I have a workaround for now that I'll describe in detail on the comments bellow.

Add validation constraints to user.mail

$
0
0

Problem/Motivation

user.mail is fully validatable

./vendor/bin/drush config:inspect --filter-keys=user.mail --detail --list-constraints  --fields=key,validatability,constraints
➜  🤖 Analyzing…

 ---------------------------------------------------- ------------- ---------------------------------------------------------
  Key                                                  Validatable   Validation constraints
 ---------------------------------------------------- ------------- ---------------------------------------------------------
  user.mail                                            100%          ValidKeys: '<infer>'
                                                                     LangcodeRequiredIfTranslatableValues: null
   user.mail:                                          Validatable   ValidKeys: '<infer>'
                                                                     LangcodeRequiredIfTranslatableValues: null
   user.mail:_core                                     Validatable   ValidKeys:
                                                                       - default_config_hash
   user.mail:_core.default_config_hash                 Validatable   NotNull: {  }
                                                                     Regex: '/^[a-zA-Z0-9\-_]+$/'
                                                                     Length: 43
                                                                     ↣ PrimitiveType: {  }
   user.mail:cancel_confirm                            Validatable   ValidKeys: '<infer>'
   user.mail:cancel_confirm.body                       Validatable   Regex:
                                                                       pattern: '/([^\PC\x09\x0a\x0d])/u'
                                                                       match: false
                                                                       message: 'Text is not allowed to contain control
                                                                     characters, only visible characters.'↣ PrimitiveType: {  }
   user.mail:cancel_confirm.subject                    Validatable   Regex:
                                                                       pattern: '/([^\PC])/u'
                                                                       match: false
                                                                       message: 'Labels are not allowed to span multiple
                                                                     lines or contain control characters.'
                                                                     NotBlank: {  }
                                                                     ↣ PrimitiveType: {  }
   user.mail:langcode                                  Validatable   NotNull: {  }
                                                                     Choice:
                                                                       callback:
                                   'Drupal\Core\TypedData\Plugin\DataType\LanguageReferenc
                                                                     e::getAllValidLangcodes'↣ PrimitiveType: {  }
   user.mail:password_reset                            Validatable   ValidKeys: '<infer>'
   user.mail:password_reset.body                       Validatable   Regex:
                                                                       pattern: '/([^\PC\x09\x0a\x0d])/u'
                                                                       match: false
                                                                       message: 'Text is not allowed to contain control
                                                                     characters, only visible characters.'↣ PrimitiveType: {  }
   user.mail:password_reset.subject                    Validatable   Regex:
                                                                       pattern: '/([^\PC])/u'
                                                                       match: false
                                                                       message: 'Labels are not allowed to span multiple
                                                                     lines or contain control characters.'
                                                                     NotBlank: {  }
                                                                     ↣ PrimitiveType: {  }
   user.mail:register_admin_created                    Validatable   ValidKeys: '<infer>'
   user.mail:register_admin_created.body               Validatable   Regex:
                                                                       pattern: '/([^\PC\x09\x0a\x0d])/u'
                                                                       match: false
                                                                       message: 'Text is not allowed to contain control
                                                                     characters, only visible characters.'↣ PrimitiveType: {  }
   user.mail:register_admin_created.subject            Validatable   Regex:
                                                                       pattern: '/([^\PC])/u'
                                                                       match: false
                                                                       message: 'Labels are not allowed to span multiple
                                                                     lines or contain control characters.'
                                                                     NotBlank: {  }
                                                                     ↣ PrimitiveType: {  }
   user.mail:register_no_approval_required             Validatable   ValidKeys: '<infer>'
   user.mail:register_no_approval_required.body        Validatable   Regex:
                                                                       pattern: '/([^\PC\x09\x0a\x0d])/u'
                                                                       match: false
                                                                       message: 'Text is not allowed to contain control
                                                                     characters, only visible characters.'↣ PrimitiveType: {  }
   user.mail:register_no_approval_required.subject     Validatable   Regex:
                                                                       pattern: '/([^\PC])/u'
                                                                       match: false
                                                                       message: 'Labels are not allowed to span multiple
                                                                     lines or contain control characters.'
                                                                     NotBlank: {  }
                                                                     ↣ PrimitiveType: {  }
   user.mail:register_pending_approval                 Validatable   ValidKeys: '<infer>'
   user.mail:register_pending_approval.body            Validatable   Regex:
                                                                       pattern: '/([^\PC\x09\x0a\x0d])/u'
                                                                       match: false
                                                                       message: 'Text is not allowed to contain control
                                                                     characters, only visible characters.'↣ PrimitiveType: {  }
   user.mail:register_pending_approval.subject         Validatable   Regex:
                                                                       pattern: '/([^\PC])/u'
                                                                       match: false
                                                                       message: 'Labels are not allowed to span multiple
                                                                     lines or contain control characters.'
                                                                     NotBlank: {  }
                                                                     ↣ PrimitiveType: {  }
   user.mail:register_pending_approval_admin           Validatable   ValidKeys: '<infer>'
   user.mail:register_pending_approval_admin.body      Validatable   Regex:
                                                                       pattern: '/([^\PC\x09\x0a\x0d])/u'
                                                                       match: false
                                                                       message: 'Text is not allowed to contain control
                                                                     characters, only visible characters.'↣ PrimitiveType: {  }
   user.mail:register_pending_approval_admin.subject   Validatable   Regex:
                                                                       pattern: '/([^\PC])/u'
                                                                       match: false
                                                                       message: 'Labels are not allowed to span multiple
                                                                     lines or contain control characters.'
                                                                     NotBlank: {  }
                                                                     ↣ PrimitiveType: {  }
   user.mail:status_activated                          Validatable   ValidKeys: '<infer>'
   user.mail:status_activated.body                     Validatable   Regex:
                                                                       pattern: '/([^\PC\x09\x0a\x0d])/u'
                                                                       match: false
                                                                       message: 'Text is not allowed to contain control
                                                                     characters, only visible characters.'↣ PrimitiveType: {  }
   user.mail:status_activated.subject                  Validatable   Regex:
                                                                       pattern: '/([^\PC])/u'
                                                                       match: false
                                                                       message: 'Labels are not allowed to span multiple
                                                                     lines or contain control characters.'
                                                                     NotBlank: {  }
                                                                     ↣ PrimitiveType: {  }
   user.mail:status_blocked                            Validatable   ValidKeys: '<infer>'
   user.mail:status_blocked.body                       Validatable   Regex:
                                                                       pattern: '/([^\PC\x09\x0a\x0d])/u'
                                                                       match: false
                                                                       message: 'Text is not allowed to contain control
                                                                     characters, only visible characters.'↣ PrimitiveType: {  }
   user.mail:status_blocked.subject                    Validatable   Regex:
                                                                       pattern: '/([^\PC])/u'
                                                                       match: false
                                                                       message: 'Labels are not allowed to span multiple
                                                                     lines or contain control characters.'
                                                                     NotBlank: {  }
                                                                     ↣ PrimitiveType: {  }
   user.mail:status_canceled                           Validatable   ValidKeys: '<infer>'
   user.mail:status_canceled.body                      Validatable   Regex:
                                                                       pattern: '/([^\PC\x09\x0a\x0d])/u'
                                                                       match: false
                                                                       message: 'Text is not allowed to contain control
                                                                     characters, only visible characters.'↣ PrimitiveType: {  }
   user.mail:status_canceled.subject                   Validatable   Regex:
                                                                       pattern: '/([^\PC])/u'
                                                                       match: false
                                                                       message: 'Labels are not allowed to span multiple
                                                                     lines or contain control characters.'
                                                                     NotBlank: {  }
                                                                     ↣ PrimitiveType: {  }
 ---------------------------------------------------- ------------- ---------------------------------------------------------

Steps to reproduce

  1. Get a local git clone of Drupal core 11.x.
  2. composer require drupal/config_inspector— or manually install https://www.drupal.org/project/config_inspector/releases/2.1.5 or newer (which supports Drupal 11!)
  3. composer require drush/drush
  4. vendor/bin/drush config:inspect --filter-keys=user.mail --detail --list-constraints

Proposed resolution

Add validation constraints to:

  1. user.mail

Remaining tasks

None

User interface changes

None.

API changes

None.

Data model changes

More validation 🚀

Release notes snippet

None.

[PP-1] Override Symfony's Choice Constraint

$
0
0

Problem/Motivation

In order to add validation constraints to all user role configuration #3445215: Add validation constraints to user.role.*, it was necessary to add a new public static function (getAllValidPermissions() it was necessary to add a convenience callback to be used as a choice validator that only called one method on a Drupal service:

return array_keys(\Drupal::service('user.permissions')->getPermissions());

This isn't the only place where will need to create additional functions that only return valid choices. If we want to make all configuration in Drupal fully validatable then there are many places where we need to do something similar.

For instance, the same thing was done in /core/modules/editor/src/Entity/Editor.php:

 /**
  * Computes all valid choices for the "image_upload.scheme" setting.
  *
  * @see editor.schema.yml
  *
  * @return string[]
  *   All valid choices.
  *
  * @internal
  */
 public static function getValidStreamWrappers(): array {
   return array_keys(\Drupal::service('stream_wrapper_manager')->getNames(StreamWrapperInterface::WRITE_VISIBLE));
 }

We don't have many other examples at this point, but there is still of a lot of configuration to validate and there may be more places where we need to add these functions that might not be useful for anything other than constraint validation.

Proposed resolution

As discussed with @xjm, @wim-leers, @carsoncho, and @jcorrao, we thought it might be useful to override Symfony's Choice Constraint doing something like this pseudo code:


namespace Drupal\Core\Validation\Plugin\Validation\Constraint;

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Symfony\Component\Validator\Constraints\Choice;

#[Constraint(
  id: 'Choice',
  label: new TranslatableMarkup('Choice', [], ['context' => 'Validation'])
)]
class ChoiceConstraint extends Choice {

  public $callbackArgs = [];

}
 

and extend the ChoiceValidator:


namespace Drupal\Core\Validation\Plugin\Validation\Constraint;

use Symfony\Component\Validator\Constraints\ChoiceValidator;

/**
 * Validates complex data.
 */
class ChoiceConstraintValidator extends ChoiceValidator {

  /**
   * {@inheritdoc}
   */
  public function validate(mixed $value, Constraint $constraint) {
    assert($constraint instanceof ChoiceConstraint);
    if ($constraint->callbackArgs) {
      $callback = function() {
        // @todo;
      };
    }
    $constraint->callback = $callback;
    parent::validate($value, $constraint);
  }

}

Remaining tasks

Decide if this would be useful.

User interface changes

None.

API changes

New Choice validator that would allow us to do something like this is /core/modules/user/config/schema/user.schema.yml:

user.role.*:
  ...
  mapping:
    ...
    permissions:
      sequence:
        type: string
        label: 'Permission'
+         constraints:
+           Choice:
+             callback: user.permissions:getPermissions
+             transform: array_keys

Long string breaks the layout of Claro (reapply fix)

$
0
0

We noticed that issue 2519362 improving menu edit form usability (https://www.drupal.org/i/2519362) reverted for 10.3. the fix for long stings breaking node edit form that was fixed with a 1-line css change for 10.2 in issue 3400762 (https://www.drupal.org/i/3400762) where the pcss file containing the codeline was renamed.

For more details about the problem addressed see the original issue #3400762: Long string breaks the layout of Claro.

Proposed resolution

On core/themes/claro/css/layout/form-two-columns.css line 23 instead of

grid-template-columns: 3fr minmax(22.5rem, 1fr);

we just need to add the second minmax function

grid-template-columns: minmax(0, 3fr) minmax(22.5rem, 1fr);

Entity queries must explicitly set whether the query should be access checked or not

$
0
0

Problem/Motivation

Install Drupal core update => 10.2.7
Open the homepage

Steps to reproduce

Proposed resolution

Uncaught PHP Exception Drupal\Core\Entity\Query\QueryException: "Entity queries must explicitly set whether the query should be access checked or not. See Drupal\Core\Entity\Query\QueryInterface::accessCheck()." at [...]core/lib/Drupal/Core/Entity/Query/Sql/Query.php line 141

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

[PLAN] New Toolbar Roadmap: Path to Beta & Stable

$
0
0

This is the planned roadmap to get the new Drupal toolbar to beta & stable. Once we release beta, we can open a merge request to core.


All Navigation Issues.

Stable Criteria

Must Have

Link to existing issues marked as Navigation stable blocker.

Should Have

Could Have

Add an index on locales_location on type and name

$
0
0

Problem/Motivation

We are running a quite big multi domain drupal site (all separate databases but running on the same database server) and found that in some cases we had lots of translation strings which needed to be updated within deployment of new versions.

Updating these would often trigger an update to the field 'version' in the table 'locales_location', which would end up being comparably slow. The reason we found was that the WHERE clause would contain a search by the field 'name', and that one is not indexed.

UPDATE locales_location SET version='8.8.8'
WHERE (sid = '5760') AND (type = 'path') AND (name = '/our/custom/path');

We created a composite index for the contained fields and could see that our database load dropped by ~50% (!) immediately after that.

CREATE INDEX sid_type_name on locales_location (sid,type,name);

Point is that we actually do not want to do anything custom to Drupal's Core, respectively the core database structure if we can avoid it, and there might be reasons why there's no index on this field. Clearly creating an index could slow down operations like INSERT a bit. But this table seems to see far more SELECTs or UPDATEs where 'name' is involved.

So what I'm hoping to achieve here is either confirmation this should be considered an improvement and go into Drupal Core, or getting an answer explaining why this index is a bad idea.

Thank you in advance!

Proposed resolution

Index 'name' field in locales_location table

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Add subsystem maintainers for Navigation

[PP-1] Reorder Layout Builder sections

$
0
0

Currently postponed on #3208766: Add UUID to sections

Problem/Motivation

Some complex page layouts leverage multiple section containers for long-form content, where reordering sections would be helpful.

Proposed resolution

Allow re-ordering of sections through the UI in mobile-friendly, accessible manner.

Completed tasks

  • Determine the best UI for re-ordering sections
  • Write patch with functionality
  • Write tests
  • Community review and confirmation
  • Usability review

Remaining tasks

Additional tasks and optimizations prior to follow-up review:

  • #3080606-77: [PP-1] Reorder Layout Builder sections: Move the "Reorder sections" trigger to be in-line with each section, alongside the remove X and the "Configure section" link. This is inspired by http://www.drupal.org/project/lb_ux. Reasons for this include: the "reorder sections" is something likely done while looking at a given section, and scrolling back to the top takes you away from that focus. Also, the "Save layout" and "Discard buttons" are actual buttons that perform a standard operation, and it's easy to scroll past that and miss the "Reorder sections" link
  • #3080606-77: [PP-1] Reorder Layout Builder sections: By having the reorder section be triggered from a specific section, we can highlight that section in the tabledrag. Compare to the highlight effect when you use the "Move" contextual link for any block in Layout Builder. See also the Block UI, after placing a new block, it scrolls to and highlights the newly placed box.
  • #3080606-77: [PP-1] Reorder Layout Builder sections: Add a second column to the tabledrag with the human-readable label of the layout plugin used for each section. This additional metadata will be very helpful when trying to keep track of which section is which, especially if you haven't added custom labels to your sections (by default they are only numbered). If needed, it should be possible to specify a greater width for the off-canvas sidebar.
  • #3080606-84: [PP-1] Reorder Layout Builder sections: Try to make the UI for reordering sections as much like the UI for reordering components as you can. That applies to the interaction in the off-canvas sidebar. It also applies to the link that opens the sidebar. For reordering components, I think that is a contextual link, along with Configure and Delete. Would it make sense to have similar contextual links, or a drop button, for sections?
  • #3080606-84: [PP-1] Reorder Layout Builder sections: I see links to some screenshots in #74, but nothing under "User interface changes" in the issue summary. Once the suggestions in #77 are implemented, it will help to get updated screenshots and add them to the issue summary.
  • Receive @tim.plunkett (subsystem maintainer) review signoff (per #3080606-55: [PP-1] Reorder Layout Builder sections and #3080606-60: [PP-1] Reorder Layout Builder sections, as stated in #3080606-77: [PP-1] Reorder Layout Builder sections).
  • #3080606-85: [PP-1] Reorder Layout Builder sections: I think this issue needs a change record, so I am adding the tag for that. It might also need a release-note snippet at the end of the issue summary.

User interface changes

Needed, see #3080606-84: [PP-1] Reorder Layout Builder sections or remaining tasks above for process to create UI changes.

API changes

None anticipated.

Data model changes

None anticipated.

Release notes snippet

TBD

Follow-up issues

TBD
#3293787: Section reorder through click-and-drag
#3293789: Replace "Show Content Preview" checkbox with collapseable sections

Screenshots

New reorder section task

Off canvas to reorder sections

<textarea>s using Text Editor always fail HTML5 validation when "required" is added via #states

$
0
0

Problem/Motivation

There was an issue: #1954968: Required CKEditor fields always fail HTML5 validation
"An invalid form control with name='{name}' is not focusable" JS error is thrown when a textarea has "required" attribute, but is not visible.

This was fixed in CKEditor: https://dev.ckeditor.com/ticket/8031
Now CKEditor removes the "required" attribute from textarea during initialization.

But the problem still exist if the "required" attribute is added via #states.

Steps to reproduce

Add states to node title and body field via form alter to make body field required when the node title is filled in.

Proposed resolution

Make this more reliable to handle if a field is changed to required via #states that the field gets marked as required and editors are notified when HTML5 validation fails,so that editors know what the problem is and can act on it.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Fix word-wrapping behavior of machine names in UI tables

$
0
0

Problem/Motivation

Discovered while working on #3306820: Show machine name in "Manage form display" and "Manage display" table row.

Steps to reproduce

  1. Install Standard and enable the Media module.
  2. Go to /admin/structure/media/manage/remote_video/fields.
  3. Shrink your browser tab gradually until the "Machine name" column starts to wrap, but not far enough to hit the breakpoint where it will be hidden.
  4. Notice that the machine name is wrapped on several lines with hyphens, which is confusing and makes it look like hyphens are a part of the machine name.

Field table showing a field machine name that looks like 'field_media_oem-bed_video' or perhaps two machine names, 'field_media_oem-' and 'bed_video'

Proposed resolution

  • Fix the CSS for this column (on Manage fields, Manage display, and Manage form display following #3306820: Show machine name in "Manage form display" and "Manage display" table row; possibly other places) so that it does not wrap with hyphens.
  • Machine names of a reasonable length (TBD) should not break, and the column should be hidden when the window is too small to display the longest (reasonable-length) machine name.
  • Exceptionally long machine names should be truncated, possibly with an ellipsis, or wrapped without hyphens, or another strategy (research the problem of how long string literals are handled elsewhere in the UI; there are some related issues from the past year or so).

Remaining tasks

TBD

User interface changes

Hopefully better wrapping behavior for machine name columns.

API changes

Probably not.

Data model changes

N/A

Release notes snippet

N/A


Mandatory requirement of layout builder

$
0
0

Problem/Motivation

This module requires Layout builder (and consequentially Layout discovery) to be enabled. Some websites may only want to have new navigation, but not necessarily the other modules it depends upon.

Proposed resolution

Refactor the navigation module in a way it only requires minimal set of modules by default so it can be used in minimal scenarios too.

Prefer to use Array.prototype.includes() for some of Array.prototype.indexOf()

Update 10.3 release notes to indicate Rules module is not compatible

$
0
0

The Rules module is not yet compatible with 10.3. Having Rules installed on 10.3 will break the site, with the only real workaround being to uninstall Rules.

https://www.drupal.org/project/rules/issues/3454056
https://www.drupal.org/project/rules/issues/3456150
https://www.drupal.org/forum/support/upgrading-drupal/2024-06-20/update-...

Since Rules is a pretty popular module (currently listed at #43 at https://www.drupal.org/project/usage with over 120K installs) it probably makes sense to list this issue in the release notes for 10.3 so users are not caught by surprise.

The last update for Rules was in October 2023 so its current maintenance status is a bit unclear.

User's image in comments overlaps with Layout Builder section

$
0
0

Problem/Motivation

After posting a comments on a page, the profile image associated with the user is overlapping with Layout Builder section.

Steps to reproduce

  1. Make Olivero the default theme in Appearance.
  2. Enable Layout Builder module in Extend.
  3. Create an Article page with comments.
  4. Go to Home > Administration > Structure > Content types > Article
  5. Under Manage Display tab go to Layout options
  6. Check Use Layout Builder and Allow each content item to have its layout customized. then save.
  7. Go to the Article page and click on the Layout tab.
  8. Scroll down to the comments section.
  9. Result: You will see the user's circular image overlapping with the Layout Builder section.
  10. Expected: User's image should be aligned correctly within the comment.

Please refer to the video attached.

Add validation constraints to contact.form.*

$
0
0

Problem/Motivation

Contact form entity is not yet fully validatable:

.vendor/bin/drush config:inspect --filter-keys=contact.form.feedback --detail --list-constraints
➜  🤖 Analyzing…

 Legend for Data: 
  ✅❓  → Correct primitive type, detailed validation impossible.
  ✅✅  → Correct primitive type, passed all validation constraints.
 -------------------------------------------------- --------- ------------- ------ --------------------------------------------------------------------------------------------- 
  Key                                                Status    Validatable   Data   Validation constraints                                                                       
 -------------------------------------------------- --------- ------------- ------ --------------------------------------------------------------------------------------------- 
  contact.form.feedback                              Correct   87%           ✅❓   ValidKeys: '<infer>'                                                                         
   contact.form.feedback:                            Correct   Validatable   ✅✅   ValidKeys: '<infer>'                                                                         
   contact.form.feedback:_core                       Correct   Validatable   ✅✅   ValidKeys:                                                                                   
                                                                                      - default_config_hash                                                                      
   contact.form.feedback:_core.default_config_hash   Correct   Validatable   ✅✅   NotNull: {  }                                                                                
                                                                                    Regex: '/^[a-zA-Z0-9\-_]+$/'                                                                 
                                                                                    Length: 43                                                                                   
                                                                                    ↣ PrimitiveType: {  }                                                                        
   contact.form.feedback:dependencies                Correct   Validatable   ✅✅   ValidKeys: '<infer>'                                                                         
   contact.form.feedback:id                          Correct   Validatable   ✅✅   Length:                                                                                      
                                                                                      max: 32                                                                                    
                                                                                    ↣ PrimitiveType: {  }                                                                        
                                                                                    ↣ Regex:                                                                                     
                                                                                      pattern: '/^[a-z0-9_]+$/'                                                                  
                                                                                      message: 'The %value machine name is not valid.'                                           
   contact.form.feedback:label                       Correct   Validatable   ✅✅   Regex:                                                                                       
                                                                                      pattern: '/([^\PC])/u'                                                                     
                                                                                      match: false                                                                               
                                                                                      message: 'Labels are not allowed to span multiple lines or contain control characters.'    
                                                                                    NotBlank: {  }                                                                               
                                                                                    ↣ PrimitiveType: {  }                                                                        
   contact.form.feedback:langcode                    Correct   Validatable   ✅✅   NotNull: {  }                                                                                
                                                                                    Choice:                                                                                      
                                                                                      callback: 'Drupal\Core\TypedData\Plugin\DataType\LanguageReference::getAllValidLangcodes'↣ PrimitiveType: {  }                                                                        
   contact.form.feedback:message                     Correct   Validatable   ✅✅   Regex:                                                                                       
                                                                                      pattern: '/([^\PC\x09\x0a\x0d])/u'                                                         
                                                                                      match: false                                                                               
                                                                                      message: 'Text is not allowed to contain control characters, only visible characters.'↣ PrimitiveType: {  }                                                                        
   contact.form.feedback:recipients                  Correct   NOT           ✅❓   ⚠️  @todo Add validation constraints to config entity type: contact.form.*                   
   contact.form.feedback:recipients.0                Correct   Validatable   ✅✅   Email:                                                                                       
                                                                                      message: '%value is not a valid email address.'↣ PrimitiveType: {  }                                                                        
   contact.form.feedback:redirect                    Correct   NOT           ✅❓   ⚠️  @todo Add validation constraints to config entity type: contact.form.*                   
   contact.form.feedback:reply                       Correct   Validatable   ✅✅   Regex:                                                                                       
                                                                                      pattern: '/([^\PC\x09\x0a\x0d])/u'                                                         
                                                                                      match: false                                                                               
                                                                                      message: 'Text is not allowed to contain control characters, only visible characters.'↣ PrimitiveType: {  }                                                                        
   contact.form.feedback:status                      Correct   Validatable   ✅✅   ↣ PrimitiveType: {  }                                                                        
   contact.form.feedback:uuid                        Correct   Validatable   ✅✅   Uuid: {  }                                                                                   
                                                                                    ↣ PrimitiveType: {  }                                                                        
   contact.form.feedback:weight                      Correct   Validatable   ✅✅   Range:                                                                                       
                                                                                      min: -2147483648                                                                           
                                                                                      max: 2147483647                                                                            
                                                                                    FullyValidatable: null                                                                       
                                                                                    ↣ PrimitiveType: {  }                                                                        
 -------------------------------------------------- --------- ------------- ------ --------------------------------------------------------------------------------------------- 

Steps to reproduce

  1. Get a local git clone of Drupal core 11.x.
  2. composer require drupal/config_inspector— or manually install https://www.drupal.org/project/config_inspector/releases/2.1.5 or newer (which supports Drupal 11!)
  3. composer require drush/drush
  4. vendor/bin/drush config:inspect --filter-keys=contact.form.feedback --detail --list-constraints

Proposed resolution

Add validation constraints to missing properties.

This requires looking at the existing code and admin UI (if any) to understand which values could be considered valid. Eventually this needs to be reviewed by the relevant subsystem maintainer.

For examples, search *.schema.yml files for the string constraints:😊

Reach out to @borisson_ or @wimleers in the #distributions-and-recipes.

Remaining tasks

MR

User interface changes

None.

API changes

None.

Data model changes

More validation 🚀

Release notes snippet

None.

Viewing all 300876 articles
Browse latest View live


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