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

Add loadAll() to EntityStorageInterface

$
0
0

We accomplish this currently by passing a NULL argument to loadMultiple:

/**
   * Loads one or more entities.
   *
   * @param $ids
   *   An array of entity IDs, or NULL to load all entities.
   *
   * @return
   *   An array of entity objects indexed by their ids.
   */
  public function loadMultiple(array $ids = NULL);

Not only is it generally a bad coding practice to accept multiple types in a method signature, but this behavior isn't exactly intuitive. I noticed this while working on #597236: Add entity caching to core, which has excessive conditional logic to account for the multiple argument types. It also should be noted in Drupal 7 one needed to pass FALSE to entity_load instead of NULL which just adds to the confusion.

It would be a lot simpler to just add loadAll and let loadMultiple require an array.


Document valid plugin ID format

$
0
0

Problem/Motivation

There is no documentation or specification about the valid character set for a plugin ID.

The api.d.o topic just speaks of "a unique string identifier". (Which doesn't even explain in which domain it has to be unique.)

Proposed resolution

[a-zA-Z0-9_-]+
(alphanumeric, underscore, hyphen)

Remaining tasks

Decide if this is adequate
Document it!

User interface changes

N/A

API changes

Depends on if it is enforced or only documented

Data model changes

N/A

Experimental migrate_drupal_multilingual module

$
0
0

Problem/Motivation

Even after we get the last couple multilingual issues resolved, there are still many unknowns and multilingual areas could get improved. Rather than rushing and stating all multilingual migrations are ready because we just need to get things out the door, let’s take off the pressure. Give us a little more time to do things properly. Having a separate marking module let’s us mark multilingual stable when it is really more stable.

Proposed resolution

  • Add a new migrate_drupal_multilingual module
  • In all i18n and entity translation migrations add a tag 'Multilingual'
  • In checkRequirements() check if the 'Multilingual' tag exists and if so add a requirement that the 'migrate_drupal_multilingual' module is enabled.
  • If the module doesn’t exist (i.e. it isn’t installed) then it fails requirements and will not be available for migrations.
  • Then mark migrate_drupal_multilingual as experimental. And mark migrate_drupal as stable.
  • Profit

The original proposed resolution was limited to i18n migrations and for those, the i18n source plugins would have a requirement of the new module. It was then pointed out in #78 that entity translations also needed to be included. After a migrate meeting it was proposed to add a tag for entity translation, see #80. Then in both #81> and #86 it was questioned why two methods (testing the source plugin and using a tag) was necessary. Finally, in #87 the use of just the tag was agreed and implemented.

https://www.drupal.org/project/drupal/issues/2953360#comment-12652339

Remaining tasks

  • Roll a patch.
  • Discuss if this can land as Experimental into 8.6. That way we could mark migrate drupal and the UI as stable sooner.

User interface changes

None.

API changes

None.

Data model changes

None.

Variable comment_parent in comment.html.twig should be parent_comment

$
0
0

API page: https://api.drupal.org/api/drupal/core%21modules%21comment%21templates%2...

These variables are provided to give context about the parent comment (if any):

comment_parent: Full parent comment entity (if any).
parent_author: Equivalent to author for the parent comment.
parent_created: Equivalent to created for the parent comment.

There is comment_parent variable in comment.html.twig documentation which gives NULL result.

parent_comment provides comment entity so I think it is just documentation issue.

Convert Entity to EntityBase for consistency with ContentEntityBase and ConfigEntityBase

$
0
0

Problem/Motivation

In #1881794: Link the EntityManager from the Entity base class (or EntityInterface?), we're discussing how and where to properly document entity definitions. Other annotated classes in core (e.g. Views plugins, Blocks, aggregator fetchers) have either abstract base plugin or a default plugin implementations. Unlike these, entity types are not currently true plugins and just use annotated discovery. However, the fact subclasses of Entity have annotations while Entity itself does not is somewhat confusing. The class documentation still states that you can use Entity directly for creating simple entities, but it seems that Entity is oddly unlike specific entity types.

Proposed resolution

Should Entity be an abstract base class instead?

Related issues

Update RestRegisterUserTest to use the ResourceTestBase base class instead of the deprecated RESTTestBase

$
0
0

Problem/Motivation

We've had ResourceTestBase for exactly a year now (since #2737719: EntityResource: Provide comprehensive test coverage: for every entity type, every format, every method).

In working on #2893804: [PP-1] Remove rest.module BC layers, it became clear that RestRegisterUserTest was still using the deprecated base test class. In fact, this issue blocks that issue.

Proposed resolution

Update RestRegisterUserTest.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Add an article to Umami - Oatmeal

$
0
0

Here's a new article about oatmeal for the Umami Demo and this issue is to get the article reviewed and added into the articles section of Umami.

Replace documentation recommending db_*() wrappers


Update database.api.php to remove deprecated db_*() functions.

$
0
0

Problem/Motivation

#2849745: Replace documentation recommending db_*() wrappers is trying to fix all documentation which references db_*() functions.

Let's split out the database.api.php file and fix it, since it is the primary documentation for this API.

Proposed resolution

Fix the documentation in core/lib/Drupal/Core/Database/database.api.php to exclude the deprecated db_*() functions.

Also, this is a good documentation-only candidate for backport to 8.6.x, even during alpha.

Remaining tasks

User interface changes

API changes

Data model changes

EnforcedFormResponseSubscriber should use KernelEvent's method instead of HttpKernelInterface's constant

$
0
0

EnforcedFormResponseSubscriber has a method acting as an event listener. This method is testing the event's request type using a HttpKernelInterface's constant:

if ($response instanceof EnforcedResponse && $event->getRequestType() === HttpKernelInterface::MASTER_REQUEST) {

, whereas the testing logic is provided by KernelEvent itself in its following method:

public function isMasterRequest()
{
    return HttpKernelInterface::MASTER_REQUEST === $this->requestType;
}

Therefore EnforcedFormResponseSubscriber should use KernelEvent::isMasterRequest() instead:

if ($response instanceof EnforcedResponse && $event->isMasterRequest()) {

Installer sometimes gives "Drupal already installed" message even if install failed

$
0
0

If you already have an old d8 database, and you mistakenly specify that database during the install, the installer says "Drupal already installed" even if it isn't. I'm not sure if there's a way Drupal could distinguish between situations where the specified database exists and contains Drupal data, but the site is not actually installed, and situations where the database is set up and Drupal has been successfully installed. If it's possible to make that distinction, the "Drupal already installed" heading could be changed to something more helpful, like "You specified a database that already contains Drupal data. To continue with the install, you need to delete or empty that database, or specify a different database."

Granted, the bullets below the heading should help with that, but the heading itself can cause confusion.

Decorating media source manager leads to WSOD

$
0
0

Problem/Motivation

Media source instances carry a getMetadata() method. As this is not pluginified, extending it requires us to decorate the class. (Remember: decorating is not swapping a subclass in, as that will break other decorators(todo: link issue)). As simpler solutions did not work out (todo: link to documentation), we first had to decorate the manager.

In the Media Imagick module i implemented that successfully (and in a reusable way), but get a WSOD as at least 1 place in core programs against the class and not an interface:
TypeError: Argument 1 passed to Drupal\media\MediaTypeForm::__construct() must be an instance of Drupal\media\MediaSourceManager, instance of Drupal\plugindecorator\PluginManagerDecorator

Proposed resolution

Create a DefaultPluginManagerInterface and use it.

Daring to target 8.6 and raise prio as this blocks a stable release of a contrib module and is important to the media system.

Remaining tasks

Code, test, commit.

User interface changes

None.

API changes

Interface added.

Data model changes

None.

Form: Convert system functional tests to phpunit Part 2

$
0
0

Follow up to #2867154: Form: Convert system functional tests to phpunit for tests that need additional discussion or a split into two tests.

Scope:

  • Drupal\system\Tests\Form\ElementsTableSelectTest should be split into JTB and BTB
  • Drupal\system\Tests\Form\RebuildTest should be split into JTB and BTB
  • Drupal\system\Tests\Form\StorageTest should be split into JTB and BTB
  • Drupal\system\Tests\Form\TriggeringElementTest discuss to do the changes in BTB drupalPostForm and handle the exceptions there like WTB

Rename MigrateUpgrade tests

$
0
0

Problem/Motivation

A follow up to #2953360: Experimental migrate_drupal_multilingual module.

The names of the full upgrades tests are do not reflect what the test does. Tests such as MigrateUpgrade6Test were test the full upgrade when multilingual modules are enabled and tests such as MigrateUpgrade6I18ReviewPageTest test the review page when the multilingual modules are not enabled.. Pretty obvious that is not what you expect when reading the name.

This is just historical, as each migration was written it was added to MigrateUpgrade6Test or MigrateUpgrade7Test, and that included any migration for translations. It wasn't until MigrateUpgrade6I18nReviewPageTest was added, in #2960013: i18n menu links translation in wrong directory, that a test was added that excluded the translations but the renaming didn't happen then.

Proposed resolution

Rename as follows

  • MigrateUpgrade6Test --> MigrateUpgrade6I18nTest
  • MigrateUpgrade6ReviewPageTest -> MigrateUpgrade6i18nReviewPageTest
  • MigrateUpgrade6I18nReviewPageTest -> MigrateUpgrade6ReviewPageTest
  • MigrateUpgrade7Test --> MigrateUpgrade7I18nTest
  • MigrateUpgrade7I18nReviewPageTest -> MigrateUpgrade7ReviewPageTest

Remaining tasks

@DataType=map cannot be normalized, affects @FieldType=link, @FieldType=map

$
0
0

Problem/Motivation

Problem/Motivation

\Drupal\Core\TypedData\Plugin\DataType\Map allows a TypedData object to be created that emulates an associative array. Unlike all other TypedData objects, a value of the Map type does not require its properties to have definitions. It's "freeform" so to speak.

It seems that the original intent was to have it serve primarily as a base class for other complex data, but not be the primary data itself. However, that usecase was not precluded.

Several implementations in Drupal core and contrib have defined values that use the raw Map type.

The serialization system has default normalizers for objects that implement ComplexDataInterface, which the Map class does. It makes a call to getProperties(), then normalizes each of those properties.

Every TypedData value instance is supposed to carry a definition. The default implementation of getProperties uses this definition and the static method getPropertyDefinitions on it to return definitions for each property of the map.

Unfortunately, raw uses of Map and MapItem don't need to have those definitions statically defined. So an empty list of definitions is returned and the serializer thinks: "great, there's nothing to do!"

The serializers must then be able to take this into account. A TypedData object which returns no properties should simply escape the TypedData system and be normalized as a PHP value.

Remaining tasks

1. Write a failing test
2. Auto cast Map data values into its properties
3. Decide if a REST test is necessary, and how to test it with Core only, see #60
Use Core's link options(Map dataType) serialization test instead

4. The newest patch has been tested on 8.4.x,So it can be directly used on 8.4.
Back port the patch to 8.4.x (Given the timing, this backport won't get committed, but it's still valuable when people search for a solution on 8.4.x for the next 6 months or so.)

User interface changes

None

API changes

None

Data model changes

None


Notice: Undefined index: #type in drupal_process_states()

$
0
0

Problem/Motivation

Problem

  • When #states is attached to a form element that contains #markup the following notice occurs:

    Notice: Undefined index: #type in drupal_process_states() (line 583 of core/includes/common.inc).

Cause

  • This happens because a #markup element does not require the #type to be set.

Proposed resolution

  1. Fix the PHP notice.
  2. Add a regression (kernel) test to ensure that this bug does not reappear in the future.

Notes

  • There are no PHP/backend tests for #states right now, because the "functionality" on the PHP side is in essence just a json_encode(), so nothing worth to test.

Remaining tasks

  • Make sure patch applies to 8.5.x and 8.6.x as well.
  • Write an unit (kernel) test to ensure that the bug does not reappear in the future.

User interface changes

No.

API changes

No.

Data model changes

No

Create a field widget for the Media library module

$
0
0

Problem/Motivation

It would be nice if users could visually select media when editing and creating content, instead of using the Entity Reference field widget.

Proposed resolution

We should create a new field widget that allows users to select media from the Media library view, and ensure that the widget is designed in a way that other selection interfaces (like upload, oembed, etc.) will also work in the future.

Remaining tasks

Write/review patches, wait for #2962110: Add the Media Library module to Drupal core to land.

User interface changes

A new field widget will be available to users who are already using the Media library.

API changes

TBD.

Data model changes

None.

Page/Routing/Render/Session: Convert system functional tests to phpunit

$
0
0

Convert system functional tests to phpunit

Scope:
#2984185: Convert system functional tests to phpunit for page and pager./Page/DefaultMetatagsTest.php
#2984185: Convert system functional tests to phpunit for page and pager./Pager/PagerTest.php
./Render/HtmlResponseAttachmentsTest.php
./Render/UrlBubbleableMetadataBubblingTest.php
#2983970: Convert system functional tests to phpunit /Routing/DestinationTest.php ./Routing/DestinationTest.php
./Routing/RouterTest.php
./Session/SessionAuthenticationTest.php
./Session/SessionHttpsTest.php
./Session/SessionTest.php
./Session/StackSessionHandlerIntegrationTest.php

Postponed:
./Path/UrlAliasFixtures.php
./Routing/MockAliasManager.php
./Routing/MockRouteProvider.php

Upload progress PHP 7, documentation and recommendation on status report

$
0
0

The D7 and D8 status report still recommends installing PECL uploadprogress library (http://pecl.php.net/package/uploadprogress) and shows a warning if not working. The installation process doesn't work for PHP 7 the same way like often recommended in the documentations for PHP 5 before and pecl uploadprogress seems effectively almost deprecated. This can confuse the user. There is a Drupal issue on support for PHP 7 (https://www.drupal.org/node/2454439) which was marked fixed without addressing the uploadprogress that was mentioned in the comments of the mentioned issue.

At a minimum, the status report in the users Drupal admin/reports/status path should be changed to wether not recommend PECL uploadprogress no more or to link to a new way of installing it like suggested in the comments here below.

Alternatively, we could have a second approach whether that be APC (also currently mentioned on the status report) or something else.

Debian 9 and Ubuntu 16.04 or higher now ship with PHP7 by default and php meta packages link now to php7 not to php5 (as has been mentioned in other issues) so this is about to become more important and it would be nice to get ahead of the curve if possible.

Some mentioned temporary work arounds in the comments below: Ubuntu: #2, #7, Centos: #20, Debian/ubuntu: #26, #55, #32.

  • Issue summary edited by diqidoq
  • 2 documentations on Drupal.org about PHP 5 installation methods (Link1, Link2) have a note with a link to here for PHP 7 now

Adopt Content Moderation in Umami

$
0
0

Problem/Motivation

Content moderation has been marked as stable in Drupal 8.5.0. We should showcase it in Umami!

Proposed resolution

Enable Workflows and Content Moderation on install. Create separate roles, users and workflows to demonstrate a publishing workflow enforced by Content Moderation.

Remaining tasks

Create example editor users.
Add all node types to the workflow on install.

User interface changes

None.

API changes

None.

Data model changes

None.

Viewing all 293641 articles
Browse latest View live