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

Layout builder : Alignment and spacing issues on the edit layout page for content types.

$
0
0

Problem/Motivation

Alignment break and spacing issue in the layout builder.

Steps to reproduce

Step1 : Install Drupal
Step2 : Enable layout builder module
Step3 : Use Layout Builder from Administration > Structure > Content types > Article > Manage display > default > layout options
Step4 : Create Article from Content > Add content > Article and Save
Step5 : Click on Layout tab

Proposed resolution

Fix the styling of layout builder.

Solution - Fixed the alignment, justified the content and fixed the height of the anchor tag.
After -

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Call to a member function getId() on null

$
0
0

Problem

Error: Call to a member function getId() on null in /var/www/website/web/core/lib/Drupal/Core/Entity/EntityAccessControlHandler.php on line 63 #0 /var/www/website/web/core/modules/node/src/NodeAccessControlHandler.php(68): Drupal\Core\Entity\EntityAccessControlHandler->access(Object(Drupal\node\Entity\Node), 'view', Object(Drupal\Core\Session\AccountProxy), true)

Fix

$langcode = $entity->language()->getId();
to
$langcode = ($entity->language() ? $entity->language()->getId() : NULL);

Steps to reproduce

These are rough steps to reproduce based on comment #9.

1. Install Drupal
2. Enable Languages and Content Translation modules
3. Add a language
4. Add a node that uses the 2nd language
5. Remove the 2nd language from the site
6. View the node that had been created.

Only send update notification email when there is an email address

$
0
0

Problem/Motivation

After deleting the email listed under (/admin/reports/updates/settings), each time a cron run is started, the following error is created:
Error sending email (from info@website.de to with reply-to not set)

Steps to reproduce

go to: /admin/reports/updates/settings

  1. Empty the list of email addresses
  2. After the system finds a new update, based on your configuration of "Check for updates" and "Email notification threshold"
  3. Run cron

The error disappears after adding back an Email into the notify list. But will reappear if it the email is delated again.


Doing a single export on update.settings results in: 
notification: emails: - ''


On a different website where this error doesn't appear we get: 
notification: emails: { }

Here the notification email was never set.

Proposed resolution

Send update email only if there is an email address.

Remaining tasks

None

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

If you don't set the "version" of a profile, the report/status displays an empty dash

$
0
0

Problem/Motivation

This is a followup from #2481103: "Undefined index" errors in system.install loading admin/reports/system.

If you install a profile without the "version" key and move into admin/reports/status page, you will see an empty dash.

Steps to reproduce

  1. Install a new instance of drupal using the "minimal" profile
  2. Inside core/profiles/minimal/minimal.info.yml file, remove the "version" key
  3. Go to admin/reports/status page and check the Installation profile section

Proposed resolution

Following the idea of #12, if a profile does not have a VERSION, the dash will be ommited.

Remaining tasks

  1. Patch
  2. Test
  3. Review
  4. Commit

User interface changes

Before:
Minimal (minimal-)
Installation profile section before applying patch

After:
Minimal (minimal)
Installation profile section after applying patch

API changes

None.

Data model changes

None.

Change all README.txt files to README.md

$
0
0

Problem/Motivation

In #3192842: Make our README more welcoming by converting it into an "entrypoint" into the Drupal ecosystem we converted the base README file from README.txt to README.md. We should consider converting all other READMEs in the codebase as well.

---- original report ------

If we have a look at the following link
https://git.drupalcode.org/project/drupal
We will notice the nice gitlab interface :)

But we could make the project code even more readable with the .md files
something like https://git.drupalcode.org/project/anchor_link for example

README.md will be nice, but not sure if we should do the change for all .txt files, but not the robots.txt or alike functional files

Proposed resolution

Convert all README.txt files in core to README.md.
Change all references to these files from README.txt to README.md.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Use CSS Logical Properties in files without [dir=]

$
0
0

Problem/Motivation

