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

Rest: Error when format is not JSON

$
0
0

I have Drupal 8.6.13 with modules "RESTful Web Services" and "Serialization" enabled.

When i open a link with a wrong format (not JSON), website logs a crash:

example "abc": https://www.test.be/node/1?_format=abc

The website encountered an unexpected error. Please try again later.

Symfony\Component\HttpKernel\Exception\NotAcceptableHttpException: Not acceptable format: abc in Drupal\Core\EventSubscriber\RenderArrayNonHtmlSubscriber->onRespond() (line 30 of /data/sites/web/jan/www/quiz/core/lib/Drupal/Core/EventSubscriber/RenderArrayNonHtmlSubscriber.php).


HTTP Basic Authentication Module Description: add dot to the end of the sentence

$
0
0

I know this part is rarely visible, but some customers pay attention to it.
I think we can add the point to the end of the sentence and make the description more accurate.

Migrate Module Description: add dot to the end of the sentence

$
0
0

I know this part is rarely visible, but some customers pay attention to it.
I think we can add the point to the end of the sentence of the Migrate module and make the description more accurate.

RESTful Module Description: add dot to the end of the sentence

$
0
0

I know this part is rarely visible, but some customers pay attention to it.
I think we can add the point to the end of the sentence and make the description more accurate.

Serialization Module Description: add dot to the end of the sentence

$
0
0

I know this part is rarely visible, but some customers pay attention to it.
I think we can add the point to the end of the sentence and make the description more accurate.

Umami's language-switcher as a drop-down menu

$
0
0

Problem/Motivation

Umami comes with a new language switcher.
When adding more languages (beyond the existing English and Spanish) it will break the nice flow of the header.

Proposed resolution

Add the list of available languages into a dropdown menu.

Remaining tasks

Create dropdown menu.
Figure out best positioning and a visual representation that will be easy to identify as "Here's where I can switch to another language"

Fix incorrect assumption that all entity are revisionable

$
0
0

The Quickedit module calls $entity->isLatestRevision() several places on an object that type is \Drupal\Core\Entity\EntityInterface without checking whether the object also implements the \Drupal\Core\Entity\RevisionableInterface interface.

Loop on installation

$
0
0

On creation a drupal project with composer >

composer create-project drupal-composer/drupal-project:8.x-dev web_application --no-interaction

the installation looks fine.

But on the next steps the System Check is not called and i have to enter my database connection. The Database is filled till the table "users_field_data", then it stuck and the installer jumps back to entering the db connection.

No errors in the logs.


Create change record for all deprecated db_* functions

$
0
0

Problem/Motivation

Mostly everything in core/database.inc is deprecated starting from 8.0 but removal of usage require to @trigger_error() with a link to change record

This is a soft blocker for #2319859: [META] Deprecate contents of database.inc to deprecate remains

Also a soft blocker for lot of issues in #2848161: [meta] Replace calls to deprecated db_*() wrappers

Also this issue may patch all the places according to current deprecation standard https://www.drupal.org/core/deprecation as pointed in #2848817: Replace all calls to db_table_exists, which is deprecated.

Also setting default target is missing at "objectified" db subsystem #2947775: Move setting default target out of db_merge() and other deprecated db_* functions - probably makes sense to mention at in separate CR

