Quantcast
Viewing all 295284 articles
Browse latest View live

Let modules opt in to the bundle-specific permissions form

Problem/Motivation

#2934995: Add a "Manage permissions" tab for each bundle that has associated permissions applied to all entity types that have bundles and set field_ui_base_route in the entity annotation. That issue was originally fixed in 9.3.x, then reverted because it conflicted with existing admin paths for at least one contrib module.

#2934995 was not reverted in the 9.4.x branch. One option is to leave it as is and warn contrib module maintainers to update their modules to be compatible. This issue is to implement another option: only add the new Permissions form if a module adds certain annotations to its entity classes.

Proposed resolution

  • Replace the route subscriber with a route provider.
  • Register a new link type.
  • Add annotations to core classes to use the new link type and route provider.

Remaining tasks

User interface changes

None

API changes

Replace Drupal\user\Routing\RouteSubscriber, which was added in #2934995: Add a "Manage permissions" tab for each bundle that has associated permissions, with Drupal\user\Entity\UserPermissionsRouteProvider.

Data model changes

None

Release notes snippet

Modules that define entity types can easily add Permissions forms for their entity types. See the change record https://www.drupal.org/node/3242827 for more information.


Document issue for FormStateInterface setErrorByName and setError

The message parameter can be string or MarkupInterface, but the document only say it can be string.

Dropdown (e.g. actions) inside tables changes the width of the column

Problem/Motivation

Dropdown (e.g. actions) in tables changes the width of the column when expanded.

Steps to reproduce

---
Image may be NSFW.
Clik here to view.

---
Image may be NSFW.
Clik here to view.

---
Tested with

  • Safari 14.1.1 (MacOS Big Sur 11.4 arm64)
  • Firefox 90.0 (MacOS Big Sur 11.4 arm64)
  • Chrome 91.0.4472.164 (MacOS Big Sur 11.4 arm64)
  • Drupal 9.2.1

Proposed resolution

Currently set width of the td .dropbutton-wrapper to 8em for both core and Claro (7em works for everything but Taxonomy).

Also posted the problem here: https://www.drupal.org/project/drupal/issues/1890266#comment-14167288 (last patch didn't work)

Release notes snippet

TBA

Use Twig to strip Twig syntax from help topics files in the syntax checker

Problem/Motivation

#3066512: Add checks for syntax and display of help topic Twig template files added a syntax checker which uses regular expressions to remove front matter and certain Twig syntax from the help topics files. Twig, however, has a much more flexible syntax -- for example {% set is just as good and {% set foo="}%" %} will also break the regular expression.

Proposed resolution

Fight fire with fire: use the Twig to render these things into HTML the way we need it.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

d7_field_formatter_settings should migrate the default view mode to default not full

Problem/Motivation

The d7_field_formatter_settings migration maps formatters used in full view mode to the default entity view display on the destination. This means that right now, the formatter migration rows of the same field are overriding each other's migrated configuration if the actual field has formatter data for both of these view modes on the source Drupal7 site.

Proposed resolution

Add a test case to the D7 fixture
Change d7_field_formatter_settings migration so that the default view mode is migrated correctly to a default display.

Remaining tasks

Patch
Review
Commit

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Apply width and height attributes to allow responsive image tag use loading="lazy"

Problem/Motivation

While playing with lazy loading attribute that is coming from Drupal core and our own implementation in #3060605: Support lazy loading of images @sasanikolic noticed that responsive image tag is missing width and height attribute. Why is Drupal core is not setting these attributes for lazy image loading which basically disable lazy loading for all responsive images? The short answer is that responsive images are more complicated. And it still needs to be implemented.

I've read quite a bit of info related to lazy loading and images and responsive images in the next resources:

In short, at least as I understand, the problem with lazy loading and responsive images was that in one moment browsers were not properly supporting width/height attributes when images were lazy-loaded. So the browsers were not able to calculate the aspect ratio of images and show image area while image was still loading - and this resulted in recalculating page layout on image load. However, this should be fixed in most or all browsers now and this combination should work.

Proposed resolution

  • Add width and height attributes to the responsive image tag.
  • Add an option to toggle the loading="lazy/eager" option in the picture field formatter. For this, see the great work being done in #3173180: Add UI for 'loading' html attribute to images. We should model a similar result for picture.

