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

Unable to alter local actions prior to rendering

$
0
0

Problem/Motivation

There are some inconsistencies between how local tasks and local actions are handled.

For local tasks, there are 2 hooks:

For local actions, there is only one hook, and the naming convention is actually the opposite of local tasks:

Proposed resolution

Introduce a new hook_local_actions_render_alter() executed prior to rendering.
Rename existing hook_menu_local_tasks_alter() to hook_local_tasks_render_alter() for the consistency.

Remaining tasks

Review, commit.

API changes

New hook_local_actions_render_alter() hook is added.
Existing hook_menu_local_tasks_alter() hook is deprecated and renamed to hook_local_tasks_render_alter().

See the change record for more details - https://www.drupal.org/node/3028611.


Twig Debug output shows in Group By title if grouping term has a label

$
0
0

If Twig Debug is active and I have a Group By field in my view, if I have a label, it shows the Twig Debug output. If I remove the label, it displays as expected.

Without a label

Group by without label

With a label

Group by with label

------

I feel like I've seen another issue related to labels and Twig Debug output being exposed, but I can't find it.

Fatal error: Uncaught TypeError: Drupal\Core\Extension\ThemeHandler::addTheme()

$
0
0

Problem/Motivation

Error was introduced in the 10.3.6 release of Drupal.

Fatal error: Uncaught TypeError: Drupal\Core\Extension\ThemeHandler::addTheme(): Argument #1 ($theme) must be of type Drupal\Core\Extension\Extension, null given, called in /var/www/html/core/lib/Drupal/Core/Extension/ThemeHandler.php on line 74 and defined in /var/www/html/core/lib/Drupal/Core/Extension/ThemeHandler.php:84

Steps to reproduce

Install a previous version of Drupal e.g. if the current version is 11.x install 10.x.
Choose a theme e.g. a core theme that is present in the 10.x codebase but not in the 11.x.
Or Install a contrib theme in 10.x.
Enable and then save the theme.
The theme's installed and enabled states will be stored in the core.extension.yml configuration file.
Update Drupal to the latest version ie in the example above, to 11.x.
Remove the theme from the 11.x codebase.
Run drush updb
This should result in a WSOD with the message above.

Drupal Usability Meeting 2024-12-13

$
0
0

This meeting takes place every Friday at 14:00 UTC (currently 6:00am PT, 9:00am ET). See Time.is to see what that is in your timezone.

The meetings are held using Zoom, and a link is posted in the #ux Slack channel 10 minutes before the meeting. Agenda is first come, first serve and set by attendees. Use the Needs usability review issue tag for issues that need review and/or suggest issues in comments here.

List of Slack users to ping 10 minutes before the meeting:
@worldlinemine, @lauriii, @AaronMcHale, @anmolgoyal74, @Ravi, @shaal, @ckrina, @simohell, @gauravvv, @Quynh, @yoroy, @andrei.zvonkov, @Regu.pl, @amazingrando

This list gets copied to the issue for the next meeting. If that has already happened, then go to that issue to add/remove yourself to/from the list.

Recording of this week's meeting: https://youtu.be/YuqXm3izB58

Rough transcript of this week's meeting: Drupal Usability Meeting - 2024-12-13.txt

We discussed the following issues:

NR and RTBC issues marked Needs usability review.

The group is actively tracking progress on these issues:

Remaining tasks

  1. Add issue credits for the participants.
  2. Add the issue(s) we discussed to the issue summary and as related issues.
  3. Add a rough transcript.
  4. Add a link to the recording on YouTube.
  5. Comment on the issue(s) we discussed.

Single Directory Components incompatible with Windows

$
0
0

Problem/Motivation

When using any theme that uses Single Directory Components, such as Bootstrap Barrio or Radix v6, or a subtheme, you get directory access errors and file rename errors in the Twig directory when running under Windows, regardless of web server (ISS or Apache).

Steps to reproduce

Configure a site on a windows server using ISS, Wampserver, or any other server stack. PHP version does not matter.

You get errors like

User warning: mkdir(): Permission Denied in Drupal\Component\PhpStorage\FileStorage->createDirectory() (line 123 of core\lib\Drupal\Component\PhpStorage\FileStorage.php).
Warning: rename(sites/default/files/php/twig/.4Dsb9cXDdpWEyXnXMa2kO0BnFjA,sites/default/files/php/twig/67000377e1daa_bootstrap_barrio:menu_col_JNIvb5q6me012iSYuYuVxcV6m/uz2H06QmL6F0P_gLVdYkLJqgQk5OKx6QathIvhyWzH8.php): The system cannot find the path specified (code: 3) in Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage->save() (line 88 of core\lib\Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage.php).

