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

InvocationMocker::withConsecutive() is deprecated in PHPUnit 9.6 and removed from PHPUnit 10

$
0
0

Problem/Motivation

InvocationMocker::withConsecutive() is removed from PHPUnit 10. It was previously meant to be deprecated in that branch but this commit actually removed it.

In PHPUnit 9.6, using withConsecutive() will yield a deprecation error, https://github.com/sebastianbergmann/phpunit/issues/5035

Therefore the use of the method needs to be replaced.

See https://github.com/sebastianbergmann/phpunit/issues/5063

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


ContentEntity migration source doesn't consider the migration map

$
0
0

Problem/Motivation

The migration system keeps track of what has been migrated already from a source by writing a record for each migrated source row to a map table.

The SqlBase source plugin base class makes use of the map table by doing an SQL JOIN to the map table, so that the source query is filtered to only those source records that haven't already been imported.

This means that if you do an incremental migration, the migration process doesn't have to go through lots of source records that have already been imported, because they are simply eliminated from the query result.

However, the ContentEntity migration source, which provides entities from the current Drupal site as the source rows, doesn't consider the map.

This means that if you do an incremental migration, or do your migration in batches, either for performance or during development, ALL the entities that have already been migrated are iterated over, loaded, and checked against the map.

This makes incremental migrations very slow, as they have to go over all the already migrated entities before they get to entities that need to be migrated.

Steps to reproduce

Run an incremental migration with lots of source records (10k or so).

Proposed resolution

Move the addMapJoin() method to a new MapJoinTrait.

Use the new trait in both SqlBase and ContentEntity.

In ContentEntity, get the SQL query from the source entity query, and JOIN to the map table.

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

TBD

When duplicate the view as entity references, the pager doesn't work.

$
0
0

Problem/Motivation

For drupal version: 9.5.7
When duplicate the view as entity references, the pager doesn't work.

Steps to reproduce

1.Create views of any entity (view id:test), e.g. node.
2.Publishes articles for this entity. (At least two articles)
3.Duplicate the view as entity reference, set Advanced > Machine Name: (test)
4.Set view paper for Display a specified number of items.
5.Enter 1 to Items per page.
6.Install modules (token, token_filter, text_block, insert_view_adv)
7.Set Full HTML formats (/admin/config/content/formats)
8.Enabled filters: (Advanced Insert View, Replaces global and entity tokens with their values)
9.Filter processing order: (Advanced Insert View) for 1, (Replaces global and entity tokens with their values) for 2.
10.Place block: (/admin/structure/block), search (Text Block) and click Place block.
11.Type code: (select Full HTML editor)
<drupal-view data-arguments='' data-display-id='test' data-view-id='test'></drupal-view>
12.Access the node page.
13.You will see it to print all items, rather than one by settings. (the step 5)

Proposed resolution

Improve the steps to reproduce - See #13

Remaining tasks

Improve the steps to reproduce - See #8

User interface changes

API changes

Data model changes

Release notes snippet

EntityReferenceFieldItemList::referencedEntities might not return up-to-date entity objects

$
0
0

Problem/Motivation

EntityReferenceFieldItemList::referencedEntities in its current implementation will collect all the target ids from the field items and then collect the referenced entity objects by calling loadMultiple, but this is faulty in the following use cases:

  1. An entity cloned object has been set on some of the field items -> load will not return this one but a different one.
  2. resetCache is called after the entity objects have been initialized on some of the field items.

Proposed resolution

EntityReferenceFieldItemList::referencedEntities should first collect the entities which are already set on the field items and load the remaining ones through loadMultiple.

Remaining tasks

  • Add test coverage
  • Review

User interface changes

None.

API changes

None.

Data model changes

None.

Use layout builder for content add/edit form

$
0
0

Allow the layout builder to take over the entity edit form. We could show the entity form above the layout builder or in the sidebar.

Error: Call to a member function getSetting() on null in Drupal\comment\Controller\CommentController->commentPermalink() (line 125 of core/modules/comment/src/Controller/CommentController.php).

$
0
0

My apologies in advance if this is not done correctly. It's my first time submitting an issue, and I wasn't sure what to enter for Issue tags.

Background

Learning Drupal 8 using the book Mastering Drupal 8: An advanced guide to building and maintaining Drupal websites by Chaz Chumley and William Hurley. Currently on page 213: Creating Comments, which illustrates how to generate dummy comments via the Terminal.

Issue

Environment

  • OS: Ubuntu 18.04.1
  • PHP version: 7.1.25-1
  • MySQL version: 5.7.24

Repeatable

Always.

Expected Behaviors

After generating dummy comments via the Terminal drupal console:

