Quantcast
Viewing all 297110 articles
Browse latest View live

Support View Transitions in Claro


Update from 10.2.7 to 10.3.0 claro theme error InvalidArgumentException

Problem/Motivation

Update from 10.2.7 to 10.3.0 with error message as

The website encountered an unexpected error. Try again later.

InvalidArgumentException: The callable definition provided "[Drupal\claro\ClaroPreRender,tablePositionSticky]" is not a valid callable. in Drupal\Core\Utility\CallableResolver->getCallableFromDefinition() (line 69 of core/lib/Drupal/Core/Utility/CallableResolver.php).
Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array) (Line: 432)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 248)
Drupal\Core\Render\Renderer->render(Array) (Line: 475)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 55)
__TwigTemplate_a3164d23252000faf92139dbdc6c86e5->doDisplay(Array, Array) (Line: 360)
Twig\Template->yield(Array) (Line: 335)
Twig\Template->render(Array) (Line: 38)
Twig\TemplateWrapper->render(Array) (Line: 33)
twig_render_template('core/modules/update/templates/update-report.html.twig', Array) (Line: 348)
Drupal\Core\Theme\ThemeManager->render('update_report', Array) (Line: 491)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 248)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 238)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 231)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 128)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'kernel.view') (Line: 186)
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: 57)
Drupal\advban\AdvbanMiddleware->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)

Please help.

Thank you very much.

Install Fails on WAMP server with php 8.3

Problem/Motivation

Fresh install wampserver newest version with mysql 8, PHP 8.3.6 I got error in step 5

Steps to reproduce

Install drupal with profile standard

Step 5 i got errors
An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: /core/install.php?rewrite=ok&langcode=en&profile=standard&id=1&op=do_nojs&op=do
StatusText: error
ReadyState: 0

I search in log but nothing special
PHP Deprecated: Unknown: assert.active INI setting is deprecated in Unknown on line 0

Proposed resolution

I test the installation with php 8.2 everything is ok, installation is successful.

I change the PHP version 8.2 in wampserver and change the php mininum in the Drupal.php file
const MINIMUM_PHP = '8.2.0';

This problem exists in PHP 8.3 with drupal 10 when running the action (VBO) then get the same error.

I think there is something wrong in the functions callback_batch with PHP 8.3 is kind of check strictement of variable datatype argument or return. (PHP 8.2 ignore)

Create a details/summary FieldFormatter plugin for text fields.

Problem/Motivation

Add a new FieldFormatter plugin to output text fields as a <details> / <summary> group.

Initial use case for Standard profile: in #3002770: Provide authors with tools to manage transcripts and captions/subtitles for local video and audio there is a plan to add a transcript field to some media bundles. A details element is a compact, unintrusive way to present the transcript close to the video. See a demonstration in comment #4.