A child of #3312966: Enforce the use of CSS Logical Properties in core to do the simple conversions to using CSS Logical Properties. This will do so in CSS files that do not have a "[dir=]" or a ":dir()" rule.

Steps to reproduce

Proposed resolution

Enable logical properties and autofix.

$ cd core
$ grep --include=*.css -rL -e 'dir="rtl' -e ":dir(rtl" . | xargs yarn stylelint --fix
$ yarn build:css

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

[PP-1] Use hook_theme_suggestions in views

$
0
0

Problem/Motivation

Views currently does not show theme suggestions, due to a bug in core: #2118743: Twig debug output does not display all suggestions when an array of theme hooks is passed to #theme
Mark Carver though pointed out in #2118743-167: Twig debug output does not display all suggestions when an array of theme hooks is passed to #theme that views could also use hook_theme_suggestions

Proposed resolution

Use hook_theme_suggestions() instead of arrayed theme hooks.

Remaining tasks

Postponed till #2511548: Add a "context" array variable to all theme hooks and "#context" array property to all elements to provide optional contextual data is finished.

User interface changes

None

API changes

Deprecates ViewsPluginInterface::themeFunctions and ViewExecutable::buildThemeFunctions and replaces them with equivilent themeSuggestions methods.

Data model changes

None

The context is not a valid context. in Drupal\Core\Executable\ExecutablePluginBase

$
0
0

Problem/Motivation

The context is not a valid context. in Drupal\Core\Executable\ExecutablePluginBase

Steps to reproduce

use version 9.5.11 and php version 7.4 then upgrade to version 8.1 update your vendor

Drupal\Component\Plugin\Exception\ContextException: The context is not a valid context. in Drupal\Core\Executable\ExecutablePluginBase->getContextDefinition() (line 184 of core\lib\Drupal\Core\Plugin\ContextAwarePluginTrait.php).
Drupal\Core\Executable\ExecutablePluginBase->getContext(NULL) (Line: 116)
Drupal\Core\Executable\ExecutablePluginBase->getContextValue(NULL) (Line: 91)
Drupal\Core\Entity\Plugin\Condition\EntityBundle->evaluate() (Line: 77)
Drupal\Core\Condition\ConditionManager->execute(Object) (Line: 84)
Drupal\Core\Condition\ConditionPluginBase->execute() (Line: 376)
Drupal\pathauto\Entity\PathautoPattern->applies(Object) (Line: 320)
Drupal\pathauto\PathautoGenerator->getPatternByEntity(Object) (Line: 41)
Drupal\pathauto\PathautoWidget->formElement(Object, 0, Array, Array, Object) (Line: 353)
Drupal\Core\Field\WidgetBase->formSingleElement(Object, 0, Array, Array, Object) (Line: 220)
Drupal\Core\Field\WidgetBase->formMultipleElements(Object, Array, Object) (Line: 111)
Drupal\Core\Field\WidgetBase->form(Object, Array, Object) (Line: 183)
Drupal\Core\Entity\Entity\EntityFormDisplay->buildForm(Object, Array, Object) (Line: 121)
Drupal\Core\Entity\ContentEntityForm->form(Array, Object) (Line: 127)
Drupal\node\NodeForm->form(Array, Object) (Line: 106)
Drupal\Core\Entity\EntityForm->buildForm(Array, Object)
call_user_func_array(Array, Array) (Line: 536)
Drupal\Core\Form\FormBuilder->retrieveForm('node_article_form', Object) (Line: 283)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
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: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 718)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)


contact_menu_local_tasks_alter() should check whether $data['tabs'][0] is set

$
0
0

Problem/Motivation

contact_menu_local_tasks_alter() accesses $data['tabs'][0] unconditionally, but that might not exist.

Specifically if someone alters the other tabs away.

I hit this bug due to another bug, where Drupal was trying to render the local tasks on a maintenance page in which case there are no local tasks (will open a separate bug for that).

Proposed resolution

Add a check for isset($data['tabs'][0]).