Actual Behaviors

After generating dummy comments via the Terminal drupal console:

Steps Taken

  1. In Terminal window, typed drupal create:comments with options 2, 5, 5, and 1. Completed successfully.
  2. In Firefox, went to http://localhost/drupal8/web. Logged in as admin. Completed successfully.
  3. Clicked Manage > Content. Greeted with the following red error message:
             Notice: Undefined index: comment in Drupal\comment\Controller\CommentController->commentPermalink() (line 122 of core/modules/comment/src/Controller/CommentController.php).
    
    Drupal\comment\Controller\CommentController->commentPermalink(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 669)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
         
  4. Clicked Comments tab. Mixed results: I see the same red error message above, but followed by a successful listing of the 5 comments I generated via the Terminal command.
  5. Clicked any of the comment titles to open the pertinent comment record. Greeted with the following error message:

    The website encountered an unexpected error. Please try again later.
    Error: Call to a member function getSetting() on null in Drupal\comment\Controller\CommentController->commentPermalink() (line 125 of core/modules/comment/src/Controller/CommentController.php).

    Drupal\comment\Controller\CommentController->commentPermalink(Object, Object)
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 582)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 669)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
    

Other Info

A Google search of the error message revealed this previously closed issue:

Fatal error: Call to a member function getSetting() on a non-object in core/modules/comment/src/Entity/Comment.php on line 531

Could this be somehow related?

Thank you!
Eddie

incorrect example code in Token docs

Autocomplete has lower z-index than ui-dialog

$
0
0

Problem/Motivation

jquery ui-autocomplete dropdown is hidden by ui-dialog popup, but should be z-indexed above

Steps to reproduce

1. You have to create the link which is triggering ui-dialog by click.
2. Put the form inside dialog's content
3. Add at least one field with autocomplete into this form.
4. Try to open dialog and type something into autocomplete and you will not see ui-autocomplete, since it's located "under" ui-dialog.

If everything is ok -> try to put ui-dialog not in the root of document, but with appendTo option defined https://api.jqueryui.com/dialog/#option-appendTo.

Proposed resolution

1. Decide and create unique z-index for ui-autocomplete, which should have higher value than ui-dialog and update this page https://www.drupal.org/docs/theming-drupal/z-indexes-in-drupal-8
2. Update all related core themes.

Current behavior

Autocomplete low z-index

Expected behavior

Autocomplete high z-index


'forms-inline' class should ensure all direct descendants are inline

$
0
0

This is a followup from #3224958: Olivero should style Views exposed filters as inline (currently are stacked)/

Within Olivero we're adding the following code which ensures that all direct descendants will be inline (which is the expectation when setting that CSS class)

.form--inline > * {
   display: inline-block;
   margin-top: 0.5625rem;
   margin-bottom: 0;
   vertical-align: top; /* Ensure proper alignment if description is present. */
 }

We should do this within all of Drupal core, as it's a more robust solution rather than relying on the child elements CSS class.

.ajax-progress--fullscreen z-index should be higher than .ui-dialog when triggered in a modal.

$
0
0

OS: Ubuntu 18.04.4 LTS
PHP Version: 7
Drupal Version: 8.8.x

Problem/Motivation

- The .ajax-progress--fullscreen z-index is set to 1000 in '/claro/css/components/ajax-progress.module.css', line 141.
- The .ui-dialog z-index is set to 1260 in '/claro/css/components/ajax-progress.module.css?', line 14.
- For people opening a single dialog, this is fine, as the .ajax-progress--fullscreen is replaced by the .ui-widget-overlay and the dialog itself. However, when the .ajax-progress--fullscreen is triggered from an already open dialog, the current dialog remains exposed for accidental multiple submissions at z-index 1260 (until it is replaced by the new dialog) as the loader is running behind it at index 1000.

Proposed resolution

Increase the z-index of the .ajax-progress--fullscreen class above that of the .ui-dialog class.

Currently .ui-dialog have a z-index of 1260. As suggested in #9, we can have z-index as 1500.

--jui-dialog-z-index: 1260;
.ui-dialog {
  z-index: var(--jui-dialog-z-index);
}

Thank you for Claro and all of the hard work going into it!!!

Jeremy

Automatically declare computed base fields to Views

$
0
0

Problem/Motivation

Support for output of computed base fields was added in #2852067: Add support for rendering computed fields to the "field" views field handler, but these fields still have to be declared explicitly to views data -- as can be seen in EntityTestViewsData.

Proposed resolution

EntityViewsData should find computed base fields and declare them automatically.

Remaining tasks

User interface changes

API changes