A UI toggle is needed in this issue. We've learned a few things since loading="lazy" has started to be heavily used. Mainly, always enabling it negatively affects the page's LCP score. See https://web.dev/lcp-lazy-loading/ for an exhaustive description of the problem.

Remaining tasks

We want to avoid browser reflow if loading=lazy is configured.

From #13:
The HTML spec has very recently been updated to allow for width and height attributes to be set on source elements:

https://github.com/whatwg/html/issues/4968
https://twitter.com/zcorpan/status/1365046132401913861
https://twitter.com/jensimmons/status/1365066057774493697

Current browsers implementation:

As of Oct 5th, 2021, it looks like FF is the only major browser not currently supporting this. Safari and Chrome already do.

The image dimensions are always provided. The srcset attribute only supports a single set of dimensions. These
dimensions reflect the real size but all images should follow the same
image size ratio. If using sizes and art direction, that might not be true.
For image styles, that is less of a concern because specifying image
density should already require that all images are the same image size
ratio. One could argue that providing wrong dimensions for sizes attribute
is bad for art direction. But having some image size to calculate ratio
is better than providing nothing. Ergo, we provide dimensions in all cases
even though they might be wrong in some edge scenarios.

These image dimensions are used by the browser to calculate the size and render a placeholder. This avoids content shift on page load. If someone decided to use lazy loading and art direction, they should not use sizes attribute. But rather image styles and specify the image dimensions. Because if they don't then they could conceivably experience some content shift issues.

User interface changes

Minor wording change due to #137:

Image may be NSFW.
Clik here to view.

API changes

None.

Data model changes

None.

ResponsiveImageStyles source plugin must extend DrupalSqlBase

Problem/Motivation

If one enables Responsive Images module, and tries to upgrate a Drupal 7 instance without the picture module's tables being available, an exception is thrown:

Migration failed with source plugin exception: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal_blue.picture_mapping' doesn't exist: SELECT "p".*, "map"."sourceid1" AS "migrate_map_sourceid1", "map"."source_row_status" AS "migrate_map_source_row_status"\n
FROM\n
"picture_mapping" "p"\n
LEFT OUTER JOIN drupal_blue.migrate_map_d7_responsive_image_styles "map" ON machine_name = map.sourceid1\n
WHERE ("map"."sourceid1" IS NULL) OR ("map"."source_row_status" = :db_condition_placeholder_0); Array\n
(\n
    [:db_condition_placeholder_0] => 1\n
)\n
 in [docroot]/core/lib/Drupal/Core/Database/Driver/mysql/ExceptionHandler.php line 53'

This happens because the ResponsiveImageStyles migrate source plugin extends SqlBase instead of DrupalSqlBase, so the source module requirement aren't checked by Migrate Drupal's MigrationPluginManager.

Proposed resolution

ResponsiveImageStyles source plugin must extend DrupalSqlBase.

Remaining tasks

  • Patch.
  • Test.

User interface changes

Nothing.

API changes