Remaining tasks

Convert to an MR.

User interface changes

N/A

API changes

N/A

Normalize the incoming path with urldecode directly in RouteProvider

$
0
0

Problem/Motivation

After updating Drupal from version 10.2.7 to version 10.30, a 404 error occurred!

Bilingual website pl/en

the https//mydomain/en version works fine
the https//my_domain version (by default pl as the domain's primary language) shows a 404 error after clearing the cache.

Warning: Undefined array key "route:[language]=pl:[query_parameters]=:/ " in Drupal\Core\Cache\DatabaseBackend->getMultiple() (line 155 of core/lib/Drupal/Core/Cache/DatabaseBackend.php).
Drupal\Core\Cache\DatabaseBackend->getMultiple(Array, ) (Line: 126)
Drupal\Core\Cache\DatabaseBackend->get('route:[language]=pl:[query_parameters]=:/') (Line: 169)
Drupal\Core\Routing\RouteProvider->getRouteCollectionForRequest(Object) (Line: 252)
Drupal\Core\Routing\Router->getInitialRouteCollection(Object) (Line: 142)
Drupal\Core\Routing\Router->matchRequest(Object) (Line: 90)
Drupal\Core\Routing\AccessAwareRouter->matchRequest(Object) (Line: 105)
Symfony\Component\HttpKernel\EventListener\RouterListener->onKernelRequest(Object, 'kernel.request', Object)
call_user_func(Array, Object, 'kernel.request', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.request') (Line: 157)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 53)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 50)
Drupal\ban\BanMiddleware->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 741)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

P.S.
There is no cache problem with a single-language website.

I think the problem is that garbage collection corrupts the path to the home-page
does not allow null values ​​in the main language.
After entering the language prefix it works fine.
But I guess that's not the point, because it destroys the links already provided.

Steps to reproduce

Install the standard profile.

TRUNCATE cache_data;

Visit https://drupal-dev.ddev.site/

Then https://drupal-dev.ddev.site/:%20

Without the MR, you will get a 404 and see the following three cache entries:

MariaDB [db]> SELECT cid FROM cache_data WHERE cid LIKE 'route:%';
+-----------------------------------------------------+
| cid                                                 |
+-----------------------------------------------------+
| route:[language]=en:[query_parameters]=:/           |
| route:[language]=en:[query_parameters]=:/%20        |
| route:[language]=en:[query_parameters]=:/system/404 |
+-----------------------------------------------------+

With the MR you will get a 200 on the path with %20 at the end, and there'll be a single cache entry:

MariaDB [db]> SELECT cid FROM cache_data WHERE cid LIKE 'route:%';
+-------------------------------------------+
| cid                                       |
+-------------------------------------------+
| route:[language]=en:[query_parameters]=:/ |
+-------------------------------------------+
1 row in set (0.001 sec)

Proposed resolution

While there are not steps to reproduce yet, route lookup caching is inconsistent for urlencoded URLs, due to the way PathProcessorDecode happens during routing after the cache ID is created.

Instead of a path processor, we need to normalize the incoming path with urldecode directly in RouteProvider.

This means that https://example.com/%20 will consistently return a 200 (for the front page) instead of a 404. We might want a follow-up to redirect trailing urlencoded spaces in .htaccess

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

The method ContentEntityBase::getRevisionId() should not return string values

$
0
0

Problem/Motivation

The method ContentEntityBase::getRevisionId() should not return string values. All entity revision id's are always of the integer type. According to the docblock the return type can be an integer or null or a string. MongoDB is much stricter with query conditions. For MongoDB a string with the character '4' is not the same as the integer 4. It would be very helpful for Drupal on MongoDB, when the method would only return an integer value or null when there is not revision id.

Proposed resolution

The docblock of the method ContentEntityBase::getRevisionId() will be changed and return values must be an integer or null. Add type casting to the return value of the method.

Remaining tasks

TBD

User interface changes

None

Introduced terminology

None

API changes

