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

Cannot read properties of null (reading 'nodeType') on node.page.body

$
0
0

Problem/Motivation

On /admin/structure/types/manage/page/fields/node.page.body page we're getting Uncaught TypeError: Cannot read properties of null (reading 'nodeType') error in console.

Steps to reproduce

Go to /admin/structure/types/manage/page/fields/node.page.body
check the console, you will see the error - Uncaught TypeError: Cannot read properties of null (reading 'nodeType')

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Messages should have role=status instead of role=contentinfo

$
0
0

Problem

Messages currently have a role="contentinfo" wrapper for status messages (compared with role="alert" for error messages).

contentinfo is inappropriate here, because it's supposed to be for information about the document as a whole, not status updates. It's a landmark role, and there should only be one such contentinfo region per page. It's intended to serve the same purpose as a top-level HTML footer element. Using contentinfo for messages may be present some confusion for users who navigate by landmark regions.

Proposed resolution

  1. Replace the role="contentinfo" from the message-type wrapper DIV with role="region" and change the aria-label to "System Messages".
  2. Leave the <div role="alert"> in place for the error message group.
  3. Add a <div role="status"> wrapper for Status and Warning message groups.

Here's a simplified before/after summary of this.

Structure BEFORE:

div role="contentinfo" aria-label="Status message"
    h2.visually-hidden
    ul

div role="contentinfo" aria-label="Error message"
    div role="alert"
        h2.visually-hidden
        ul

Structure AFTER:

div role="region" aria-label="System messages"
    
    div role="status" // Status & Warning messages
        h2.visually-hidden
        ul

    div role="alert"  // Error messages
        h2.visually-hidden
        ul

The CK Editor toolbar is overlapping with the Admin toolbar

$
0
0

Steps to reproduce

1. Go to any node create/edit page
2. Switch to Full HTML format in ckeditor
3. Click on any component i.e paragraph or styles to make toolbar active
4. Scroll down until the CKEditor toolbar reaches the top of the page.

Additional info -
Os - windows 11 pro
Screen Resolution :1366 X 768
Browser - latest chrome

A taxonomy vocabulary cannot be deleted through the interface, AJAX error code 200.

$
0
0

Problem/Motivation

In the path /admin/structure/taxonomy, it is not possible to delete a previously created vocabulary. When clicking the delete button, an error message 'ops, something went wrong. Check your browser's developer console for more details.' appears. In the browser, the following error is displayed: 'Uncaught error: There was an HTTP AJAX error. HTTP Result Code: 200. The debugging information is detailed below.