The colon after barrio is illegal in Windows.

You don't expect such errors.

Proposed resolution

This is caused by directory and file names containing characters that are illegal in Windows being used. They can be fixed by replacing those characters with underscores. This involves adding a function to do this and calling it.

Remaining tasks

Create Pull Request to add these changes.

User interface changes

None

Introduced terminology

None.

API changes

Add a function to replace the illegal characters if running Windows in
\web\core\lib\Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage.php
and call it in relevant places in that script and
t\web\core\lib\Drupal\Component\PhpStorage\FileStorage.php.

Data model changes

None

Release notes snippet

The function does nothing if PHP_OS is not WINNT indicative of a windows server (i.e. PHP_OS starts in "win", case insensitive)..
The basic code in the added function was generated by Copilot.

Allow attribute-based plugins to discover supplemental attributes to set additional properties

$
0
0

Problem/Motivation

Currently, the set of properties for a particular plugin type is only defined in one place - previously the plugin type's annotation class, and now the plugin type's attribute class.

This leads to some problems, such as:

- The long-standing problem where the EntityType annotation/attribute defines a 'field_ui_base_route' which is actually for field_ui, an optional module
- The long-standing feature needed for Views, where we'd like to add a property to FieldType plugins for Views, which is, again, an optional module -- #2337515: Allow @FieldType to customize views data

Proposed resolution

Provide a PluginProperty attribute class that can be used to add property data to plugin class definitions parsed from Plugin attributes. The PluginProperty class includes these properties:

  • key: The property key/name within the plugin definition to set the value for. If key is an array, then it is treated as a set of nested array keys, with the outer keys coming first. When plugin definitions are arrays, NestedArray::set() is used to set the value at key
  • value: The property value to set
  • allowedPluginClasses: A list of plugin attribute classes the plugin property can modify the definition for. This is really only useful for subclasses of PluginProperty

Because of the way plugin attributed-based discovery is cached, it is difficult to read data from PHP attributes that exist only when certain modules are installed. As a result, subclasses of the PluginProperty are not allowed outside of Drupal\Core and Drupal\Component. In order to allow module-specific properties to be added to plugin definitions, the PluginProperty class also has these properties:

  • moduleDependencies: Machine names of modules that need to be installed in order for the property to be set, if any
  • addToDefinitionCallback: If the PluginProperty attribute is being used with a plugin type definition that is not a an array, and there doesn't exist a core PluginProperty subclass that works with the plugin type, then custom/contrib developers can pass in a callable to PluginProperty that sets the property value on the definition object

Once we have something like PluginProperty, we can also create subclasses in core that allow us to set properties on entity type definitions, in order to split up the large entity type attribute definition into multiple attributes, as suggested in #18:

#[ContentEntityType(
  id: 'node',
  label: new TranslatableMarkup('Content'),
...
)]
#[Handler('storage', NodeStorage::class)]
// Or maybe even more specific subclasses for common handlers
#[StorageHandler(NodeStorage::class)]
#[Link('canonical', '/node/{node}']

With an EntityTypeProperty subclass, we can define the field_ui_base_route on entity type definitions to be added only when Field UI is installed as such:

#[ContentEntityType(
  id: 'node',
  label: new TranslatableMarkup('Content'),
...
)]
#[EntityTypeProperty(
  key: 'field_ui_base_route',
  value: 'entity.node_type.edit_form',
  moduleDependencies: ['field_ui'],
)]

Other entity type definition subclasses such as Handler, StorageHandler, Link will be added in follow up #3488054: Make it possible to define entity types with multiple smaller attributes. EntityTypeProperty is added in MR 10218 here, as well as the Field UI example change in Node.

Note: field_ui_base_route is used as the base route for local tasks on entity bundle admin paths: https://git.drupalcode.org/project/drupal/-/blob/11.x/core/modules/user/.... Changing it so that it is only defined when Field UI is installed might have some unexpected UI changes.

Remaining tasks

User interface changes

None.

API changes

Plugin classes can use PluginProperty attributes to add supplemental properties to their definitions.

Data model changes

Release notes snippet

Incomplete container when a request hits front controller before installer completes

$
0
0

Problem/Motivation

This issue first appeared in Drupal CMS #3493710: Installing with Safari 18.2 causes a WSOD but I believe it also affects the core installer.