The method ContentEntityBase::getRevisionId() will no longer return string values.

Data model changes

None

Release notes snippet

TBD

Integrate Umami message

$
0
0

Problem/Motivation

The existing message provided by the Umami installation profile that shows on the Toolbar hasn't been integrated on the new navigation yet.

Proposed resolution

Create a new custom block navigation implementation that follows a design along this lines:

When collapsed, only the warning icon should be shown.

Remaining tasks

This will new to implement a custom block for the Navigation for the first time, beyond the existing menus.

User interface changes

The Umami message will appear on the new navigation.

Change the boolean constants to have boolean values in NodeInterface, CommentInterface and FileInterface

$
0
0

Problem/Motivation

The boolean constants in the NodeInterface, CommentInterface and FileInterface have integer values. With MongoDB boolean values need to be booleans (TRUE or FALSE) and not integer (1 or 0). When used in query conditions, these contants need to be type hinted. For example:

$query->condition('status', (bool) NodeInterface::PUBLISHED);
$query->condition('status', (bool) CommentInterface::PUBLISHED);
$query->condition('status', (bool) FileInterface::STATUS_PERMANENT)

Proposed resolution

Change the boolean constants in NodeInterface, CommentInterface and FileInterface

Remaining tasks

TBD

User interface changes

None

Introduced terminology

None

API changes

The following constants have changed from an integer value to the correstonding boolean value:

    Drupal\node\NodeInterface::NOT_PUBLISHED = FALSE
    Drupal\node\NodeInterface::PUBLISHED = TRUE
    Drupal\node\NodeInterface::NOT_PROMOTED = FALSE
    Drupal\node\NodeInterface::PROMOTED = TRUE
    Drupal\node\NodeInterface::NOT_STICKY = FALSE
    Drupal\node\NodeInterface::STICKY = TRUE
    Drupal\comment\CommentInterface::NOT_PUBLISHED = FALSE
    Drupal\comment\CommentInterface::PUBLISHED = TRUE
    Drupal\file\FileInterface::STATUS_PERMANENT = TRUE

Data model changes

None

Release notes snippet

TBD

Move JSON:API validation to a feature flag or separate module

$
0
0

Problem/Motivation

JSON:API has a soft dependency on justinrainbow/json-schema; validation is performed automatically if the dependency is enabled via a check in \Drupal\jsonapi\EventSubscriber\ResourceResponseValidator:

use JsonSchema\Validator;
...
    elseif (class_exists(Validator::class)) {
      $this->validator = new Validator();
    }

@larowlan has previously noted that this causes severe performance issues at runtime, and the fix is to uninstall the dependency.

However, Experience Builder uses justinrainbow/json-schema at runtime (although at the time of writing this is not explicitly declared): #3469516: Declare explicit runtime dependency on `justinrainbow/json-schema`

In turn this will cause performance issues on sites that want to use both Experience Builder and JSON:API.

Steps to reproduce

Proposed resolution

Move ResourceResponseValidator behind some kind of feature flag instead of magically enabling it when the dependency is present. This could be a development mode flag similar to the Twig debug mode, or a feature flag module.

It may even be preferable to move this out of core to a contrib module, as this doesn't feel like it is necessarily in the core use case. Tagging for product manager review.

Remaining tasks

Discuss the best solution.
Implement.

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Fix VariableComment.Missing in core/tests

$
0
0

Problem/Motivation

Variables are missing comments.

Steps to reproduce

Proposed resolution

Add comments for files in core/tests

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet


Add Textarea option to normalize newlines to \n

$
0
0

Problem/Motivation

In #2844452: Export configuration YAML strings as multiline, we earned neat readable exports for multiline config items IFF they do not contain "\r".
Many config contain \r though, simply for lazynesss, as the HTML standard mandates textarea elements to return "\r\n" line breaks.

Proposed resolution

Add a "#normalize_newlines" option to \Drupal\Core\Render\Element\Textarea.
So beautifying config is a oneliner for module developers.