Computed base fields are automatically declared to Views. Contrib or custom modules that currently declare them explicitly will find them declared twice until they remove their custom code.

Data model changes

Release notes snippet

Views Block Display skips preBlockBuild() call on ajax rebuild

$
0
0

Problem/Motivation

The \Drupal\views\Plugin\views\display\Block::preBlockBuild() method is responsible for manipulating the view before it is rendered by the corresponding block plugin. The block plugin itself actually calls this method, however blocks cannot show exposed filters without using ajax, and the ajax rebuild for views will not call the preBlockBuild() method.

As a practical example, blocks can override the number of results per page for a view, however if they leverage ajax rebuild, on the first rebuild (which is also used for pagers) the view will be rendered without the block's overrides. If the default view shows 50 per page, and the override shows 5, the first ajax call will result in the view now showing 50 instead of 5.

Proposed resolution

Add new function to view Block.php display plugin (getBlockFromAjaxRequest) that runs when ajax is used in a view block.
Adding new function (preparePreview) to DisplayPluginInterface

Previous solution
The views/ajax controller needs to consult the block when rebuilding block displays. Doing this generically is likely to be a bit convoluted.

Remaining tasks

Identify a solution.
Implement it.
Change record (maybe)
Review
Commit

User interface changes

NA - working ajax for view blocks now.

API changes

NA

Data model changes

NA

[meta] Fix and re-enable tests skipped for random failures

$
0
0

Problem/Motivation

Follow-up from #3267124: Temporarily skip failing tests.

The following JavaScript test methods are currently skipped for random fails:

Layout Builder

  1. LayoutBuilderDisableInteractionsTest::assertContextualLinksClickable()
  2. #3272540: [random test failure] Restore LayoutBuilderTest::testLayoutBuilderUi()
  3. #3274053: [random test failure] Restore LayoutBuilderNestedFormUiTest::testAddingFormBlocksToDefaults()
  4. #3351500: Skip Drupal\Tests\layout_builder\FunctionalJavascript\ContextualLinksTest
  5. LayoutBuilderNestedFormUiTest::testAddingFormBlocksToOverrides()
  6. LayoutBuilderUiTest::assertHighlightNotExists()

Other

Proposed resolution

  1. File children to debug and un-skip each.
  2. Un-skip one method per issue and run the affected test 500x.
  3. Queue 8 test runs of 1000x against MySQL or MariaDB environments.
  4. Post a patch that un-skips the test without any attempted fix to get a baseline fail rate, and always test this patch at the same time as any proposed fix with the same environment.
  5. Skip other methods in the test if it becomes necessary due to out-of-scope fails.

Remaining tasks

  1. Add items to the above summary for::

Already fixed

  1. \Drupal\Tests\ckeditor5\FunctionalJavascript\MediaLibraryTest::testButton: #3268368: Robustify and restore \Drupal\Tests\ckeditor5\FunctionalJavascript\MediaLibraryTest::testButton
  2. LayoutBuilderDisableInteractionsTest::testFormsLinksDisabled(): #3268680: [random test failure] Restore and fix LayoutBuilderDisableInteractionsTest::testFormsLinksDisabled()
  3. #3272797: [random test failure] Restore LayoutBuilderTest::testConfigurableLayoutSections()
  4. QuickEditIntegrationTest::testArticleNode()#3268244: [random test failure] Un-skip and fix QuickEditIntegrationTest::testArticleNode()
  5. QuickEditIntegrationTest::testCustomBlock()#3267258: Remove Quick Edit support from editor.module
  6. AjaxBlockTest::testAddAjaxBlock()#3304371: Fix intermittent failure in AjaxBlockTest
  7. ContentPreviewToggleTest::testContentPreviewToggle(): #3268678: [random test failure] Restore ContentPreviewToggleTest::testContentPreviewToggle()
  8. SettingsTrayBlockFormTest::testEditModeEnableDisable(): #3304901: Fix intermittently failing Settings Tray Functional Javascript tests

Incorrect access denied messages in branding block

$
0
0

Error description refers to incorrect element

when a user does not have permission to edit the site name or slogan, an incorrect access denied message is displayed: "Defined on the Site Information page. You do not have the appropriate permissions to change the site logo." it refers to "site logo".

Bad access denied msgs

Error refers to pages the user does not have access

When a user does not have permission to do something, we don't usually have an explanation message.

I'd like to propose removing the "You do not have the appropriate permissions to change the ...." message. I have a client that became confused why he was not granted permission to do something, despite being so close to being able to do it.

And remove the "Defined on the XXX page." text if the user does not have permission to access it.