I think I have a lead. Since #3442009: OOP hooks using attributes and event dispatcher hook implementations are stored in a container parameter. That parameter is dumped along with the container when the very first request is handled by the standard front controller (index.php) and DrupalKernel.

Normally the very first request taking this code path is the redirect after the installation. An installation will complete successfully if that is the case.


Any stray request handled by the default front controller and DrupalKernel during installation will trigger a container build / dump. I guess that this might have lead to problems before. But now that HookCollectorPass sets the hook_implementations_map parameter which is subsequently used by ModuleHandler when hooks are invoked, the effect of an outdated container loaded from cache is much worse.

In order to isolate its environment, the installer uses a special InstallerKernel with container dumping disabled. The final drupal_cms_installer_uninstall_myself step is executed in the installer environment as well. It actually does trigger a container rebuild, but the resulting container is not dumped. After the subsequent redirect, a stale container is loaded from cache and ModuleHandler uses an outdated hook implementations map where drupal_cms_installer hook implementations are still present.

Steps to reproduce

Run the web installer and randomly curl some URLs on the site before the installation process completes.

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Entity references larger then viewport on mobile

$
0
0

Problem/Motivation

The entity reference field with autocomplete is wider then mobile screens.

Tested with D 10.3.2

Steps to reproduce

  1. Add an entity reference field with limit of 2 or more values and autocomplete enabled to a content type
  2. Add content with mobile screen size.
  3. The autocomplete field is larger than the viewport of browser. The field moves outside of the visible area.

Proposed resolution

Fix the defect. Cannot seen this issue in Claro theme.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet


Double encoded ampersand in /admin/reports/updates

$
0
0

Problem/Motivation

Modules with an ampersand & in their name will be displayed double encoded.

Steps to reproduce

Install snr or klaro and call /admin/reports/updates

See also #3493374

Screenshot snr

Screenshot klaro

Use BufferingLogger at SmartDefaultSettingsTest

$
0
0

Problem/Motivation

Replace dblog/database with \Symfony\Component\ErrorHandler\BufferingLogger at SmartDefaultSettingsTest.

This is follow-up for #3494631: Remove FormattableMarkup from SmartDefaultSettingsTest.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Remove FormattableMarkup from SmartDefaultSettingsTest

$
0
0

Problem/Motivation

This is a part of #3227598: Remove uses of FormattableMarkup in kernel test assertions

There is no need to use FormattableMarkup to produce message strings in PHPUnit assertions; it is cleaner and easier in almost all cases to use simple string interpolation instead.

Proposed resolution

Remove FormattableMarkup from SmartDefaultSettingsTest.

Remaining tasks

Review MR.

Support brotli compression of assets

$
0
0

Problem/Motivation

Drupal supports compressing aggregated assets with gzip.
It would be nice to also support brotli, since it provides better performances.

advagg provides this functionality but only on non-aggregated files.

Proposed resolution

AssetDumper could be patched to also create brotli files.

Remaining tasks

I will submit a patch.

User interface changes

A new option will need to be added to /admin/config/development/performance.

Content Preview Popup Button Alignment Issue

$
0
0

Problem/Motivation

when you are previewing any node and try to leave the page a popup will appear asking leave preview or cancel those buttons alignment is not correct.

Steps to reproduce

1. Create a node
2. Fill all data
3. Click on preview
4. Click on any link (structure, appearance or any)
5. A popup will show with issue in buttons

Proposed resolution

add a margin of 14px to maintain same spacing from all sides.

Remaining tasks

Test and review

Content filter button misaligned

$
0
0

Problem/Motivation

in the content page search filter button is misaligned

Steps to reproduce

1. Goto content (/admin/content)
2. See the Search Filter Button is aligned from bottom that is incorrect.

Proposed resolution

Make the button aligned with other input boxes.

Remaining tasks

test and review

Links to entities with language set to 'Not specified' or 'Not applicable' should default to current UI language

$
0
0

Problem/Motivation

Entities with language set to 'Not specified' or 'Not applicable' are linked to the default language. Following such a link can change the UI language, which is not expected by the end user.

Proposed solution/idea

Links to entities with language 'Not specified' or 'Not applicable' should default to the current UI language.


[random test failure] ImageStylesPathAndUrlTest

$
0
0

Problem/Motivation

There seem to be numerous random fails in ImageStylesPathAndUrlTest

testImageStylePrivateWithConversion()

https://git.drupalcode.org/issue/drupal-3483501/-/jobs/3348830