Remaining tasks

Do it.

User interface changes

None.

API changes

Add a "#normalize_newlines" option to \Drupal\Core\Render\Element\Textarea.

Data model changes

None.

Release notes snippet

The Textarea element has a now "#normalize_newlines" option.
Config before... config after...
Example form element...

Claro: Move svg image from template to images folder.

$
0
0

Problem/Motivation

Claro: Move svg image from templates to images folder.

drupal/core/themes/claro/templates/admin/indentation.html.twig from this file

<svg
    xmlns="http://www.w3.org/2000/svg"
    class="tree"
    width="25"
    height="25"
    viewBox="0 0 25 25">
    <path
      class="tree__item tree__item-child-ltr tree__item-child-last-ltr tree__item-horizontal tree__item-horizontal-right"
      d="M12,12.5 H25"
      stroke="#888"/>
    <path
      class="tree__item tree__item-child-rtl tree__item-child-last-rtl tree__item-horizontal tree__horizontal-left"
      d="M0,12.5 H13"
      stroke="#888"/>
    <path
      class="tree__item tree__item-child-ltr tree__item-child-rtl tree__item-child-last-ltr tree__item-child-last-rtl tree__vertical tree__vertical-top"
      d="M12.5,12 v-99"
      stroke="#888"/>
    <path
      class="tree__item tree__item-child-ltr tree__item-child-rtl tree__vertical tree__vertical-bottom"
      d="M12.5,12 v99"
      stroke="#888"/>
  </svg>

Steps to reproduce

1. example : Go to admin/structure/menu/manage/admin
2. Check below menu link Here you can see parent and child link.
3. You can see space before the child menu. If you inspect you can see the svg tag.

Proposed resolution

Remove the svg tag code from the drupal/core/themes/claro/templates/admin/indentation.html.twig file and create a new svg file in the images folder.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Allowed type text is duplicated in the back end of image field

$
0
0

Problem/Motivation

After upgrading Drupal core to version 10.2.0, an issue has arisen within the image field functionality. Specifically, the image field is now permitting duplicate allowed image types, which goes against the expected behavior.

Steps to reproduce

Create or navigate to an existing content type with an image field. Observe that the image field is permitting the addition of duplicate image types (see attached screenshot for reference).

Change the filter in the overview page of the dblog module to a condition object

$
0
0

Problem/Motivation

The overview page of the dblog module has a filter functionality. Currently is the filter creating a SQL string and that is add to the query with the $query->where(). The problem is that MongoDB does not support SQL strings. For MongoDB the SQL string needs to be replaced with a condition object.

Proposed resolution

Replace the filter in the overview page of the dblog module to a condition object.

Remaining tasks

TBD

User interface changes

None

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet

TBD

JS messages are themed differently, not using status-messages.html.twig

$
0
0

Problem/Motivation

When theming status messages, this is generally done by overriding status-messages.html.twig. However, messages added via AJAX or JS (JavaScript Messages API) use Drupal.theme.message in core/misc/message.js or a similar function in the theme that overrides it.

Steps to reproduce

  1. Override the twig file in a theme
  2. Add a message via JS
  3. It doesn't match the expected HTML from the twig file

Here is Drupal.theme.message in core/misc/message.js.

Even the attributes and classes added aren't consistent with what core has in status-messages.html.twig

This requires developers wanting to unify their results to create JS that builds HTML similar to what is in the Twig file.

There are also inconsistencies between the results of the two methods in Core. One example is that in JS there is:

    messageWrapper.setAttribute(
      'role',
      type === 'error' || type === 'warning' ? 'alert' : 'status',
    );

which sets the role to "alert" for errors and warnings. But in the Twig file it only sets that role for errors. Also, the JS sets data-drupal-message-id, but the Twig template doesn't.

Proposed resolution

Is there a way to unify these, so that the Messages API uses the twig file and there aren't disparate results?

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Viewing all 298165 articles
Browse latest View live


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