Aside from that, it's a general purpose formatter to help authors make good use of a standard HTML element. A few other potential uses:

  • Events - a "venue address" field.
  • Commerce products - a "size info" field.
  • User profiles - a "contact details" field.
  • A long-text-with-summary could populate the <summary> using token replacement from the sub-field.
  • Paragraphs - a question-and-answer paragragh type, with two fields for the question and answer. The answer field would use the details/summary formatter, configured to show the question as the <summary> via token replacement. (See comment #10 for a demo.)
  • Long accessible descriptions for complex images. A flowchart accompanied by a rich text alternative in a collapsed details element. Comment #5 elaborates.

Proposed resolution

The FieldFormatter plugin will have some relevant settings:

  1. A checkbox setting controls whether it is should be open or closed initially, i.e. the <details open> attribute.
  2. Text of the <summary> element. will follow this order:
    • Custom text specified by the site-builder.
    • The field label if no custom text specified
    • Others? Maybe leave that possibility open for contrib. Maybe could be follow-up
  3. As a highly desirable bonus, the summary text can support token replacements from the parent entity. Patch #3 included this, and there is a demo in comment #10. Deferred, needs follow-up issue.

Remaining tasks

  • Implement the formatter.
  • Needs follow-up issue to add token support (and tests) for the summary text.
  • Tests.

User interface changes

TODO place screenshots

API changes

None.

Data model changes

Just the necessary addition to config schema for the new formatter settings.

Cannot access transaction id on database transaction

Problem/Motivation

Currently using transaction to replace the legacy popTransaction method ~~ we have to use unpile method with two parameter i.e transaction name and id
However class Transaction is having name() to retrieve the transaction name but there is no method to retrieve the transaction ID.

Steps to reproduce

Run the database transaction with usage of unpile method.

Proposed resolution

Include public function id() to handle the $this->id (To handle the protected property)

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Implement a central point to override the raw page heading (h1) (e.g. hook_page_heading_alter())

Problem/Motivation

Coming from #3455655: Metatag contrib module to override the (visible) page title ("metatag_page_heading"), we tried to find a central point to override the page heading (h1), for SEO purposes. But currently there is no way to override the raw page heading before it gets rendered through the theme.

You could argue, that it would be possible to override the title through either hook_preprocess_page_title or through preprocessing the "page_title_block", but at that point the title is already rendered through twig, and we get markup along the lines of

<span class="field field--name-title field--type-string field--label-hidden">Test</span>

(when using "claro")

So if we would override the title in "hook_preprocess_page_title", we would lose the child span and its classes in this case.

What I want is to simply override the actual heading value without loosing any theme classes / elements. So before the value is passed to the theme.

This seemingly happens in /lib/Drupal/Core/Render/MainContent/HtmlRenderer.phpprepare()

We already tried to implement our own titleResolver with an overriden "getTitle()" method (which gives the raw h1) and replace the original titleResolver in the core.services.yml, but the title from there is only used as a backup, if $main_content['#title'] is NULL.

We basically need to be able to overwrite the title, before it gets rendered in HtmlRenderer between line 230 and 243.

Steps to reproduce

Proposed resolution

Implement "hook_page_heading_alter(&$request, &$route_match, $title)" as a central point to override the raw page heading (h1) before it gets rendered through twig.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Miscellaneous

This could also help the following contrib modules / issues:

and could be seen as the successor to Drupal 7's "drupal_set_title()"

Expose UUID tokens for all content entities in Drupal core

Problem/Motivation

I was surprised to see with many others that UUID of content entities (including but not limited to user and node) are not available as tokens. There is a related issue for the Token module that may cover this requirement as well, but I strongly believe that Drupal core should provide this for bundled content entities at least, just like it exposes internal ids as tokens.

Having UUIDs available as tokens could have multiple benefits. For example, numerical identifiers could be removed from path aliases in a way that permalinks would still work, unlike when human-readable but mutable entity labels are used in path aliases.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Provide details of where core tests, not in core modules, should live.


TestDiscovery expects @group annotations, fails with #[Group()] attributes

Problem/Motivation

TestDiscovery expects @group annotations, fails with #[Group()] attributes.

Proposed resolution

Refactor TestDiscovery. Possibly get rid of custom code and just rely on PHPUnit to discover tests (?)

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Grant author and editor roles permissions to Navigation module once merged in core

Drupal 11.0.0 gives WSOD when editing your own user

Drupal 11.0.0 gives WSOD when editing your own user (as admin).

To reproduce:
- Install core-recommended;^11.0 with everything default (I end up with v11.0.0) using PHP 8.3.8 (in ddev)
- Install drush/drush;^13 (I end up with 13.0.1.0)
- Login as admin using drush uli
- Edit your own user (/user/1/edit)
- I then get a WSOD with text:

The website encountered an unexpected error. Try again later.

Error: Class "Drupal\file\Element\Attribute" not found in Drupal\file\Element\ManagedFile::processManagedFile() (line 374 of core/modules/file/src/Element/ManagedFile.php).
call_user_func_array() (Line: 998)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1061)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1061)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1061)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 571)
Drupal\Core\Form\FormBuilder->processForm() (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 73)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 595)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Access to the systemAdminMenuBlockPage is denied if it contains pages of this type