Steps to reproduce

  1. Add a new user and assign a role other than administrator say Content Editor (comes default with Drupal 10)
  2. Login with the newly created user and go to /admin/structure/block
  3. From the admin permissions page /admin/people/permissions, give permission to "Administer blocks" for the "Content Editor"
  4. Configure Site Branding block /admin/structure/block/manage/olivero_site_branding to see the results in "Toggle branding elements
    " section

Fix spelling for words used once, beginning with 'n' -> 'p', inclusive

$
0
0

Problem/Motivation

Limit this to one line easy fixes, avoid any possible controversy, or any change that would better fit with other words, such as doing chien and chiens in the same patch.

The list of words beginning with n -> p, inclusive, that are used once in one file.

Proposed resolution

Remove the following from dictionary.txt
26 words
1 -ndelay
2 -nemo
3 -newname
4 -nocdata
5 -noemptytag
6 -noevent
7 -nonamespace
8 -nonexistingfilename
9 -nothere
10 -ntfs
11 -omitscript
12 -overrider's
13 -overridetest
14 -overwritable
15 -owasp
16 -pageable
17 -pageviews
18 -phpdoc
19 -phpunit's
20 -postbar
21 -powriter
22 -precompiled
23 -preconfigure
24 -precreated
25 -prefetches
26 -preloads

Remaining tasks

Review
Commit

User interface changes

API changes

Data model changes

Release notes snippet


Tagged services - misleading exception

$
0
0

Just a minor problem...

mymodule.twig.foobar:
    class: Drupal\mymodule\Template\TwigFoobarExtension
    tags:
      - { name: twig.extension }

If you create a tagged service, e.g. for a twig extension, and the entered namespace can't be resolved/file can't be found, you get a misleading exception:

exception 'Symfony\Component\DependencyInjection\Exception\LogicException' with message 'Service 'mymodule.twig.foobar' for consumer 'twig' does not [error]
implement Twig_ExtensionInterface.

if (!is_subclass_of($handler->getClass(), $interface)) {
  throw new LogicException("Service '$id' for consumer '$consumer_id' does not implement $interface.");
}

My suggestion:

Service '$id' for consumer '$consumer_id' does not implement $interface, or its namespace cannot be resolved.

This might save some time for anyone else.

When Placing a Block on 'Configure Block' page the originally selected region is lost

$
0
0

Steps:

1) Go to /admin/structure/blocks
2) Use the 'Place Block' function next to a region, for example the 'Sidebar Second'.
3) Choose 'add custom block'
4) On the 'Configure Block'-page the region you've selected on step #2 is not selected.

I know this ain't a huge bug, bit I teach a lot of people who haven't used Drupal before, and most people experience this behavior as a bug. (aka. it doesn't responds as expected).

Thanks for your time!
Keep up the great work.

Add \Drupal::getMajorVersion()

$
0
0

Problem/Motivation

This is a followup to #3133305: Use \Drupal::VERSION to get the version in Migrate UI rather than hardcoding it
In #5 over there daffie suggested:

We will now be calculating the major version 6 times. Would it not be better to add a new method to the class \Drupal. Something like: \Drupal::getMajorVersion()

This issue to to do that.

Proposed resolution

Provide a \Drupal::MAJOR_VERSION constant that can be used instead of parsing \Drupal::VERSION.

Remaining tasks

Patch, Review and commit

User interface changes

Asterisks in "Unsaved Changes" Messages have Dotted Underline

$
0
0

Problem/Motivation

Within various themes in core including Starterjut and Umami, any time an "unsaved changes" warning message appears, the asterisk of the message has an unsightly dotted underline in Microsoft Edge 86.0.622.58 (Official build) (64-bit) on Windows 10.0.19041 Build 19041 and likely other browsers.

Steps to reproduce

  1. Visit /admin/structure/types/manage/page/display on a site that has a "Page" content type.
  2. Use a tabledrag grippie to re-arrange the order of the fields.
  3. Examine the message area at the top of the page.

Unsaved changes warnings have a dotted underline under the asterisk.

Proposed resolution

abbr elements in the user-agent stylesheet have a text-decoration: underline set by default. This should be overridden in the styline for abbr.tabledrag-changed and abbr.ajax-changed to be set to none.

Remaining tasks

User interface changes

See above.

API changes

Data model changes

Release notes snippet

Fix incorrect message after resetting password

$
0
0

After a user has reset their password, they are shown a message:

You have just used your one-time login link. It is no longer necessary to use this link to log in. Please change your password.

As it's a one-time login link, it's not possible to use it again to log in rather than "necessary" which the message currently says.

This patch corrects the message.

Viewing all 297867 articles
Browse latest View live


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