Quantcast
Viewing all 294473 articles
Browse latest View live

Fix symfony version requirements for symfony/event-dispatcher

Problem/Motivation

With the release of Symfony 4.3 the event dispatching changed: https://symfony.com/blog/new-in-symfony-4-3-simpler-event-dispatching
This already causes issues for drupal regarding the upgrade to Symfony 4.x or 5, for example in
#3055194: [Symfony 5] The signature of the "Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher::dispatch()" method should be updated to "dispatch($event, string $eventName = null)", not doing so is deprecated since Symfony 4.3. and #3055180: [META] Make Drupal 8 work with Symfony 5 (along with Symfony 3 and 4).

But Drupal isn't the only system that has to deal with that. Third party libraries drupal leverages directly or via contributed modules need to adapt to this change. Therefore the symfony project itself provides a migration path by decorating the event dispatcher with LegacyEventDispatcherProxy as described in blog post linked above.

This LegacyEventDispatcherProxy has been released as part of symfony/event-dispatcher 4.3.0.
The event-dispatcher has no dependency to any 4.3 versions of other symfony components but is backward compatible to symfony 3.4 which we use in Drupal 8:

"require-dev": {
        "symfony/dependency-injection": "~3.4|~4.0",
        "symfony/expression-language": "~3.4|~4.0",
        "symfony/config": "~3.4|~4.0",
        "symfony/http-foundation": "^3.4|^4.0",
        "symfony/service-contracts": "^1.1",
        "symfony/stopwatch": "~3.4|~4.0",
        "psr/log": "~1.0"
    },
"conflict": {
        "symfony/dependency-injection": "<3.4"
    },

See https://github.com/symfony/event-dispatcher/blob/4.3/composer.json

But no matter how we deal with the migration within the Drupal project, we already have a critical issue.
As an example, the upcoming 5.1.0 release of the solarium library implements the migration path as recommended by the symfony project:
https://github.com/solariumphp/solarium/pull/690

This library is required by the search_api_solr module that has more than 14,000 active 8.x installations already. search_api_solr injects the Drupal event dispatcher into the solarium Solr Client.

From my point that works perfectly fine. But Drupal prohibits the update because of this version constraint:
"symfony/event-dispatcher": "~3.4.0",

This version constraint is simply wrong as Drupal doesn't use the event dispatcher provided by this module but only it's EventDispatcherInterface which has been kept compatible in symfony 4.x.

So the current situation is that Drupal blocks feature and security updates of third party libraries which use symfony event dispatching and adopting to symfony event dispatching changes in the proposed and compatible way. That has to be considered as critical.

Proposed resolution

Adjust the version requirement like this:
"symfony/event-dispatcher": "~3.4.0|~4.0"
Afterwards composer will resolve the correct combination of module versions without upgrading the other symfony components at all.
Drupal will still use 3.4.

Remaining tasks

Just apply the patch.
The (failing) test result of https://www.drupal.org/project/drupal/issues/3055194#comment-13221924 already proves that drupal will work perfectly fine with symfony/event-dispatcher:4.3

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

Todo, maybe not required at all.


Language specific term(i18n_taxonomy) should not rely on entity translation in d7 taxonomy term migration

Language specific term has been provided by i18n_taxonomy module which is completely independent of entity_translation module in D7. Now in Drupal 8 d7_taxonomy_term source plugin generating term language from entity_translation and reseting the language to site default language.

How to reproduce the issue.
You should have more than one language(D7)
In D7 install i18n_taxonomy module. Dont install entity_translation module.
Then edit the vocabulary and in MULTILINGUAL OPTIONS select "Translate. Different terms will be allowed for each language and they can be translated." and save.
Add term
Select any language other than site's default language
Test migrate taxonomy to D8
Check term language

Solution
We should check if taxonomy_term_data table already has language column(added by i18n_taxonomy) or not, if it has then we should avoid checking entity_translation table.

Please note: This is not related to translation of a taxonomy term. This is related to term that is added for a specific language in a multi language site.

Provide menu link with disable option [Node Add Form]

