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

dialog.es6.js uses inline CSS to apply visually-hidden

$
0
0

Problem/Motivation

Drupal.behaviors.dialog.prepareDialogButtons contains the following code:

// Hidden form buttons need special attention. For browser consistency,
        // the button needs to be "visible" in order to have the enter key fire
        // the form submit event. So instead of a simple "hide" or
        // "display: none", we set its dimensions to zero.
        // See http://mattsnider.com/how-forms-submit-when-pressing-enter/
        const $originalButton = $(this).css({
          display: 'block',
          width: 0,
          height: 0,
          padding: 0,
          border: 0,
          overflow: 'hidden',
        });

This is the inline css variant of the visually-hidden class.

Proposed resolution

Use the visually-hidden class to visually hide the buttons, so the css can be overridden by themes.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

None.

API changes

None.

Data model changes

None.


Umami Theme - follow-up - remove elements, use classes in CSS

$
0
0

Item 4 from here needs attention
https://www.drupal.org/project/drupal/issues/2904243#comment-12405231

+++ b/core/themes/umami/css/components/blocks/footer-promo/footer-promo.css
@@ -0,0 +1,47 @@
+.footer-promo__text a {
...
+.footer-promo__text a:after {

+++ b/core/themes/umami/css/components/navigation/tabs/tabs.css
@@ -0,0 +1,35 @@
+.tabs li {
...
+.tabs a {
...
+.tabs a.is-active {
...
+.tabs a:focus,
+.tabs a:hover {

Please go through the CSS selectors using elements. We should try convert as many of them to classes as we can since it will make future changes easier for us.

Add test to assert ajax buttons are operable with the spacebar key.

$
0
0

Spin-off from #2996404-3: Replace old keypress workaround in AjaxFormImageButtonTest.

Problem/Motivation

AjaxFormImageButtonTest has a test to assert that ajax-enabled buttons are keyboard operable, by pressing the ENTER key when focussed. However buttons are expected to respond when either the enter OR spacebar key is pressed. Let's cover this situation too.

It's common to see faux-buttons like this in the wild:

<a href="#" role="button" onclick="foo()">Edit</a>

The button role tells screen readers to announce it as a button, yet it doesn't behave like a button because it can't be activated by the space key. That's a bug we can guard against by testing both keys.

Proposed resolution

Replicate the ENTER key press test in AjaxFormImageButtonTest, so we are testing the desired SPACE key behaviour too.

Remaining tasks

Patch for AjaxFormImageButtonTest.

User interface changes

None.

API changes

None.

Data model changes

None.

Move REQUIREMENT_* constants out of install.inc file

User context missing when using toUrl in some circumstances

$
0
0

This error is could likely be repro'd out of tests, but reporting as I see it.

Using toUrl within a Kernel test results in the following uncaught exception.

Drupal\Component\Plugin\Exception\ContextException: The 'entity:user' context is required and not present.

This is causing the tests for Linky project to fail. This may be caused by new code introduced this year in #2942907: Entity system does not provide an API for retrieving an entity variant that is safe for editing, specifically the changes introduced to \Drupal\Core\ParamConverter\EntityConverter::convert

No error messages are shown for applied validation on a view exposed filter with on "AJAX"

$
0
0

The applied validation error messages are not shown for a view exposed filter on failure when "Ajax" is on.

ajax-option

the messages are displayed again on next page load.

There is an older issue opened for Drupal 7

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

Recommended solution:


function MODULE_views_ajax_data_alter(&$commands, $view) {
$commands[] = ajax_command_prepend($commands[0]['selector'], theme('status_messages'));
}

Is the correct way to solve the problem or solution should be implemented in views module itself ?

Views AJAX arguments are not HTML decoded

$
0
0

Problem/Motivation

The JavaScript Views arguments setting (views.ajaxViews.views_dom_id:ID.views_args) will get HTML escaped on line 62 of the views.module file, but when passed back to Drupal via AJAX and picked up on line 117 of ViewAjaxController.php the arguments are not decoded causing issues with any arguments that contain HTML entities. For example, a Views argument of "This & That" will be "This &amp; That" in the JavaScript settings object, but it will not get decoded when passed back to Drupal so the string "This &amp; That" will be used instead of the original string "This & That" on any AJAX request.

Steps to reproduce (there are probably easier ways to reproduce, but this is my set up):

  1. Create a entity reference field on a node of type foo like field_type_bar_nodes
  2. Create a type bar node titled "This & That"
  3. Create two type foo nodes with the entity reference field referencing the "This & That" node
  4. Create a view page listing type foo nodes with AJAX enabled and a pager paging one node at a time
  5. Add a relationship with "Content referenced from field_type_bar_nodes"
  6. Configure a contextual filter using that relationship as a "Query parameter" filter
  7. Go to the view page at /VIEW_URL?field_type_bar_nodes=This%20%26%20That
  8. Click the next button and notice how the pager does not work as it should by showing the second node

Proposed resolution

Decode the Views arguments on re-entry into Drupal.

RouteNotFoundException: Route "search.view_node_search" does not exist after installing AdaptiveTheme

$
0
0

Hi,
I am new to drupal.Currently while installing a "adaptivetheme-8.x-1.0-rc2" theme,my website crashed during module installation and now its not running.Within log the error is --

Uncaught PHP Exception Symfony\Component\Routing\Exception\RouteNotFoundException: "Route "search.view_node_search" does not exist." at E:\wamp64\www\drupal\core\lib\Drupal\Core\Routing\RouteProvider.php line 187.

Please guide.


SOLUTION: drush cr clears the cache. See drush for more info.

Invalidating 'node_list' and other broad cache tags early in a transaction severely increases lock wait time and probability of deadlock

$
0
0

Problem/Motivation

Suppose you have some content entity type (foo) with an entity reference to nodes, and you have contrib or custom code that needs to update something about the referenced nodes whenever the host entity is updated. So you implement hook_foo_presave() or hook_foo_update(), and in that function you load the referenced nodes, do something to them, and save them.

By design, all of this happens within a single database transaction: SqlContentEntityStorage::save() starts the transaction prior to invoking hook_foo_presave() and doesn't commit the transaction until after all hook_foo_update() implementations complete.

Meanwhile, when the first child node is saved, Entity::invalidateTagsOnSave() invalidates several broad tags ('node_list' and '4xx-response') that are not specific to the particular node, which causes DatabaseCacheTagsChecksum::invalidateTags() to send a merge (UPDATE) query to the corresponding records in the {cachetags} table.

This causes the database engine (e.g., InnoDB) to acquire a row lock on those records, which it doesn't release until the end of the transaction. However, if there are more child nodes that need to be saved, or other slow hook implementations that need to be performed, prior to the end of the transaction, then these locks could last 10, 20, or more seconds.

Now suppose you have concurrent users editing foo entities on this site. Even if they're editing different foo entities with different child nodes, they all end up competing for the same lock on the 'node_list' cache tag. Depending on how long they each need to wait, this could end up appearing as a deadlock, or in some cases, even lead to real deadlock.

Proposed resolution

Change DatabaseCacheTagsChecksum to delay updating the database with cache tag invalidations until just before the end of the transaction. However, also have its isValid() return FALSE while there are not-yet-committed invalidations. This way, other requests continue seeing the old value until the end of the transaction (which is already the case in HEAD, since that's how transactions work), while later code in the same request (e.g., other presave/update hooks) continues to see the invalidation as having already occurred (just as in HEAD).

If done right, I think this is fully backwards compatible, while reducing to practically 0 the time that a {cachetags} record lock is held.

Remaining tasks

  • Write patch.
  • Review if the idea and implementation are sound.
  • Figure out what test coverage to add.

User interface changes

None.

API changes

A public method addition to Drupal\Core\Database\Connection for adding callbacks to run just prior to transaction commit.

Data model changes

Failed while updating from 8.6.15 to 8.7.x: Update aborted by: menu_link_content_post_update_make_menu_link_content_revisionable

$
0
0

Attemp to update my site from 8.6.15 to 8.7.0 using: composer update drupal/core webflo/drupal-core-require-dev --with-dependencies as always.

All modules are updated to last release and the site with version 8.6.15 was working with no a single error.

After successfully running composer update drupal/core webflo/drupal-core-require-dev --with-dependencies, I tried to update the site from UI,

Available Updates:

system module
8701 - Remove the unused 'system.theme.data' from state.
8702 - Add the 'revision_translation_affected' entity key.
Initialize 'expand_all_items' values to system_menu_block.
Clear the menu cache. @see https:www.drupal.orgprojectdrupalissues3044364
comment module
8700 - Set the 'owner' entity key and update the field.
8701 - Make the 'entity_type' and 'field_name' comment fields required.
Add comment settings.
file module
8700 - Set the 'owner' entity key and update the field.
node module
8700 - Set the 'owner' entity key and update the field.
taxonomy module
8701 - Add an index on the 'taxonomy_term__parent' field table.
Update taxonomy terms to be revisionable.
Remove the 'hierarchy' property from vocabularies.
layout_discovery module
Recalculate dependencies for the entity_form_display entity.
Recalculate dependencies for the entity_view_display entity.
menu_link_content module
Update custom menu links to be revisionable.
views module
Update exposed filter blocks label display to be disabled.
Rebuild cache to allow placeholder texts to be translatable.

while updates are running, and more specifically when the "Post updating layout_discovery", I am receiving the below error:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /update.php/start?id=352&op=do_nojs&op=do
StatusText: OK
ResponseText: TypeError: Argument 1 passed to Drupal\Core\Entity\EntityStorageBase::loadMultiple() must be of the type array or null, string given, called in S:\Sites\dev\web\core\modules\views\src\Plugin\views\filter\EntityReference.php on line 397 in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 256 of S:\Sites\dev\web\core\lib\Drupal\Core\Entity\EntityStorageBase.php).

When I click on the available link: see full error in details, the below messgae displayed:

Notice: Undefined offset: 1 in Drupal\system\Controller\DbUpdateController->results() (line 413 of core\modules\system\src\Controller\DbUpdateController.php).
Drupal\system\Controller\DbUpdateController->results(Object) (Line: 179)
Drupal\system\Controller\DbUpdateController->handle('results', Object)
call_user_func_array(Array, Array) (Line: 115)
Drupal\Core\Update\UpdateKernel->handleRaw(Object) (Line: 76)
Drupal\Core\Update\UpdateKernel->handle(Object) (Line: 28)

The update process was aborted prematurely while running update # in menu_link_content_post_update_make_menu_link_content_revisionable.module.

Any help please ? Thank you

Support entities that are neither content nor config entities

$
0
0

By design the module exposes resources for every entity type in the system. However, if your aplication contains an entity which does not implement ContentEntityTypeInterface or ConfigEntityTypeInterface, the module throws a whitescreen/500 error when installing or rebuilding cache, which upon checking the logs says:

LogicException: Only content and config entity types are supported. in Drupal\jsonapi\ResourceType\ResourceTypeRepository->getAllFieldNames() (line 285 of /var/www/html//modules/contrib/jsonapi/src/ResourceType/ResourceTypeRepository.php).

It might not be the usual use case to support non-content/config entities, but it would be nice to handle them in a way that doesn't break the system, like excluding them from resources and relationships.

No version key/value pair in new core modules (json_api, migrate_drupal_multilingual)

$
0
0

Problem/Motivation

  1. Install 8.7.1
  2. Go to /admin/modules
  3. Expand the Description for JSON:API

Notice there is no Version: 8.7.1 listed with the other requirements/details.

Adding "version: VERSION" to jsonapi.info.yml solves the problem.

Proposed resolution

Add a test to ensure all core provided modules have a version key with the expected value.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/a

No redirection to vocabulary overview page after create a new term

$
0
0

Usability issue:

After creating a new term, on click 'Save', it doesn't redirect to vocabulary overview page.
It seems like, this functionality needs to be fixed?

Modal popups in views is not showing properly when toolbar tray is upon modal

$
0
0

Steps to reproduce:
1) Set toolbar tray in vertical orientation.
2) Edit any view eg: www.example.org/admin/structure/views/view/content.
3) Click on any link on view page which will open in modal popup. Eg: click on settings under format.

Views modal popup in horizontal toolbar orientation
views-modal-horizontal-toolbar-orientation.png

Views modal popup in vertical toolbar orientation
views-modal-vertical-toolbar-orientation.png

MigrationLookup's skipOnEmpty() means you can't provide a default value if a lookup fails

$
0
0

MigrationLookup::transform() calls a helper method, skipOnEmpty(), and that throws a MigrateSkipProcessException if the source value for the lookup is empty.

But that means that a process pipeline can't specify a default value if a source row .

eg:

process:
  uid:
    -
      plugin: migration_lookup
      migration: users
      source: author
    - 
      # we never get here is 'author' is empty
      plugin: default_value
      default_value: 1

In particular, this means that a stub row created for an outer migration's lookup will always skip processing here, because the stub row creation won't provide a source value for the inner lookup.


Same visibility options of blocks when used in layout builder as in block layout

$
0
0

Hi @ all,

since layout builder is out it's a really awesome feature for non developer users like I am one (site builder/themer only).

When I include a block in my layout builder layout, there is no possibility to limit visibility for e.g. by role, path etc. as I can do it in the "old" block layout.

Example use case

If you create a page layout for your front page, you want to render different blocks/fields depending on role. so that users see different content if they are anonymous or registered.

Form blocks rendered inside layout builder break save

$
0
0

I can no longer save changes to the layout after any kind of form has been added to the layout.

Steps to reproduce:
1. Enable layout builder on a content type, then open layout builder.
2. Add 'Search Form' block to a section
3. Save the layout
4. Re-open the layout builder, and make some change (e.g. reorder blocks)
5. Attempt to save the layout

The page refreshes, but still shows unsaved changes. At this point, it is no longer possible to save the layout until the search form is removed.

[policy, then patch] Decide on coding standard for configuration keys of ConfigEntities

$
0
0

Problem/Motivation

The member variables of ConfigEntity's map 1-to-1 to the configuration keys in the corresponding config YAML files. Coding standards dictate lowerCamelCase for member variables in OOP code and underscore_separated for config keys. We need to decide what we want here. Most ConfigEntity's are not bitten by this, because they only contain one-word keys, in which case lowerCamelCase and underscore_separated fall together. :-)

We already have an inconsistency in core with the View entity (View::base_table) and the Breakpoint and BreakpointGroup entities.

Proposed resolution

-

Remaining tasks

Decide on one of the following:

  1. Make class members of configuration entities that map to configuration keys underscore_separated.
    Con: This violates the coding standards for object-oriented code.
  2. Make configuration keys that map to class members of configuration entities lowerCamelCase.
    Con: This violates the coding standard for configuration keys.
  3. Change our coding standard to require lowerCamelCase for all configuration keys.
    Con: It feels unnatural to use lowerCamelCase for non-object-oriented code. (This in a way applies to 2. as well.)
  4. Introduce an abstraction layer that maps underscore_separated configuration keys to lowerCamelCase class members.
    Con: More code, additional abstraction.

User interface changes

-

API changes

-

Add optional support for CKEditor 5 in D9 so we can remove CKE 4 from Drupal 10

$
0
0

Problem/Motivation

Drupal 8 is running on CKEditor 4.x. CKEditor 5.x has gone stable and looks like it has enhancements to help improve the authoring experience.

CKEditor 5 also no longer relies on inline JavaScript, which requires a more permissive Content Security Policy due to its use in CKEditor 4 (#2789139: [upstream] CSP requires 'unsafe-inline' because of CKEditor 4).

Proposed resolution

Upgrade CKEditor in Drupal to 5.x.

Remaining tasks

TBD

User interface changes

TBD

API changes

A migration guide has been provided from migrating from 4.x to 5.x, covering plugins, skins, and APIs:

Data model changes

TBD

"reset password" page ignores the user's language selection

$
0
0

The "reset password" page that comes up after clicking on a one-time login link uses the default site language instead of the user's language.

To reproduce this, you need the localization module activated, more than one language installed, and a user that has changed the language in their profile.

Hans

Viewing all 293950 articles
Browse latest View live