Steps to reproduce

- Create a route that handles \Drupal\system\Controller\SystemController::systemAdminMenuBlockPage
- Add links to this page in the file *.links.menu.yml (The links should lead to the page that is handled by the same controller, for example, add a link to the system.admin_reports route. Must be set to 1 item in the list)
- Go to the created page
- Page 403 is displayed ()

Integrate Navigation with Workspaces

Problem/Motivation

Navigation module does not have a capability to integrate Workspaces. This is how the Drupal 11 workspaces UI looks like with the old toolbar for example:

Image may be NSFW.
Clik here to view.

Proposed resolution

Implement a new design where Workspaces shows at the top of the Navigation. This issue is only for the item shown in the Navigation. Another issue will be created to update the top area UI Workspaces provides. For now, the new "button" should trigger that same area.

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Image may be NSFW.
Clik here to view.

Remaining tasks

User interface changes

API changes

Data model changes

Stop passing E_USER_ERROR to trigger_error() on PHP 8.4

Problem/Motivation

RFC accepted https://wiki.php.net/rfc/deprecations_php_8_4#deprecate_passing_e_user_e...

Steps to reproduce

core$ git grep E_USER_ERROR
core/includes/errors.inc:34:    E_USER_ERROR => ['User error', RfcLogLevel::ERROR],
core/includes/errors.inc:70:    $to_string = $error_level == E_USER_ERROR && str_ends_with($caller['function'], '__toString()');
core/lib/Drupal/Component/Diff/DiffFormatter.php:137:        trigger_error('Unknown edit type', E_USER_ERROR);
core/lib/Drupal/Component/Utility/ToStringTrait.php:20:      trigger_error(get_class($e) . ' thrown while calling __toString on a ' . static::class . ' object in ' . $e->getFile() . ' on line ' . $e->getLine() . ': ' . $e->getMessage(), E_USER_ERROR);
core/lib/Drupal/Component/Utility/ToStringTrait.php:22:      // E_USER_ERROR, we terminate execution. However, for test purposes allow
core/modules/big_pipe/src/Render/BigPipe.php:375:          trigger_error($e, E_USER_ERROR);
core/modules/big_pipe/src/Render/BigPipe.php:411:          trigger_error($e, E_USER_ERROR);
core/modules/big_pipe/src/Render/BigPipe.php:562:            trigger_error($e, E_USER_ERROR);
core/tests/Drupal/Tests/Core/StringTranslation/TranslatableMarkupTest.php:82:    $this->assertEquals(E_USER_ERROR, $this->lastErrorNumber);

Proposed resolution

clean-up usage or make it conditional

Remaining tasks

- file MR and change record
- commit

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

CKEditor 5 text area doesn't have appropriate aria-label for screen reader

Problem/Motivation

CKEditor5 text area doesn't have appropriate aria-label for screen reader

Steps to reproduce

- activate screen reader
- tab to text area with CKEditor5 component (for example label on the field is "Description")
- screen reader reads out "Editor editing area: main, edit text ...."
Screenshot:
Image may be NSFW.
Clik here to view.

Expected behavior:
- screen reader should read out the label of the field "Description, edit text ...."

Here's an example of screen reader text for a regular text area:
Image may be NSFW.
Clik here to view.

Proposed resolution

assign field label to aria-label on CKEditor5 component

Remaining tasks

- patch
- tests

User interface changes

- none

API changes

- none

Data model changes

- none

Release notes snippet

- TBA