While creating a NODE, MENU SETTINGS section to have a 'Enabled' checkbox like it has at /admin/structure/menu/manage/, to prevent landing to unpublished node (if node is been NOT published while creating it).

Ensure language is not Null in translation source queries

Problem/Motivation

Was getting errors from a translation migration (didn't keep the details) because the language was NULL. When I looked at the source database there were entries in the relevant i18n table but not a corresponding entry in the locales_target table, which is the one with the language. I recall seeing this before and at least one of the source plugins has a condition to only retrieve rows where language is not NULL. This condition should be applied to all the translation source plugins that involve the i18n tables.

The alternative is to modify all the migrations to skip_on_empty on the language field. It just adds extra processing.

The source plugins with an ->isNotNull('language') condition are d6/ProfileFieldTranslation.php and d6/FieldLabelDescriptionTranslation.php. There is actually a mix of conditions in the source plugin in an attempt to make sure there is data. Maybe they should all use the same 'safest' choice?

core/modules/field/src/Plugin/migrate/source/d6/FieldLabelDescriptionTranslation.php:      ->isNotNull('language')
core/modules/field/src/Plugin/migrate/source/d6/FieldLabelDescriptionTranslation.php:      ->isNotNull('translation');
core/modules/field/src/Plugin/migrate/source/d6/FieldOptionTranslation.php:      ->isNotNull('translation');
core/modules/user/src/Plugin/migrate/source/d6/ProfileFieldOptionTranslation.php:      ->isNotNull('translation');
core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustomTranslation.php:      ->isNotNull('lt.lid');
core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php:    $query->isNotNull('i18n.lid');
core/modules/menu_link_content/src/Plugin/migrate/source/d6/MenuLinkTranslation.php:    $query->isNotNull('i18n.lid');
core/modules/config_translation/src/Plugin/migrate/source/d6/ProfileFieldTranslation.php:      ->isNotNull('language');

Proposed resolution

Use an innerjoin instead of isNotNull to prevent rows where the language is Null which would have to be skipped in the process pipeline.

Modify the source plugin tests to have a row in an 'extra' row in the i18n_table that does NOT have a corresponding row in the locales_table.

There are the relevant source plugins.

$ grep -r locales_target core/modules/*/src/Plugin/migrate/source/ | awk '{print $1}' | sort -u
core/modules/block_content/src/Plugin/migrate/source/d7/BlockCustomTranslation.php:
core/modules/block/src/Plugin/migrate/source/d7/BlockTranslation.php:
core/modules/config_translation/src/Plugin/migrate/source/d6/ProfileFieldTranslation.php:
core/modules/content_translation/src/Plugin/migrate/source/I18nQueryTrait.php:
core/modules/field/src/Plugin/migrate/source/d6/FieldLabelDescriptionTranslation.php:
core/modules/field/src/Plugin/migrate/source/d6/FieldOptionTranslation.php:
core/modules/field/src/Plugin/migrate/source/d7/FieldLabelDescriptionTranslation.php:
core/modules/field/src/Plugin/migrate/source/d7/FieldOptionTranslation.php:
core/modules/menu_link_content/src/Plugin/migrate/source/d6/MenuLinkTranslation.php:
core/modules/taxonomy/src/Plugin/migrate/source/d6/TermLocalizedTranslation.php:
core/modules/taxonomy/src/Plugin/migrate/source/d6/VocabularyTranslation.php:
core/modules/taxonomy/src/Plugin/migrate/source/d7/TermLocalizedTranslation.php:
core/modules/user/src/Plugin/migrate/source/d6/ProfileFieldOptionTranslation.php:

Remaining tasks

Review
Commit

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Add test of d7 term localized source plugin

Call to a member function isTranslatable() on null in SqlContentEntityStorage

Hi,

I get a blank page in admin/content. No error. Everything else is working fine in the Admin Menu including Add content and Comments under the Content Menu.

Drupal 8.4.2 (problem was the sma with 8.4.1)
Modules
Admin Toolbar 8.x-1.21
Calendar 8.x-1.x-dev (2017-Oct-04)
CAPTCHA 8.x-1.0-beta1
Content Access 8.x-1.0-alpha1
Field tools 8.x-1.0-alpha4
Menu block 8.x-1.4
Menu Multilingual 8.x-1.x-dev (2017-Nov-27)
Module Filter 8.x-3.1
Protected Pages 8.x-1.0
reCAPTCHA 8.x-2.2
Rules 8.x-3.0-alpha3
Simple Google Maps 8.x-1.4
Typed Data API enhancements 8.x-1.0-alpha1
Views Templates 8.x-1.0-alpha1
Webform 8.x-5.0-beta24

[META] Support WYSIWYG embedding of media entities

Problem/Motivation

Core currently provides support for embedding of images. It is currently impossible to embed a video or a document. Also, when #2801277: [META] Support remote media assets as first-class citizens by adding Media Entity module in core lands we'll need to embed media entities rather than files.

Contrib already has a solution for this. Entity embed is a module that supports embedding of any renderable entity and supports extensive display configuration.

Proposed resolution

Move parts of Entity embed into core (simplified text filter) and handle embedding through it. Entity embed display plugins, embed button config entities, and other related API surface will stay in contrib. The simplified text filter will only support embedding media entities; people wishing to embed other types of entities will need to use contrib. Existing WYSIWYG functionality would remain the same.

Remaining tasks

In order:

  1. #2940029: Add an input filter to display embedded Media entities
  2. #2994696: Render embedded media items in CKEditor
  3. #2994699: Create a CKEditor plugin to select and embed a media item from the Media Library
  4. #2994702: Allow editors to alter embed-specific metadata, as well as `data-align` and `data-caption`
  5. SHOULD-HAVE #3066802: Add a new view mode for embedded media
  6. SHOULD-HAVE #3074608: [PP-1] Optionally allow choosing a view mode for embedded media in EditorMediaDialog
  7. SHOULD-HAVE #3073901: Determine an upgrade path from CKEditor image button to media library

Additional required bug fixes:

Additional related and follow-up issues

User interface changes

TBD

API changes

TBD

Data model changes

TBD

[pp-3] Bubbling of elements' max-age to the page's headers and the page cache

Problem/Motivation

When I set a certain block to be cached for up to e.g. 15 minutes, then I expect that the containing page also emits a corresponding header. And I also expect Drupal's page cache to honor this.

Examples:

  1. A block with a weather forecast summary. The data constantly changes so e.g. cache for maximum 15 minutes.
  2. A View with a date filter relative to current time, such as "Upcoming Events", showing say 3 soonest future events. The block can be cached for maximum until the time/day of first event, then it must be refreshed to exclude the event now in the past.

Proposed resolution

TBD

Workaround

Install contrib module Cache Control Override. However this is not perfect, and if you use it you might hit the exact same problems that are making this issue be postponed (see #113).

  1. Other system blocks such as forms, language switcher that are in fact cachable currently may emit max-age = 0 so will prevent caching after CCO is installed.
  2. CCO disables dynamic cache as well as static cache.
  3. CCO only detects max-age = 0 so it won't work if your block has a small positive max-age.

Also note that in the case of the second example above, Views will not automatically emit the correct max-age based on the presence of a date filter - you need to write a hook to do that.

Remaining tasks

We need to fix these issues first:

User interface changes

None.

API changes

None.


Add a new view mode for embedded media

Problem/Motivation

In #2940029: Add an input filter to display embedded Media entities, we added the ability to embed media entities into WYSIWYG text editors and HTML content, using an input filter. By default, the media items are embedded by rendering them through their "full" view mode (although this can be overridden by changing a special data attribute in the raw HTML). The "full" view mode might not be entirely appropriate for an embedded representation of a media item, so this issue is where we can explore the possibility of adding a new view mode specifically for use when embedding media items in HTML, and changing the input filter to use it as the default view mode.

Proposed resolution

Discuss whether we should create an "embed" view mode, and what should be in the corresponding view displays for each media type we ship with Standard.

Remaining tasks

Once we've decided what we want, make it happen.

User interface changes

TBD.

API changes

TBD, but likely none.

Data model changes

None anticipated.

Release notes snippet

TBD

Allow Twig templates to use front matter for metadata support

Problem/Motivation

It is becoming increasingly clear, both throughout core and in contrib, that Twig templates need the ability to associate contextual metadata with them.

Typically, in the past, this has been done using standalone/custom YAML files (like with layouts: *.layouts.yml). Now, in the case of help_topics this metadata is being embedded using HTML <meta> tags inside the templates themselves.

While this technically works and is filtered out during XSS processing, it creates yet another coding paradigm FE developers have to be aware of. The primary reason this was done was to keep the relevant information with the template it is associated with.

From @alexpott in #2920309-321: Add experimental module for Help Topics:

Having to define a help topic in both a yaml file and then create a separate twig template was bothering me. The reason we went for annotations was to keep the discovery along with the code. I think the same rule appears here.

Suffice it to say: we need a standardized way of associating inline metadata with templates.

Potential existing use cases

  • Layouts (*.layouts.yml)
  • Help Topics (embedded <meta> HTML tags)

Being able to associate metadata with a template can also lend to newer innovations for problems we've had in the past.

Potiential new use cases

There are many ideas of how we can help alleviate BC issues with Twig templates, almost all would likely require the ability to provide some sort of metadata with them; if only for some sort of identification, filtering, or sorting purposes.

Proposed resolution

Allow the use of Front Matter YAML blocks at the top of template files.

Front Matter was made popular by Jekyll and has since become sort of the "industry standard" way of associating metadata with any sort of document.

Remaining tasks

  • Create patch
  • Create tests

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

TBD

Use "all" in update url's instead of CORE_COMPATIBILITY

Problem/Motivation

Because of #2807145: [policy no, patch] Allow contrib projects to specify multiple major core branches Drupal 9 may need to retrieve modules that start with 8.x-.

These maybe compatible with Drupal.

Proposed resolution

  1. Do not send \Drupal::CORE_COMPATIBILITY(8.x) in update requests. Replace this with 'all'
  2. Determine if more information needs to be returned from the update server to determine if the module is compatible with the current version of Drupal. It may need the new core_dependency key added in #2313917: Core version key in module's .info.yml doesn't respect core semantic versioning

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Entity queries for latest revisions should return the latest workspace-specific revisions

Problem/Motivation

Doing a 'latest revision' entity query should return the latest workspace-specific revisions, otherwise a user could edit a revision that belongs to a different workspace.

Proposed resolution

Make latest revision entity queries return the latest workspace-specific revisions instead.

Remaining tasks

Review.

User interface changes

Nope.

API changes

Nope.

Data model changes

Nope.

Release notes snippet

Rntity queries that are looking for latest revisions of an entity type (by using \Drupal\Core\Entity\Query\QueryInterface::latestRevision()), are now returning the latest workspace-specific revision when running in a non-default workspace context, for example in the stage workspace.

Remove the concept of a 'live' default workspace

Problem/Motivation

As pointed out in #2784921-112: Add Workspaces experimental module point 1, having a Live (default) workspace entity is not desirable. It's also problematic when uninstalling the Workspace module, as can be seen in #3059824: TypeError: Argument 1 passed to Drupal\workspaces\WorkspaceListBuilder::buildRow() must implement interface Drupal\Core\Entity\EntityInterface, null given.

Proposed resolution

Remove the Live (default) workspace and change the concept model for switching to the Live version of the site by switching out of the current workspace.

Remaining tasks

Reviews.

User interface changes

The workspace switcher block does not have Live as an option anymore, and a Switch to Live action button has been added instead.

Before - in the Live version of the site
Image may be NSFW.
Clik here to view.

Before - in the Stage workspace
Image may be NSFW.
Clik here to view.

After - in the Live version of the site
Image may be NSFW.
Clik here to view.

After - in the Stage workspace
Image may be NSFW.
Clik here to view.

API changes

API additions:

- three new methods on WorkspaceManagerInterface: hasActiveWorkspace(), switchToLive() and executeOutsideWorkspace().
- one new method on WorkspaceNegotiatorInterface: unsetActiveWorkspace()

Data model changes

There is no 'live' workspace entity anymore.

Release notes snippet

There is no concept of a "Live" (default) workspace anymore. Switching to the live version of the site is now accomplished by switching out of the current workspace.

WI: Workspace module roadmap

Note: This is issue is part of #2721129: Workflow Initiative and is only meant for planning and governance sign-offs. Work will happen in child issues of this plan.

Target version for beta stability: Drupal 8.6

This phase will introduce the concept of workspaces through a new experimental module.

Content entities always belong to a workspace (there is one main exception, which is the user entity type). A workspace is a silo/container of content on a site. However, this phase mostly introduces the underlying concept with one single workspace available, without many supporting APIs around it (see later phases).

Implementation

Required before stable release

Must-have

Should-have

Required before beta release

Must-have

Should-have

Could-have

  • ?

Sign-offs needed

Product manager

A product manager needs to sign-off on this plan because the concept of workspaces constitutes a significant addition to Drupal core.

Framework manager

A framework manager needs to sign-off on this plan as the above phases introduces very significant API additions.

Release manager

A release manager needs to sign off because the scope and impact of the work are significant for core.

Sub-system maintainers

The sub-system maintainers for the Entity API needs to sign-off on this plan as it significantly impacts the Entity API.

Sign-offs given

  • Product manager - pending
  • Framework manager - pending
  • Release manager - pending
  • Sub-system maintainers - pending

Convert aggregator module hook_help() to topic(s)

Problem/Motivation

#3041924: [META] Convert hook_help() module overview text to topics for the aggregator module.

Proposed resolution

Take the information that is currently in the hook_help module overview section for the module(s), and make sure the information is in one or more Twig help topic files. Steps:

  1. Find the hook_help() implementation function in the core/modules/MODULENAME/MODULENAME.module file(s). For example, for the core Contact module, the module files is core/modules/contact/contact.module, and the function is called contact_help().
  2. Locate the module overview portion of this function. This is located just after some lines that look something like this:
      switch ($route_name) {
        case 'help.page.contact':
    

    And ends either at the end of the function, or where you find another case 'something': line.

  3. We want to end up with one or more topics about the tasks that you can do with this module, and possibly a section header topic. So, read the help and figure out a good way to logically divide it up into tasks and sections. See Standards for Help Topics for information on how to do this.
  4. See if some of these tasks are already documented in existing topics. Existing topics could be in one of the following directories:
    core/modules/help_topics/help_topics
    core/modules/MODULENAME/help_topics
    core/help_topics
    

    Note that to see existing topics, you will need to enable the experimental Help Topics module (available in the latest dev versions of Drupal 8.x).

  5. For each task or section topic that needs to be written, make a new Twig topic file (see Standards for Help Topics) in one of the modules' help_topics directory (you will probably need to create that directory). Alternatively, if the information spans several modules or if the information should be visible before the module is installed, you can put it in core/help_topics. For instance, it might be useful to know that to get a certain functionality, you need to turn on a certain module (so that would be in Core), but then the details of how to use it should only be visible once that module is turned on (so that would be in the module).
  6. File names must be MODULENAME.TOPICNAME.html.twig -- for example, in the Action module, you could create a topic about managing actions with filename action.managing.html.twig .
  7. Make a patch file that adds/updates the Twig templates in Core. The patch should not remove the text from the hook_help() implementation (that will be done separately).

Remaining tasks

a) Make a patch (see Proposed Resolution section).

b) Review the patch:

  1. Apply the patch.
  2. Turn on the experimental Help Topics module in your site, as well as the module(s) listed in this issue.
  3. Visit the page for each topic that is created or modified in this patch. The topics are files in the patch ending in .html.twig. If you find a file, such as core/modules/action/help_topics/action.configuring.html.twig, you can view the topic at the URL admin/help/topic/action.configuring within your site.
  4. Review the topic text that you can see on the page, making sure of the following aspects:
    • The text is written in clear, simple, straightforward language
    • No grammar/punctuation errors
    • Valid HTML -- you can use http://validator.w3.org/ to check
    • Links within the text work
    • Instructions for tasks work
    • Adheres to Standards for Help Topics [for some aspects, you will need to look at the Twig file rather than the topic page].
  5. Read the old "module overview" topic(s) for the module(s), at admin/help/MODULENAME. Verify that all the tasks described in these overview pages are covered in the topics you reviewed.

User interface changes

Help topics will be added to cover tasks currently covered in modules' hook_help() implementations.

API changes

None.

Data model changes

None.

Release notes snippet

None.


Replace jQuery UI position() with supported solution

Problem/Motivation

We are in the process of deprecating jQuery UI in core. The jQueryUI position library is among the components that need to be removed/replaced.
As mentioned in the parent issue: #3067261: [Plan] Remove jQuery UI components used by Drupal core and replace with a set of supported solutions
The OpenJS Foundation lists jQuery UI as an Emeritus project in https://openjsf.org/projects/ which is described as:

Emeritus projects are those which the maintainers feel have reached or are nearing end-of-life

Proposed resolution

In core, jQueryUI Position is primarily used by other jQuery UI libraries that will be deprecated. There is one instance where it is used in isolation and must be specifically addressed: the Quickedit module. This means this issue is essentially finding a new library for Quickedit's positioning

Some options

Rule out libraries that shouldn't be used due to abandonment, performance, etc.
Create a prototype for the remaining libraries to be used in place of jQuery UI for quickedit's positioning
If prototype appears to function well, get signoff from Quickedit maintainer.

User interface changes

Ideally, there will be none. Any changes shouldn't be more than a mildly noticeable pixel difference

API changes

...

Data model changes

N/A

Release notes snippet

...

Reconsider our usage of JQuery Joyride (tour)

Problem/Motivation

jQuery Joyride was added to support tours. It is used in a Views tour and a welcome tour in Umami. However Joyride has not been maintained for the last 2 years. See https://zurb.com/playground/jquery-joyride-feature-tour-plugin and commit history at https://github.com/zurb/joyride

Proposed resolution

Consider replacing Joyride or remove altogether if we don't think its useful. The Umami team thinks it is useful and uses it.

Remaining tasks

Discuss.

User interface changes

TBD.

API changes

TBD.

Data model changes

TBD.

Release notes snippet

TBD.

Remove ResourceResponseValidator's unused $serializer property/service dependency

The manual at https://www.drupal.org/node/2492225 instructs us that we have to skip some logic when assertions are disabled (ini_get('zend.assertions') < 0). Right now JSON:API validates every response because assert_options(ASSERT_ACTIVE) returns TRUE by default (https://www.php.net/manual/en/function.assert-options.php) and default settings.php does not have assert_options(ASSERT_ACTIVE, FALSE);.

Also, since Drupal 8.7.x is no longer support PHP 5 I propose to delete the PHP_MAJOR_VERSION >= 7 condition.

Incorrect use of UnprocessableHttpEntityException in EntityResource::deserialize()

The EntityResource controller class has a deserialize() method which takes care of building the entity object from the submitted request data.

At some point, if either UnexpectedValueException or InvalidArgumentException are thrown by the underlying serialized, it is catched and an UnprocessableHttpEntityException is thrown by the method itself.

    try {
      ...
    }
    // These two serialization exception types mean there was a problem with
    // the structure of the decoded data and it's not valid.
    catch (UnexpectedValueException $e) {
      throw new UnprocessableHttpEntityException($e->getMessage());
    }
    catch (InvalidArgumentException $e) {
      throw new UnprocessableHttpEntityException($e->getMessage());
    }

The issue here is that, per its signature, UnprocessableHttpEntityException first argument should be an Exception object, not a string. When one of this situation occurs, a TypeError is thrown by PHP, breaking the execution flow and leading to a 5xx error instead of a JSON:API managed 4xx error.

JSON:API file uploads to aliased file field fail because alias is not resolved

When a new alias is added for an image field on Resource Overrides page (/admin/config/services/jsonapi/resource_types/node--project/edit) the route does not appear to have been created properly.
e.g: Create an alias for "field_project_beer_label" to be "beer_label
After that if I try to upload a file via Postman using this new url alias (/jsonapi/node/project/beer_label) I get the following the error message (Page not found).

When I try to upload using the field name (field_project_beer_label) debugging the code I see that the route was not created for the alias "beer_label" but the field was changed.

Viewing all 294473 articles
Browse latest View live


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