ResponsiveImageStyles source plugin extends DrupalSqlBase (following Drupal's Migrate API best practices).

Data model changes

Nothing.

Release notes snippet

Provide more specific messaging about the consequences of using an unsupported PHP version

Problem/Motivation

In #2917655: Deprecate or drop PHP 7.3 support in Drupal 9.4, we propose increasing \Drupal::MINIMUM_SUPPORTED_PHP to 7.4 in Drupal 9.4. This results in the following warning being displayed on installation, update, and the site status report:

Your PHP installation is too old. Drupal requires at least PHP 7.4.0. It is recommended to upgrade to PHP version 8.1 or higher for the best ongoing support. See PHP's version support documentation and the PHP requirements page for more information.

However, "the best ongoing support" is unclear, as are the consequences of continuing to use PHP 7.3. The specific consequences of using an old PHP version are explained in #2917655: Deprecate or drop PHP 7.3 support in Drupal 9.4.

Proposed resolution

Explain the consequences of PHP that is "too old" more clearly, either by improving the UI strings and/or adding more specific explanations to the system requirements documentation. See the issue summary of #2917655: Deprecate or drop PHP 7.3 support in Drupal 9.4 for what the consequences might be.

Also see #2670966: Warn users of old PHP versions and #2927344: Specifically warn about end dates for PHP support for old versions for examples of the previous messaging used in Drupal 8.

#4 could be addressed here as well.

Remaining tasks

This is postponed on #2917655: Deprecate or drop PHP 7.3 support in Drupal 9.4 and on finalizing the policy of what, exactly, will happen if a dependency does in fact drop support for PHP 7.3 between now and Nov. 2023.

User interface changes

TBD

API changes

Probably none.

Data model changes

None.

Release notes snippet

None.


Input field description is not visible in Configure dialog box of layout builder.

Problem/Motivation

While creating custom basic block through layout builder, form-item description is not visible in Configure dialog box.

Steps to reproduce

1. Home>Administration>Structure>Content types>Article,under layout options check layout builder.
2. Go to the article node, click on layout.
3. Click on Add block, create a custom block>basic block.
4. Title Input field description is not visible.

#states not affecting visibility/requirement of managed_file

Cannot affect the visibility or requirement of managed_file with states. Identical to this issue:

https://www.drupal.org/node/1118016

With this definition:

$form['type'] = array(
  '#type' => 'select',
  '#options' => array(
    'video' => t('Video'),
    'audio' => t('Audio'),
    'post' => t('Text'),
  ),
);

$form['audio'] = array(
  '#type' => 'managed_file',
  '#title' => t('Audio File'),
  '#states' => array(
    'visible'  => array(':input[name="type"]' => array('value' => 'audio')),
    'required' => array(':input[name="type"]' => array('value' => 'audio')),
  ),
  '#upload_location' => 'public://',
  '#upload_validators' => array(
    'file_validate_extensions' => array('mp3 wac'),
    'file_validate_size' => array(1048576),
  ),
);

I expect the visibility of "audio" to change when changing the value of "type". What happens is "audio" remains visible and not required. Simply changing "managed_file" to "file" brings the expected behavior.

Trigger a deprecation message when a deprecated module or theme is enabled at runtime

Promote the non-stable statuses in admin/appearance page, optionally even visually

Problem/Motivation

When #3124762: Add 'lifecycle' key to .info.yml files is committed, we will have three new non-stable theme states. At present there is a visual affordance to experimental themes at admin/appearance. But nothing at present for obsolete and deprecated.

Proposed resolution

Promote the non-stable statuses in admin/appearance page, optionally even visually

Remaining tasks

User interface changes

Before unistalled themes

Image may be NSFW.
Clik here to view.

After unistalled themes

Image may be NSFW.
Clik here to view.

After installed deprectated theme as default

Image may be NSFW.
Clik here to view.

API changes

Data model changes

Release notes snippet

Ajax binding should apply to dynamic elements

Problem/Motivation

DOM may be updated by various front end, back end or other ajax actions. Currently when an element with the class ".use-ajax" is added after the initial page load it usually isn't initialised. Although it might work for the admin user as the element binding could occur after the inistial DOM update (such as with VueJS or ReactJS).

To reproduce, create a dialog link with the class attribute use-ajax and data-dialog-type="modal", linking to another page. This should work.

Next, dynamically add another link, using either a JS front end or developer tools. Clicking on the link will take you to the page instead of opening a modal.

Proposed resolution

Find a way to delegate the event to a parent element or listen for dynamic updates.

The attached patch is non-compliant, and it doesn't include ES6 changes, but it does show one way to listen for dynamic updates.

Disabling tableselect element options

Problem/Motivation

There's no handy way to mark some rows as disabled for selection in a tableselect element. The feature is needed when the user should be denied to select certain options, according to a form business logic, but he still need to know that the options exist and might be available in other context.

Proposed resolution

Allow to pass an optional #disabled property in option. When an option has #disabled === TRUE, the corresponding checkbox will be disabled.

Workaround

Without this change there's still possible to disable certain rows:

  1. Add an additional #process callback to the tableselect element. Note that you should add also the original processor:
    $form['my_table'] = [
      '#type' => 'tableselect',
      ...
      '#process' => [
        // This is the original #process callback.
        [Tableselect::class, 'processTableselect'],
        // Additional #process callback.
        [static::class, 'processDisabledRows'],
      ],
      ...
    ];
    
  2. The additional #process callback:
    public static function processDisabledRows(array &$element): array {
      foreach (Element::children($element) as $key) {
        $element[$key]['#disabled'] = isset($element['#options'][$key]['#disabled']) ? $element['#options'][$key]['#disabled'] : FALSE;
      }
      return $element;
    }
    
  3. Set the #disabled property to TRUE on the rows that you want to disable:
    $form['my_table'] = [
      '#type' => 'tableselect',
      ...
      '#options' => [
        'row1' => [
          'col1' => '1.1',
          'col2' => '1.2',
        ],
        // This row is disabled.
        'row2' => [
          'col1' => '2.1',
          'col2' => '2.2',
          '#disabled' => TRUE,
        ],
      ],
      ...
    ];
    

Remaining tasks

None.

User interface changes

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

API changes

A tableselect element can have disabled options.

Data model changes

None.

Release notes snippet

By adding a #disabled property set to TRUE, it's possible to prevent used by selecting certain options in a tableselect form element.

Initial report

Currently it is not possible to disable an option on a tableselect list.
Can we allow a Tableselect checkbox to be disabled on a specific option, like it currently is possible with the attribute and ajax parameters?

Show third party message on oEmbed resource exception

Problem/Motivation

When an oEmbed resource is fetched this message is shown:
"The provided URL does not represent a valid oEmbed resource."
This information is usually not enough to figure out the problem without looking at the logs.

Steps to reproduce

Attempt to save an entity that holds a Facebook video without an OAuth token.

Proposed resolution

A better message might be a message that not only explains what happened in the Drupal context but also what happened in the third-party context, and that information is sent in the message included in the response to the fetch request.


Update location.hash when clicking a vertical tab

Problem/Motivation

This ability to link to a vertical tab was introduced in #376293: Activate current vertical tab from URL fragment and has been merged. You currently can use the case-sensitive vertical tab id as the hash, but without knowing how this works users cannot link to specific tabs.

For example if I wanted to link a user to authoring information I would need to know that in Drupal 8 I would need to add #edit-author to the end of the URL. Ideally when authoring information is clicked the window hash should be updated to reflect the tab that is open.

Proposed resolution

When clicking the vertical tab, the URL in the browser should be updated with the relevant hash of the tab. If this URL is entered in to a new browser said tab should be open by default and brought in to the users view.

Before clicking on the vertical tab link switches the tab pane, but does not change the hash in the URL bar:

Image may be NSFW.
Clik here to view.

After clicking on the vertical tab link (including mouse and keydown) switches the tab pane AND changes the hash in the URL bar:

Image may be NSFW.
Clik here to view.

After pasting this URL with the preserved hash into a new window highlights the relevant tab and scrolls down to it:

Image may be NSFW.
Clik here to view.

Remaining tasks

Backport to 8.2.x (Should be the same patch)
Backport to 7.x potentially based on patch #2 which was created for 7.38

User interface changes

Minimal changes. A page with a hashed URL will be scrolled down, and focused on the relevant vertical tab. If the relevant tab is not the default open tab, the default will be closed and the tab from the hash will be opened.

API changes

N/A

Data model changes

N/A

Local Setup getting this Error "redirected you too many times"

Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

[meta] Remove IE11 Support from Claro

Problem/Motivation

This is part of #3252084: [meta] Remove support for IE11 where the work needed for each component will be tracked.

This issue is to remove IE11 support specifically from Claro and the files that live inside the theme.

Remaining tasks

@todo create a list of tasks.

User interface changes

Admin UI won't support IE11 anymore.

Release notes snippet

@todo

Change various tests that test with "all themes" to also include Olivero

Remove obsolete region overrides in tests

Problem/Motivation

#3257407: Use "content" region in BlockCreationTrait::placeBlock() instead of "sidebar_first" included some region overrides in tests to work-around #3257504: Empty toolbar tray displays a stray orientation toggle. Both of those have been committed now, but they were committed very close to each other so the workarounds were not removed in time. Now they are obsolete, though.

Steps to reproduce

-

Proposed resolution

Remove the - now unnecessary - region overrides.

Remaining tasks

User interface changes

-

API changes

-

Data model changes

-

Release notes snippet

Viewing all 295284 articles
Browse latest View live


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