NOTE: CKEditor 5 has an issue for it on github (https://github.com/ckeditor/ckeditor5/issues/15208)


Use Date formats in ISO-8601 format

Problem/Motivation

Some dates formats in Drupal core are using the US format, for example the Default medium date:

Wed, 08/07/2024 - 11:24

Steps to reproduce

Open Administration > Configuration > Region and language > Date and time formats (/admin/config/regional/date-time) and see that US date format is used.

Proposed resolution

It would be nice to use a more international and human readable format, such as 7 Aug 2024. This is also used on drupal.org, as can be see in this issue, under "Created: 7 Aug 2024 at 11:24 CEST".

Date formats currently

NamePattern
Default long dateWednesday, August 7, 2024 - 13:55
Default medium dateWed, 08/07/2024 - 13:55
Default short date08/07/2024 - 13:55
Olivero Medium7 August, 2024
Fallback date formatWed, 08/07/2024 - 13:55
[...]

Proposed changes to date formats

NamePattern
Default long dateWednesday, 7 August, 2024 - 13:55
Default medium dateWed, 7 Aug 2024 - 13:55
Default short date7 Aug 2024 - 13:55
Olivero Medium7 August, 2024
Fallback date formatWed, 7 aug 2024 - 13:55
[...]

Remaining tasks

Update the four formats to use ISO 8601 standard date format, as seen above. Let's also "Default long date" to match Olivero? Wednesday, 7 August, 2024 - 13:55

User interface changes

API changes

Data model changes

Translations

Attach Ajax dialog library for Views Entity Operations

Problem/Motivation

#2253257: Use a modal for entity delete operation links introduced a modal for an entity's delete operation link. However, the required library is only attached for EntityForm and EntityListBuilder. As a result, Views does not apply the modal.

Note this issue is currently mitigated:
- Sites using the Toolbar module have the required 'core/drupal.dialog.ajax' included on every page
- Claro added its own workaround: #3364267: Claro low contrast for buttons in dialog

Steps to reproduce

Use a minimal installation, enable the 'node' and 'views' module. Notice the 'delete' link in admin/content does not open a modal.

Proposed resolution

Attach Ajax dialog library for Views Entity Operations

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

The 'delete' operation link opens a modal for sites not using Toolbar or Claro

Introduced terminology

None

API changes

None

Data model changes

None

Release notes snippet

To be determined.

Update SVG Namespace to HTTPS for Contextual Icons

Problem/Motivation

Trying to implement different Security Policies, and Contextual Icons get removed because SVG is listed as xmlns='http://www.w3.org/2000/svg'

/core/modules/contextual/css/contextual.icons.theme.css

Checkboxes also need to be fixed /core/themes/claro/css/components/form--checkbox-radio.css

Steps to reproduce

Implement Content-Security-Policy will block http calls

Proposed resolution

Update contextual.icons.theme.css:

    /*
     * DO NOT EDIT THIS FILE.
     * See the following change record for more information,
     * https://www.drupal.org/node/3084859
     * @preserve
     */

    /**
     * @file
     * Styling for contextual module icons.
     */

    /**
     * Toolbar tab icon.
     */

    .toolbar-bar .toolbar-icon-edit::before {
      background-image: url("data:image/svg+xml,%3csvg xmlns='https://www.w3.org/2000/svg' width='16' height='16'%3e%3cg%3e%3cpath fill='%23bebebe' d='M14.545 3.042l-1.586-1.585c-.389-.389-1.025-.389-1.414 0l-1.293 1.293 3 3 1.293-1.293c.389-.389.389-1.026 0-1.415z'/%3e%3crect fill='%23bebebe' x='5.129' y='3.8' transform='matrix(-.707 -.707 .707 -.707 6.189 20.064)' width='4.243' height='9.899'/%3e%3cpath fill='%23bebebe' d='M.908 14.775c-.087.262.055.397.316.312l2.001-.667-1.65-1.646-.667 2.001z'/%3e%3c/g%3e%3c/svg%3e");
    }

    .toolbar-bar .toolbar-icon-edit:active::before,
    .toolbar-bar .toolbar-icon-edit.is-active::before {
      background-image: url("data:image/svg+xml,%3csvg xmlns='https://www.w3.org/2000/svg' width='16' height='16'%3e%3cg%3e%3cpath fill='%23ffffff' d='M14.545 3.042l-1.586-1.585c-.389-.389-1.025-.389-1.414 0l-1.293 1.293 3 3 1.293-1.293c.389-.389.389-1.026 0-1.415z'/%3e%3crect fill='%23ffffff' x='5.129' y='3.8' transform='matrix(-.707 -.707 .707 -.707 6.189 20.064)' width='4.243' height='9.899'/%3e%3cpath fill='%23ffffff' d='M.908 14.775c-.087.262.055.397.316.312l2.001-.667-1.65-1.646-.667 2.001z'/%3e%3c/g%3e%3c/svg%3e");
    }

    /**
     * Contextual trigger.
     */

    .contextual .trigger {
      /* Override the .focusable height: auto */
      width: 26px !important;
      /* Override the .focusable height: auto */
      height: 26px !important;
      text-indent: -9999px;
      background-image: url("data:image/svg+xml,%3csvg xmlns='https://www.w3.org/2000/svg' width='16' height='16'%3e%3cg%3e%3cpath fill='%23bebebe' d='M14.545 3.042l-1.586-1.585c-.389-.389-1.025-.389-1.414 0l-1.293 1.293 3 3 1.293-1.293c.389-.389.389-1.026 0-1.415z'/%3e%3crect fill='%23bebebe' x='5.129' y='3.8' transform='matrix(-.707 -.707 .707 -.707 6.189 20.064)' width='4.243' height='9.899'/%3e%3cpath fill='%23bebebe' d='M.908 14.775c-.087.262.055.397.316.312l2.001-.667-1.65-1.646-.667 2.001z'/%3e%3c/g%3e%3c/svg%3e");
      background-repeat: no-repeat;
      background-position: center center;
      background-size: 16px 16px;
    }

    .contextual .trigger:hover {
      background-image: url("data:image/svg+xml,%3csvg xmlns='https://www.w3.org/2000/svg' width='16' height='16'%3e%3cg%3e%3cpath fill='%23787878' d='M14.545 3.042l-1.586-1.585c-.389-.389-1.025-.389-1.414 0l-1.293 1.293 3 3 1.293-1.293c.389-.389.389-1.026 0-1.415z'/%3e%3crect fill='%23787878' x='5.129' y='3.8' transform='matrix(-.707 -.707 .707 -.707 6.189 20.064)' width='4.243' height='9.899'/%3e%3cpath fill='%23787878' d='M.908 14.775c-.087.262.055.397.316.312l2.001-.667-1.65-1.646-.667 2.001z'/%3e%3c/g%3e%3c/svg%3e");
    }

    .contextual .trigger:focus {
      outline: none;
      background-image: url("data:image/svg+xml,%3csvg xmlns='https://www.w3.org/2000/svg' width='16' height='16'%3e%3cg%3e%3cpath fill='%235181C6' d='M14.545 3.042l-1.586-1.585c-.389-.389-1.025-.389-1.414 0l-1.293 1.293 3 3 1.293-1.293c.389-.389.389-1.026 0-1.415z'/%3e%3crect fill='%235181C6' x='5.129' y='3.8' transform='matrix(-.707 -.707 .707 -.707 6.189 20.064)' width='4.243' height='9.899'/%3e%3cpath fill='%235181C6' d='M.908 14.775c-.087.262.055.397.316.312l2.001-.667-1.65-1.646-.667 2.001z'/%3e%3c/g%3e%3c/svg%3e");
    }

Remaining tasks

API page will need to be updated as well - https://api.drupal.org/api/drupal/core%21modules%21contextual%21css%21co...

User interface changes

Introduced terminology

API changes

contextual.icons.theme.css

Data model changes

Release notes snippet

Adjust custom navigation logo dimensions on upload

Problem/Motivation

Navigation allows to upload a custom logo to be included at the top of the bar.
Nowadays, the only restriction applied is related to image weight, but not for dimensions. That means that image bigger thatn te expected placement are being adjusted via CSS.

For a better resource management, would be great to adjust the custom logo dimensions to the logo placeholder to avoid loading unnecessarily big images.

Proposed resolution

The proposal here is to use a similar approach as we already have when uploading a picture to an image field that exceeds the maximum allowed size for the field.

When image is bigger than 40x40px, it would be automatically scaled during upload and a message like this would be shown to the end user:
The image was resized to fit within the navigation logo expected dimensions of 40x40 pixels. The new dimensions of the resized image are 40x40 pixels.

Following this path, code would be much simpler, reducing the number of possible points of failure and we would be safer assuming that original image can be used directly as navigation logo.

To give more flexibility, the icon size could be set as properties in the navigation.settings config entity, but not shown. So contrib modules or advanced site administrators could modify them.

Remaining tasks

None.

User interface changes

Adds message during file upload to notify user the image will be automatically resized if above expected size.

API changes

Adds image width/height as Configuration (no UI additions for these). For flexibility around image sizes changes tied to config rather than code, same as current file-size restriction already.

Data model changes

Uses Configuration to establish expected size of navigation logo.

Views exposed form doesn't handle non-array values correctly, where an array is expected ("Allow multiple selections")

Problem/Motivation

Views exposed filters allow multiple selections using the "Allow multiple selections" checkbox.

This can for example be tested using a filter on a node content type, which then allows filtering using multiple checkboxes for the different node types.

In the form this leads to an array structure like
type[] = article
type[] = page

using GET to submit the form, you can even make that visible.

The problem is that Views Exposed Filters expect the given parameter "type" to be an array (type[]) and nothing else (e.g. type=) and fails with an exception indirectly:

LogicException: Cannot create key "article" on non-array value. in Drupal\Component\Utility\NestedArray::setValue() (line 154 of core/lib/Drupal/Component/Utility/NestedArray.php).

LogicException: Cannot create key "article" on non-array value. in Drupal\Component\Utility\NestedArray::setValue() (line 154 of core/lib/Drupal/Component/Utility/NestedArray.php).

Drupal\Core\Form\FormBuilder->handleInputElement() (Line: 999)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1069)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 1069)
Drupal\Core\Form\FormBuilder->doBuildForm() (Line: 579)
Drupal\Core\Form\FormBuilder->processForm() (Line: 326)
Drupal\Core\Form\FormBuilder->buildForm() (Line: 134)
Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase->renderExposedForm() (Line: 1297)
Drupal\views\ViewExecutable->build() (Line: 393)
Drupal\views\Plugin\views\display\PathPluginBase->execute() (Line: 198)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1689)
Drupal\views\ViewExecutable->executeDisplay() (Line: 81)
Drupal\views\Element\View::preRenderViewElement()
call_user_func_array() (Line: 113)
Drupal\Core\Render\Renderer->doTrustedCallback() (Line: 870)
Drupal\Core\Render\Renderer->doCallback() (Line: 432)
Drupal\Core\Render\Renderer->doRender() (Line: 248)
Drupal\Core\Render\Renderer->render() (Line: 238)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 638)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 231)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare() (Line: 128)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse() (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray()
call_user_func() (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() (Line: 186)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 50)
Drupal\ban\BanMiddleware->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 49)
Drupal\remove_http_headers\StackMiddleware\RemoveHttpHeadersMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 741)
Drupal\Core\DrupalKernel->handle() (Line: 19)

Such exceptions then fill up the logs and can be provoked from third party by URL.

The following URL would be the correct URL:
https://www.example.com/search?search=test&type[]=article

The following URL leads to the described exception:
https://www.example.com/search?search=test&type=article

Steps to reproduce

See above

Proposed resolution

Having a scalar value instead of the expected array should be handled more gracefully.
Ensure to validate the given value to be an array in form validation or other input validation, so it's not getting processed on lower levels running into lower level exceptions.

Also consider that when using a GET form, the parameter might also be changed / manipulated on the user-side. (intentionally or unintentionally)

We could also discuss if a scalar value is given, it should just be transformed into an array value to simplify handling, but I'm not sure if that's a good or a bad idea.

Remaining tasks

  1. Discuss
  2. Implement a fix
  3. Write test
  4. Review
  5. Release

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

Viewing all 297110 articles
Browse latest View live


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