There was 1 failure:
1)
Drupal\Tests\image\Functional\ImageStylesPathAndUrlTest::testImageStylePrivateWithConversion
Behat\Mink\Exception\ExpectationException: Current response status code is
403, but 200 expected.
/builds/issue/drupal-3483501/vendor/behat/mink/src/WebAssert.php:888
/builds/issue/drupal-3483501/vendor/behat/mink/src/WebAssert.php:145
/builds/issue/drupal-3483501/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php:315
/builds/issue/drupal-3483501/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php:136
FAILURES!
Tests: 10, Assertions: 240, Failures: 1.

testImageStyleUrlAndPathPrivate()

https://git.drupalcode.org/issue/drupal-2630732/-/jobs/3305640

There was 1 failure:
1)
Drupal\Tests\image\Functional\ImageStylesPathAndUrlTest::testImageStyleUrlAndPathPrivate
Behat\Mink\Exception\ExpectationException: Current response status code is
403, but 200 expected.
/builds/issue/drupal-2630732/vendor/behat/mink/src/WebAssert.php:888
/builds/issue/drupal-2630732/vendor/behat/mink/src/WebAssert.php:145
/builds/issue/drupal-2630732/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php:315
/builds/issue/drupal-2630732/core/modules/image/tests/src/Functional/ImageStylesPathAndUrlTest.php:85
FAILURES!
Tests: 10, Assertions: 240, Failures: 1.

...

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Remove references to Drupal CI in comments

$
0
0

Problem/Motivation

drupal ci is no more.
Comments should not reference it.

Steps to reproduce

Pull down code and search for drupal ci

Proposed resolution

Review and modify the comments appropriately.

Remaining tasks

User interface changes

N/A

Introduced terminology

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Dependent stylesheets are output in the wrong order (module to theme library dependency)

$
0
0

The source order of the CSS in the HTML matters, and it's important that we get this correct.

Current behavior

  • SDC CSS's tag will get injected into the HTML before any library CSS (including the base group). I expect this to be injected after any dependencies or any base group CSS
  • If I set a dependency on a SDC to a library, the library's CSS is still loaded after the component.

Expectation

  • If I load mytheme/my-library as a dependency to a component, I expect to see the CSS files in my-library loaded before the CSS files from my component
  • base group CSS should always be loaded before component group etc

Original summary

Problem/Motivation

The SDC component CSS <link> definitions are rendering before theme libraries CSS, even where they're keyed as base or theme. I have an example where a button in an SDC has styles that are being overridden by a reset base library that's rendered after the SDC.

Steps to reproduce

Enable SDC, create an SDC component in your default base theme. Create and include SDC component. Create a library with CSS with a base weight. Observe the SDC component.css rendering prior to the theme's reset.css.

style:
  version: VERSION
  css:
    base:
       reset.css: {}

Navigation Top Bar hides entity local tasks even if the user has no access to the bar

$
0
0

Problem/Motivation

When experimental navigation top bar module is enabled and user has access to the top bar, entity local tasks like "Edit" or "Translate" are removed from the tabs section and moved to a dropdown in the top bar.

This works nicely for users with access to the top bar.

However, access to top bar is not properly checked and users with no access to the navigation are missing the tabs and the top bar, making the administrative experience very poor.

Screenshot for admin user with access to navigation:

Screenshot for editor user with no access to navigation:

Steps to reproduce

  • Install a vanilla Drupal site and enable navigation and navigation_top bar module. Disable toolbar.
  • Create 2 users, both of them with access to modify any content, but only one of them with access navigation permission
  • Login as navigation available user and visit a node edit page
  • Confirm that tabs are gone and node actions have been moved to the top bar
  • Login as non-administrative user and visit a node edit page
  • Confirm that tabs are gone and top bar is not present, making the admin experience much worse

Proposed resolution

Check for access to navigation before hiding tasks

Remaining tasks

  • Improve logic to hide tabs if only the user has access to navigation in NavigationRenderer::removeLocalTasks()
  • Update NavigationTopBarTest to confirm the bug is fixed

User interface changes

API changes

Data model changes

Release notes snippet

Write functional javascript test for block visibility vertical tabs

$
0
0

Problem/Motivation

#3493182: Block visibility settings have summary duplicated in the title showed that we are missing test coverage for block visibility vertical tabs.

We should add some explicit coverage, specifically that the summaries have the correct text in them (the regression from the other issue), but would also be good to check clicking on one tab to make sure the correct form opens or similar.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Viewing all 297450 articles
Browse latest View live


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