Path: /admin/structure/taxonomy/manage/taxonomia_para_borrar/delete?destination=/admin/structure/taxonomy. StatusText: parsererror. ResponseText: [{"command":"settings","settings":{"ajaxPageState":{"theme":"seven","theme_token":"VnSPjhi68kmAKBbJXl3IupPtQn0lixf9HTvqkqNrZxk","libraries":"eJx9UgFuwyAM_BCDN-wlkUM8Qkswsk3W7vUjbbIlmVYJyec729gYGKaYOyVKPbBbrVVGNPCvZEeakWNWzHoM6wSB_eie5qQtVn4KRU_Z9OCvjW-nuB3uXooXMX0MXYkF3QZMS1C8aYXkBq4Fkv1l3lLMV3kdsrbVghg3GbzGGR_ZB95TSlAED-QQIVGwcIHbkWcqfVVtA-1phT7hwBD-soxSKEu7-qll4glS_ELz0fqFTxSa0O2wlTm80qyMcTKCM2bnE4jc7YQiEFBWNiTq2yOI3tuwwchIrL7q1tbmm9NvOPsWxUPB92XtTauLUNlUQd5KLfixe_kGWKv4lg"},"ajaxTrustedUrl":{"form_action_p_pvdeGsVG5zNF_XLGPTvYSKCf43t8qZYSwcfZl2uzM":true},"pluralDelimiter":"\u0003","user":{"uid":"1","permissionsHash":"efb4e575ff6688acee77ae2f12e85ea1d5a33e6e2725f100b2959892db6a2068"}},"merge":true},{"command":"add_js","selector":"body","data":[{"src":"\/core\/misc\/form.js?v=10.2.0"},{"src":"\/core\/misc\/details-summarized-content.js?v=10.2.0"},{"src":"\/core\/misc\/details-aria.js?v=10.2.0"},{"src":"\/core\/misc\/details.js?v=10.2.0"}]},{"command":"openDialog","selector":"#drupal-modal","settings":null,"data":"\u003Cform class=\u0022taxonomy-vocabulary-confirm-delete taxonomy-vocabulary-confirm-form confirmation\u0022 data-drupal-selector=\u0022taxonomy-vocabulary-confirm-delete-see5qx4k9sw\u0022 action=\u0022\/admin\/structure\/taxonomy\/manage\/taxonomia_para_borrar\/delete?destination=\/admin\/structure\/taxonomy\u0022 method=\u0022post\u0022 id=\u0022taxonomy-vocabulary-confirm-delete--SeE5qx4K9sw\u0022 accept-charset=\u0022UTF-8\u0022\u003E\n Al eliminar un vocabulario se eliminan todos los t\u00e9rminos que hay en \u00e9l. Esta acci\u00f3n no se puede deshacer.\u003Cinput data-drupal-selector=\u0022edit-confirm\u0022 type=\u0022hidden\u0022 name=\u0022confirm\u0022 value=\u00221\u0022 \/\u003E\n\u003Cdetails data-drupal-selector=\u0022edit-entity-deletes\u0022 aria-describedby=\u0022edit-entity-deletes--AmyM3IxuSuU--description\u0022 id=\u0022edit-entity-deletes--AmyM3IxuSuU\u0022 class=\u0022js-form-wrapper form-wrapper seven-details\u0022 open=\u0022open\u0022\u003E \u003Csummary role=\u0022button\u0022 aria-controls=\u0022edit-entity-deletes--AmyM3IxuSuU\u0022 aria-expanded=\u0022true\u0022 aria-pressed=\u0022true\u0022 class=\u0022seven-details__summary\u0022\u003E\n \u003Cspan\u003EBorrados de configuraci\u00f3n\u003C\/span\u003E\n \u003C\/summary\u003E\u003Cdiv class=\u0022seven-details__wrapper details-wrapper\u0022\u003E\n \u003Cdiv class=\u0022seven-details__description\u0022\u003ESe eliminar\u00e1 la configuraci\u00f3n que se enumera.\u003C\/div\u003E\u003Cdiv class=\u0022item-list\u0022\u003E\u003Ch3\u003EContent language settings\u003C\/h3\u003E\u003Cul data-drupal-selector=\u0022edit-language-content-settings\u0022\u003E\u003Cli\u003Etaxonomy_term.taxonomia_para_borrar\u003C\/li\u003E\u003C\/ul\u003E\u003C\/div\u003E\u003C\/div\u003E\n\u003C\/details\u003E\n\u003Cinput autocomplete=\u0022off\u0022 data-drupal-selector=\u0022form-ml5rcpuuconay9aqu1nrwuhn0au06lbfybjnsgdkvvy\u0022 type=\u0022hidden\u0022 name=\u0022form_build_id\u0022 value=\u0022form-ML5rCpuucONay9aqu1nrWuHN0AU06lBFybjNsgdKvVY\u0022 \/\u003E\n\u003Cinput data-drupal-selector=\u0022edit-taxonomy-vocabulary-confirm-delete-form-token-uyu-qcwwdak\u0022 type=\u0022hidden\u0022 name=\u0022form_token\u0022 value=\u00224i-63P70lyrf7CF51WnAqMOk2GYn7HbISnf7m1r56AA\u0022 \/\u003E\n\u003Cinput data-drupal-selector=\u0022edit-taxonomy-vocabulary-confirm-delete-tc2fsqqoe-g\u0022 type=\u0022hidden\u0022 name=\u0022form_id\u0022 value=\u0022taxonomy_vocabulary_confirm_delete\u0022 \/\u003E\n\u003Cdiv data-drupal-selector=\u0022edit-actions\u0022 class=\u0022form-actions js-form-wrapper form-wrapper\u0022 id=\u0022edit-actions--2uPzgj0rUrA\u0022\u003E\u003Cinput data-drupal-selector=\u0022edit-submit\u0022 type=\u0022submit\u0022 id=\u0022edit-submit--x7xc-3Im9rA\u0022 name=\u0022op\u0022 value=\u0022Delete\u0022 class=\u0022button button--primary js-form-submit form-submit\u0022 \/\u003E\n\u003Ca href=\u0022\/admin\/structure\/taxonomy\u0022 class=\u0022button dialog-cancel\u0022 data-drupal-selector=\u0022edit-cancel\u0022 id=\u0022edit-cancel--Tijx6eq9ezg\u0022 title=\u0022Cancelar\u0022\u003ECancelar\u003C\/a\u003E\u003C\/div\u003E\n\n\n\u003C\/form\u003E\n","dialogOptions":{"width":"880","modal":true,"title":"\u00bfEst\u00e1 seguro que desea eliminar el vocabulario Taxonomia para borrar?"}' name: "AjaxError", stack: "@https://chg.ddev.site/core/misc/ajax.js?v=10.2.0:196:32\n@https://chg.ddev.site/core/misc/ajax.js?v=10.2.0:1915:3\n" }


Afterwards, in the log, this error appears:


2024/01/05 10:06:58 [warn] 2034#2034: *3822 upstream sent more data than specified in "Content-Length" header while reading upstream, client: 20.201.7.5, server: , request: "POST /admin/structure/taxonomy/manage/taxonomia_para_borrar/delete?destination=/admin/structure/taxonomy&_wrapper_format=drupal_modal HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm.sock:", host: "chg.ddev.site", referrer: "https://chg.ddev.site/admin/structure/taxonomy"


When blocking JavaScript in the browser, it works normally, that's why, blocking each file individually, it is noticed that the /web/core/misc/ajax.js file is the one causing this effect.


Steps to reproduce

Having the Taxonomy module installed and Drupal 10.2.0.

Refactor system/Kernel/Theme/ThemeTest::testThemeDataTypes

$
0
0

Problem/Motivation

$this->assertTrue($output instanceof MarkupInterface || is_string($output), new FormattableMarkup('\Drupal::theme() returns an object that implements MarkupInterface or a string for data type @type.', ['@type' => $type]));

Proposed resolution

Refactor the test to test independently the string and the MarkupInterface cases.

Remaining tasks

Discuss
Review patch

User interface changes

API changes

Data model changes

Release notes snippet

The batch system gets stuck and doesn't progress in any process.

$
0
0

Problem/Motivation

When I try to update the translations or perform other processes that also use batch processes, it initially gets stuck and never completes. This is the warning generated:

2024/01/05 16:19:08 [warn] 2044#2044: *126 upstream sent more data than specified in "Content-Length" header while reading upstream, client: 20.201.7.5, server: , request: "POST /batch?id=9964&op=do_nojs&op=do&_format=json HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm.sock:", host: "chg.ddev.site", referrer: "https://chg.ddev.site/batch?id=9964&op=start"

Steps to reproduce

To have the following characteristics:

  • KUbuntu 22.04.3 LTS
  • ddev version v1.22.6
  • Drupal 10.2.1.

Fix the deprecation URL for #3356894 and #3372097

$
0
0

Problem/Motivation

The CRs of #3356894: Make field selection less overwhelming by introducing groups and #3372097: Consider replacing hook_field_type_category_info with YML based plugin discovery were merged into because they are sequential changes of the same feature an someone trying to understand what has been changes should reconstruct the development process as both issues were delivered in 10.2.

So, one CR (https://www.drupal.org/node/3364271) has been deleted and the other contains both changes. But the https://www.drupal.org/node/3364271 is now 404

Steps to reproduce

Go to https://www.drupal.org/node/3364271 (which is the URL from the deprecation message)

Proposed resolution

Fix the deprecation message

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

If a filter wraps the drupal-media tag in a paragraph, the edit button breaks

$
0
0

Problem/Motivation

The "Edit Media" button disappears when the "Convert line breaks into HTML" filter is enabled.

There's a javascript error.

Uncaught TypeError: Cannot read property 'insertBeforeMe' of null
    at h._setUpEditButton (plugin.js?t=q1mipb:242)
    at plugin.js?t=q1mipb:174
    at Object.success (plugin.js?t=q1mipb:320)
    at c (jquery.min.js?v=3.4.1:2)
    at Object.fireWith [as resolveWith] (jquery.min.js?v=3.4.1:2)
    at l (jquery.min.js?v=3.4.1:2)
    at XMLHttpRequest.<anonymous> (jquery.min.js?v=3.4.1:2)

The issue is that "Convert line breaks into HTML" is wrapping the drupalmedia tag in a `p` tag. The drupalmedia plugin.js assumes that the first element within the widget is the embed and that it has children (so you can call getFirst() on it). Since the `p` tag is empty, calling getFirst() fails returns null, (this is the null which has no insertBeforeMe property).

Proposed resolution

Modify the client-side JavaScript for the media embed filter so that it is able to anticipate the P tag added by filter_autop.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Add a way to make media captions not editable in CKEditor

$
0
0

Problem/Motivation

modules/media/js/plugins/drupalmedia/plugin.js automatically turns the media caption editable in CKE.
But in our case we don't want that because we don't want to allow users to provide an embed-specific caption (and if they enter one, it will not be used in front-office).

Steps to reproduce

  1. Create a CKE field with the "Insert a media" button and filter.
  2. Create a media with a caption (it must have a figcaption HTML tag in its template.
  3. Insert this media in the CKE field.
  4. The caption is editable.

Proposed resolution

There should be a setting in the text format to disable this behaviour.

Remaining tasks

JS is not my forte but I can try to submit a patch.

Move all tour config to tour module

$
0
0

Problem/Motivation

Move all tour config to tour module

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Allow earlier optional parameters in routes to be empty

$
0
0

Problem/Motivation

I'm trying to add something like /ajax_get_jobs/en/{langCode}/{searchTerm}/{jobTypes}/{units}/{page} in a custom route. However, if I leave one of the parameters in the middle (searchTerm for example) empty (for example /ajax_get_jobs/en//Full-time/Central it no longer works even though there are defaults defined for all of the parameters.

Seems that using vanilla Symphony adding ! in front of each of the parameter definitions should work per Symphony documentation, but the exclamation mark doesn't seem to work in Drupal at all.

The Drupal routing documentation isn't too specific on this. It does specify that ”the first item of the path cannot be an argument, and must be a string. You can also define optional parameters at the end of your path (See 'Optional Parameters' on this page).”, which could mean that all empty optional parameters must be in the end of the path, but could also mean just that the optional parameters must be defined in the end of the route.

It also specificies that ”unlike generic Symfony routes, Drupal requires that a slug occupies a complete path part”, but that also doesn't mean that a path part can't be empty (ie. nothing between the slashes).

Steps to reproduce

Create a custom module with a routing definition like

example_module.job_data:
  path: '/ajax_get_jobs/{langCode}/{searchTerm}/{jobTypes}/{units}/{page}'
  defaults:
    _controller: '\Drupal\example_module\Controller\JobController::getJobs'
    searchTerm: NULL
    jobTypes: NULL
    units: NULL
    page: 0
  requirements:
    _permission: 'access content'

Try accessing /fi/ajax_get_jobs/fi//Full-time/Central. The request doesn't match the route, unlike if you have a searchTerm that's not empty.

Proposed resolution

Either allow an empty optional parameter in the middle of the route or clearly document that it isn't possible.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Replace REQUEST_TIME in plugins with direct container access

$
0
0

Problem/Motivation

Split plugins out from #3112298: Replace REQUEST_TIME in classes with direct container access to reduce the size of the changed.

This issue deals specifically with replace those calls in plugins with direct container access.

The plugins and classes with direct container access that were identified to have those calls are:

  • \Drupal\datetime\Plugin\views\argument\Date
  • \Drupal\history\Plugin\views\filter\HistoryUserTimestamp
  • \Drupal\views\Plugin\views\argument\Date
  • \Drupal\views\Plugin\views\cache\Time
  • \Drupal\views\Plugin\views\field\Date

Proposed resolution

- Remove deprecated uses of REQUEST_TIME and time() and others.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Make CI template compatible with private repositories

$
0
0

Problem/Motivation

Our gitlabci template makes use of the CI_MERGE_REQUEST_PROJECT_URL environment variable for fetching.
This assumes the repository is publicly available and doesn't work for private repositories.

The security team has a private fork of core on our gitlab instance for testing security issues.

Tests currently fail on the use of this variable because we can't fetch the repository over https

Steps to reproduce

Proposed resolution

Use 'origin' instead of the repository URL

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

SDC: Add a method to retrieve only components not replaced by others

$
0
0

Problem/Motivation

We are planning to rewrite UI Patterns upon SDC. To achieve this, we are proposing a few changes and additions:


ComponentPluginManager::getAllComponents() is useful to retrieve all the components.

However, we sometimes needs a list of the components minus the ones replaced by others. For example:

  • An UI for selecting components while doing site building
  • A library page
  • Some controls in code

A replaced component is not "active" anymore, so it makes little sense to display it.

Proposed resolution

Add a boolean parameter to ComponentPluginManager::getAllComponents():

public function getAllComponents(bool $filter = FALSE): array {

For better control, this parameter can be an integer like what is done in StreamWrapperManagerInterface::getWrappers:

public function getAllComponents(int $filter = 0): array {

Or add a new public function to ComponentPluginManager:

public function getActiveComponents(): array {

I guess "active" a good keyword for components which are not replaced by others. So, we can add other unrelated rules later (according to some status or conditions).

Remaining tasks

If there is a chance for this feature to be accepted, we (UI Patterns team) can propose a merge request soon.

We have one month before the release of Drupal 10.2.0-alpha1.

Deprecate passing non-strings to UserSession::hasPermission() and User::hasPermission()

$
0
0

Problem/Motivation

I observed the following error during functional tests:

TypeError: Drupal\Core\Session\PermissionChecker::hasPermission(): Argument #1 ($permission) must be of type string, null given, called in [...]/core/lib/Drupal/Core/Session/UserSession.php on line 123 in Drupal\Core\Session\PermissionChecker->hasPermission() (line 23 of core/lib/Drupal/Core/Session/PermissionChecker.php).

I have not seen this error in a non-test context.

This is caused because argument 1 of PermissionChecker::hasPermission() must be a string. That can be called with a non-string argument from UserSession::hasPermission(), which does not have its own type declarations, so $permission can be a non-string.

I tried adding the same type declaration to UserSession::hasPermission(). That caused the tests to fail immediately and without an error message that was helpful in tracking down the root cause.

Proposed resolution

Cast $permission to string so that the the function signature of UserSession::hasPermission() can stay the same and the function signature of PermissionChecker::hasPermission() will always be followed.

Remaining tasks

Get agreement.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet


Separate cache operations (and k/v, cache tags?) from database queries in OpenTelemetry

$
0
0

Problem/Motivation

Once #3346765: Add PerformanceTestBase for allowing browser performance assertions within FunctionalJavaScriptTests lands it will be feasible to add database query logging to PerformanceTestTrait, this would allow us to count the number of database queries on certain pages (hot and cold caches too etc.), add assertions for them, then tighten the tests when the number of queries drops, or be warned if it's going to increase (which might be fine, or might be a regression).

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support serialization of private properties

$
0
0

Problem

Because DependencySerializationTrait uses get_object_vars() to collect serializable service properties, but that function cannot access private properties. Because of that, the code below fails, because $entityTypeManager becomes null when deserialization happens.

<?php

final class MyForm extends \Drupal\Core\Form\FormBase {

  private $entityTypeManager;

  public function __construct(\Drupal\Core\Entity\EntityTypeManagerInterface $entityTypeManager) {
    $this->entityTypeManager = $entityTypeManager;
  }

  public static function create(\Symfony\Component\DependencyInjection\ContainerInterface $container) {
    return new static(
      $container->get('entity_type.manager')
    );
  }
}

This seems to be a known limitation for 2 years or so: https://www.drupal.org/project/drupal/issues/2727011#comment-12619886

Proposed solution

Use Reflection or Clousers instead of get_object_vars().

Related

https://www.lambda-out-loud.com/posts/accessing-private-properties-php/

PS.: We are using this fix since patch 1 was submitted here in production without noticeable unexpected sideeffects.

Move the first two steps of field creation into a modal.

$
0
0

Problem/Motivation

Implement this as a part of #3346539: [Plan] Improve field creation experience, just use modals for the first two steps of field creation for now.

Steps to reproduce

Proposed resolution

  1. Update FieldUiLocalAction to support opening form in a modal.
  2. Update FieldStorageAddForm to maintain opening steps in modals.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

system_page_attachments() varies by authenticated user role but does not add said cache context

$
0
0

Problem/Motivation

Discovered here: #3376846-12: Implement the new access policy API

Core never adds Drupal settings to the page in system_page_attachments() if the account isn't logged in. We never added a cache context to reflect that, leading to incorrect cache entries where Drupal settings either is present when it shouldn't be or vice versa. This problem almost never shows on real websites because most themes add more JavaScript, but Stark does not and most tests run using Stark.

Steps to reproduce

Proposed resolution

Proposed solution is to add user.roles:authenticated to system_page_attachments() and adjust existing tests.

Remaining tasks

Review

User interface changes

NA

API changes

NA

Data model changes

NA

Release notes snippet

NA

Quick start command installation stops responding

$
0
0

Problem/Motivation

After a minute or so, the installation stops responding.

System: Ubuntu 20.04 with PHP 8.1.3.

Steps to reproduce

  1. Download and install Drupal, from Step 2 - download and run Drupal:
    $ mkdir drupal && cd drupal && curl -sSL https://www.drupal.org/download-latest/tar.gz | tar -xz --strip-components=1
    $ php -d memory_limit=256M ./core/scripts/drupal quick-start demo_umami
  2. Click around, do a search, open a node, click "Edit", "Save", etc.
  3. See that it at some point stops responding, and hangs ...

To make it work again, you can stop and restart the PHP server, using the .ht.router.php in stead:

php -S localhost:8888 .ht.router.php

From Drupal Quick Start Command > Troubleshooting.

Proposed resolution

TBD

Remaining tasks

Figure out why the installation stops responding, and adjust the code to prevent it from happening.

User interface changes

API changes

Data model changes

Release notes snippet

Viewing all 294771 articles
Browse latest View live


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