Proposed resolution

  1. Create change record mentioning all deprecated db_* functions + #2286235: Deprecate db_ignore_replica() and convert it to service
  2. Identify common pattern of message
  3. add regression test to core/tests/Drupal/KernelTests/Core/Database/DatabaseLegacyTest.php for each function (use group @legacy to annotate exception
  4. Promote in core gdo about that all since 8.6 extra call to trigger_error() will happen for all deprecated functions like

Remaining tasks

- decide on message for exception
- file CR draft listing functions and which of them will start throw exceptions on usage
- create patch to fix all @deprecated content in core/database.inc

User interface changes

no

API changes

no

Data model changes

no

FileSystem::mkdir should handle open_basedir correctly

$
0
0

In settings.php, the private file path is documented with "This directory must be absolute, ...". However, an absolute path does not work when drupal runs on a shared host and access to the parent directories is not possible.

Example:
• a shared host with drupal root /var/www/ud17_276/html/drupal
• web server root is /var/www/ud17_276/html
• shared host root is /var/www/ud17_276, i.e., this part is not visible for the space admin, and thus neither for drupal
• in settings.php:
$settings['file_private_path'] = '/var/www/ud17_276/files/drupal-private';

If a drupal user tries to upload a file, by creating a node of a content type having a file field with private storage configured, drupal tries to create the full parent path, /var/www/ud17_276, which obviously will fail. The error message in the log is:

"The upload directory private://2016-09 for the file field field_privimage could not be created or is not accessible. A newly uploaded file could not be saved in this directory as a consequence, and the upload was canceled."

Configuring the shared host's users relative root, like
$settings['file_private_path'] = '/files/drupal-private';
does also not work. The only way this seems to work currently is a relative path:

$settings['file_private_path'] = '../../files/drupal-private';

Hence, either the code documentation in settings.php should be updated to include this case, or the coding has to be changed to be able to deal with shared hosting. (Unfortunately, due to lack of php knowledge, I cannot judge these options.)

Best, Tobias

The editor module assumes that a fieldable entity is also revisionable

$
0
0

The editor_entity_update() function gets an EntityInterface, and checks if it is a FieldableEntityInterface. After that it tries to call getRevisionId(), which will succeed in case of the content entities, since content entities are revisionable and fieldable at the same time. However, if a custom entity type (that is not a subclass of content entity) gets saved and it happens to be fieldable but not revisionable then the editor module will trigger a fatal error.

Only add .layout-builder-block to blocks when in the Layout Builder UI

$
0
0

Problem/Motivation

\Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray adds

'#attributes' => ['class' => ['layout-builder-block']],

to all blocks rendered by Layout Builder, regardless of whether it is for the Layout Builder UI or for the end user.

Proposed resolution

Only add for the Layout Builder UI.
Consider adding it in a wrapping div instead of altering the block directly

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Improve test coverage for Inline Form Errors

$
0
0

Problem/Motivation

#2880011: Allow disabling the Inline Form Errors summary needs refactoring of test FormErrorHandlerTest.

Add one form in the Setup with fields for various test cases (e.g. missing or invisible fields) and use it in every tests.

protected function setUp() {
  parent::setUp();

  $form = [
    '#parents' => [],
    '#form_id' => 'test_form',
    '#array_parents' => [],
  ];
  $form['test1'] = [
    '#type' => 'textfield',
    '#title' => 'Test 1',
    '#parents' => ['test1'],
    '#array_parents' => ['test1'],
    '#id' => 'edit-test1',
  ];


  (...)


  $form['test6'] = [
    '#type' => 'value',
    '#title' => 'Test 6',
    '#parents' => ['test6'],
    '#array_parents' => ['test6'],
    '#id' => 'edit-test6',
  ];

  $this->form = $form;

Proposed resolution

Use the existing form from the testDisplayErrorMessagesInline().

Remove testSetElementErrorsFromFormState(). It does not seem to be necessary. It's covered in testDisplayErrorMessagesInline()!

Migrate D7 i18n menu links

$
0
0

Problem/Motivation

Menu links in Drupal 7 are translated using i18n_menu submodule of the suite i18n, we need to migrate those respecting the language settings. This should be similar to the D6 version, #2225587: Migrate D6 i18n menu links

The D6 patch included a migration for language content menu settings as well.

Proposed resolution

Use the D6 version as a guide.

Remaining tasks

Do the work

Prevent link field migration from creating invalid link attributes

$
0
0

Problem/Motivation

We are still migrating a Website from Drupal 6 to Drupal 8. After migrating a content-type with a link field I encountered this error when viewing the migrated node:

Error: Unsupported operand types in Drupal\Core\Utility\LinkGenerator->generate() (line 153 of core/lib/Drupal/Core/Utility/LinkGenerator.php).

After setting a breakpoint in transform() in Drupal\link\Plugin\migrate\process\FieldLink I noticed, that the link attributes got triple-serialized in our D6 page:
$value['attributes'] = 's:13:"s:6:"a:0:{}";";'

This seems to have happened to others too, but the other issue fixes the symptoms: https://www.drupal.org/project/drupal/issues/2596937

Proposed resolution

As I don’t think a triple-serialized value ever worked, my suggestion is to reset the attributes to an empty array in case it is not working after the first two unserialize-attempts.

Remaining tasks

None

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

Prevent link field migration from creating invalid link attributes.


Replace "Recipe Instruction" label with a better alternative

$
0
0

Problem/Motivation

Umami demo recipes have a section (field label) Recipe Instruction which sounds confusing.

Proposed resolution

Change to a label used by other leading recipe websites: Directions or one of the options below:

List of most popular recipe websites and the wording they use for that section:

https://www.yummly.com - Directions
https://www.geniuskitchen.com - Directions
https://www.foodnetwork.com - Directions

https://www.chowhound.com - Instructions
https://www.thekitchn.com - Instructions

https://www.myrecipes.com - How to Make it
https://www.cookinglight.com - How to Make It

http://www.eatingwell.com - Preparation
https://www.epicurious.com - Preparation

https://www.simplyrecipes.com - Method

https://www.bettycrocker.com - Steps

Remaining tasks

Create a patch to update Umami's recipe with the new label.

How Drupal 8 caching mechanism works?

$
0
0

Is there any flow for Drupal 8 caching mechanism? Can I decide that a particular page cannot be cached for certain conditions by some hook in Drupal 8?

I have tried out Cache Context, Cache Max-age, Cache tags invalidation. I didn't get a hook for theme or module which is not being cached by Drupal.

Finally get a solution using

\Drupal::service('page_cache_kill_switch')-?>trigger();

But this will remove the entire page cache for everytime.

I just want to show the updated content for anonymous users which will change in a day time / 24 hours span. Can I have a solution for the same.

Vocabulary consisting of set amount of parents and a lot of children breaks pagination

$
0
0

Hello,

first and foremost, I did search around the issue queue for my specific problem, but could not find something related to my problem, (except one, which I'll link to in a minute).

Problem :

I have a vocabulary consisting of three parents, and each of those parents has a lot of children, which in turn have a lot of children (max_level : 4). And I do mean a lot : first parent has 250 + terms alltogether.

When I go the the Term Overview page, I see all of the children of the first parent, and the pager says 3 pages are to follow. Now what happens is, if I go the next page I see the exact same output of the first page, and my second parent at the bottom. The same happens when I go to page 3, but then it shows the remaining 2 parent terms.

Research :

I've been digging in code (more specifically in /core/modules/taxonomy/src/Form/OverviewTerms.php ) where I came across this code :

// Do not let a term start the page that is not at the root.
      $term = $tree[$tree_index];
      if (isset($term->depth) && ($term->depth > 0) && !isset($back_step)) {
        $back_step = 0;
        while ($pterm = $tree[--$tree_index]) {
          $before_entries--;
          $back_step++;
          if ($pterm->depth == 0) {
            $tree_index--;
            // Jump back to the start of the root level parent.
            continue 2;
          }
        }
      }

Now, what I believe this does is quite simple : when deciding the terms to render on a page, it checks if a term is indeed at the root level before 'cutting it' at that term and displaying the rest at the next page. What happens in my case is that , because I have 3 parent terms and the first one has 250+ children, the parent and its children are all displayed on the pages, because it never gets to 'cut' the array of terms to show.

Hence, it just shows everything until it reaches the next root (which is my second parent).

(I know, my phrasing could be a bit better, but I believe you know what I mean :) )

The pagination just says three pages, because it divides the total number of terms (250+) in 'chunks' of 100 (the setting in taxonomy config files).

Now, I do believe this 'works as designed', because the pagination is correct in assuming there will be three pages (in my case), but there should be a better way to display a root parent term with 100+ terms, because this is the real issue here : any root parent term with 100+ children will be displayed in this manner.

I do believe this is related to https://www.drupal.org/node/242324 , which is where this code was introduced in the first place. And for 99% of the websites, this will work like a charm, but in this case it does not :)

ATM I'll be investigating contrib modules to adress this problem, as I do not see an easy solution for this. I just thought I'd mention this problem.

I haven't supplied screenshots, because of the amount of terms. If need be, I'll supply some.

Abstract RenderCache into a separate service that is capable of cache redirects in a non-render array-specific way

$
0
0

Problem/Motivation

The render system has \Drupal\Core\Render\RenderCache(Interface). This is capable of doing cache redirects, based on bubbled cache contexts. I.e. compare the originally known cache contexts with those that the final-to-be-cached data depends upon, and if that set is different, cache it as a cache redirect. (See RenderCache's docs for details.)

This is useful outside of the render system too.

Proposed resolution

Abstract RenderCache into a service (name TBD, initial quick thought: RedirectingCache) that RenderCache can use, so that RenderCache is just one of many things able to use this generic concept.

Remaining tasks

TBD

User interface changes

None.

API changes

None, pure API addition.

Data model changes

None.

Media library widget + Paragraphs broken: validation error on required field in paragraphs subform

$
0
0

Problem/Motivation

First, it isn't clear to me if this is something that should be logged against Core or the Paragraphs module. It's hard to know if it's core behavior that creates unexpected results in certain situations (like nested forms) or if it's an issue with how Paragraphs are submitted/validated. I can't find a similar issue in either place.

Steps to Reproduce

  1. Install Drupal 8.6.x with the core Media and Media Library modules enabled; also install/enable the contrib Paragraphs module.
  2. Create a Paragraph type with a Media reference field that references the Image media type. Make that field required and ensure it uses the "Media library" widget.
  3. Add a Paragraphs field on one of the content types core adds by default. Enable the paragraph type to be used by that field.
  4. Navigate to the add form for that content type and add a paragraph of that type. Attempt to use the Media library widget to upload/add a photo.

Expected result: The image gets successfully added, as it would if this field was not in a paragraph or, strangely, if the paragraph's image field is not required.

Actual result: Upon submitting the modal form, a validation error is thrown: "This value should not be null." (See attached screenshot taken using simplytest.me.) The image is never successfully added in the form and as a result, can't be saved. (As previously mentioned, this does not happen when the field isn't required. The image gets added as expected.)

Proposed resolution

Determine if this is an issue with Media Library, Paragraphs, or something else and get it in the appropriate place. Then hopefully get to the bottom of it and create a patch. If someone can at least point me in the right direction of where I might debug this, I could attempt to do so myself.

Thanks for any and all help and for your work on the Media system!

Remaining tasks

TBD.

Viewing all 294497 articles
Browse latest View live


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