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

Deprecate theme functions

$
0
0

Problem/Motivation

Theme functions were deprecated back in 8.1.x and slated for removal in Drupal 9. However, we improved our deprecation policy during the lifecycle of Drupal 8 and added warnings to developers; these warnings were never added to the theme function system, and theme functions are still used in Drupal 8 contrib.

Contrib code search: http://grep.xnddx.ru/search?text=function%20theme_&filename=

Proposed resolution

Deprecate theme functions properly using trigger_error() etc in 9.1.x for removal in Drupal 10.

Remaining tasks

Add the deprecations and tests.

User interface changes

None

API changes

Developers will be warned when they use deprecated theme functions functionality.

Data model changes

None

Release notes snippet


Dialogs are focusable in Seven and Claro

$
0
0

Problem/Motivation

In Seven and Claro themes, every dialog ("normal" dialog, modal, off-canvas side and off-canvas top) is focusable, and get focus if a non-focusable element is clicked inside the dialog.

Based on #3023311-43: Modal dialog style update.1, dialogs shouldn't be focusable.

Additional details (non-related based on #2):

The dialog get's focused even for ajax actions taken on the Views UI's view edit form:

  1. With Seven or Claro admin theme, visit /admin/structure/views/view/who_s_online.
  2. Click on the User: User status filter criteria.
  3. Change filter exposure status (Expose this filter to visitors, to allow them to change it). When the AJAX completes, focus will move to the dialog element.
  4. If the tab key is pressed now, the focus moves to the dialog header close button.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Create contrib update module test cases that use semantic versioning

$
0
0

Problem/Motivation

After #2681459: Support contrib semver releases contrib will have semantic versioning for contrib projects.

That means and existing module with a 8.x-1.0 release may have future release of 2.0.0

#3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates will mean the update module will be pulling in both releases in the XML feed once drupal.org allows this in contrib

Currently the tests for contrib assume it releases in the 8.x-1.0 format.

Proposed resolution

We should have test cases that cover these new types of releases before Drupal.org allows them.

Types of test cases we need.

  1. only 8.x-1.0 type releases(our current cases for contrib)
  2. '

  3. XML with both 8.x-1.0 and 1.0.0 type releases
  4. XML with only 1.0.0 type releases

Remaining tasks

We determine if the split between tests in UpdateCoreTest and UpdateContribTest still make sense. There are some methods that only make sense for core but now that contrib and core will be able to have semantic versioning we may be able to unify the core and contrib versions of some test methods with a dataProvider that switches the project name.

User interface changes

None

API changes

None

Data model changes

None

Remove deprecated jQuery UI library definitions

$
0
0

Problem/Motivation

The bulk of the jQuery UI code in core was removed in #3087685: Remove deprecated jQuery UI components and fork remaining source code into core

Now that the source code is forked into core we can make additional changes to remove even more files.

Files selected for removal:

  • form-min.js (used by form-reset-mixin.js)
  • labels-min.js (used by checkboxradio.js)
  • escape-selector.js (used by checkboxradio.js)
  • checkboxradio.js (used by button.js)
  • controlgroup.js (used by button.js)

Proposed resolution

Delete these files and remove references in their dependents.

Remaining tasks

  1. Make necessary changes to jQuery UI source to safely remove these files
  2. Re-minify changed files
  3. Test for regressions

Field formatter & widget settings: fall back to default if missing plugin

$
0
0

Problem/Motivation

When Drupal migrates field formatter and field widget configurations into entity_view_display and entity_form_display entities, it often happens that the migrated formatter plugin (or field widget) has no replacement on the destination site.

In this cases, plugin discovery throws (and logs) a PluginNotFoundException (with an another log created by MigrateUpgradeImportBatch::onIdMapMessage), and the affected field gets hidden in its target entity_view_display (or entity_form_display) entity.

PluginManager's message:
The "file_rendered" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\FormatterPluginManager are: address_country_default, address_default, address_plain, address_zone_default, comment_default, comment_username, comment_permalink, datetime_plain, datetime_custom, datetime_time_ago, datetime_default, file_default, file_rss_enclosure, file_extension, file_filemime, file_uri, file_url_plain, file_video, file_audio, file_table, file_size, file_link, image, image_url, link, link_separate, media_thumbnail, oembed, list_key, list_default, entity_reference_rss_category, text_default, text_summary_or_trimmed, text_trimmed, user_name, author, timestamp, entity_reference_entity_id, entity_reference_label, boolean, number_decimal, language, basic_string, string, timestamp_ago, uri_link, number_integer, number_unformatted, email_mailto (/Users/zoli/projects/drupal/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:53)

Migrate Drupal UI's log message:

Source ID node,article,featured,field_image: The "file_rendered" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\FormatterPluginManager are: address_country_default, address_default, address_plain, address_zone_default, comment_default, comment_username, comment_permalink, datetime_plain, datetime_custom, datetime_time_ago, datetime_default, file_default, file_rss_enclosure, file_extension, file_filemime, file_uri, file_url_plain, file_video, file_audio, file_table, file_size, file_link, image, image_url, link, link_separate, media_thumbnail, oembed, list_key, list_default, entity_reference_rss_category, text_default, text_summary_or_trimmed, text_trimmed, user_name, author, timestamp, entity_reference_entity_id, entity_reference_label, boolean, number_decimal, language, basic_string, string, timestamp_ago, uri_link, number_integer, number_unformatted, email_mailto (/Users/zoli/projects/drupal/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php:53)

The messages above always follow each other.

Proposed resolution

Instead of logging the same message with MigrationInterface::MESSAGE_ERROR twice, we prevent PluginNotFoundExceptions by automatically selecting the default field formatter plugin ID (or widget ID). In these cases (so when the fall-back logic was needed for the right field formatter plugin ID), we add the related message to the MigrateExecutable in those migrate process plugins that are doing the fallback. These are caught in MigrateUpgradeImportBatch and logged into the logger.

This still informs the user, but does allow the migration to succeed, allows checking the rendered migrated entity, and generally results in fewer pointless messages.

We can do this for both d7_field_formatter_settings and d7_field_instance_widget_settings— the same problem can occur for both formatters & widgets.

Remaining tasks

User interface changes

API changes

Data model changes

Default formatters and widgets instead of hidden fields in entity forms and rendered entities.
Less resources are needed to restore the original structure.

Release notes snippet

Change Views UI to use drupal.dialog instead of jquery.ui.dialog

$
0
0

Problem/Motivation

In the interest of removing jQuery UI, which were to be removed or replaced (#3067261: [Plan] Remove jQuery UI components used by Drupal core and replace with a set of supported solutions), Views UI's direct usage of the jquery.ui.dialog library needs to be changed so that the underlying library can be deprecated and ultimately removed.

Proposed resolution

Change Views UI's direct usage of jquery.ui.dialog to drupal.dialog.

Remaining tasks

  • Switch the library usage.
  • Resolve any regressions.

User interface changes

TBD, hopefully none.

API changes

TBD, hopefully none.

Data model changes

n/a

Release notes snippet

TBD.

Move deprecation of REQUEST_TIME to Drupal 10

$
0
0

Problem/Motivation

From https://www.drupal.org/project/drupal/issues/2902895#comment-13461286

@catch and @alexpott agreed in Slack to postpone removing the constant to D10 as it seems like a lot of work is left that close to the first beta deadline. We can keep working on its removal in core but should also do an issue to change the deprecation message. And I guess remove it again from the hardcoded list in phpstan-drupal?

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Fix "MigrateCckField is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. Use \Drupal\migrate_drupal\Annotation\MigrateField instead." deprecation error

$
0
0

Problem/Motivation

Part of #2959269: [meta] Core should not trigger deprecated code except in tests and during updates

Proposed resolution

Remove the "MigrateCckField is deprecated in Drupal 8.3.x and will be removed before Drupal 9.0.x. Use \Drupal\migrate_drupal\Annotation\MigrateField instead." message from Drupal\Tests\Listeners\DeprecationListenerTrait::getSkippedDeprecations() and then fix all the problems related to that deprecation.

Remaining tasks

User interface changes

API changes

Data model changes


Fix AJAX add_css – insert the needed CSS assets after the already-inserted ones

$
0
0

Problem/Motivation

The AddCssCommand (typically used by AjaxResponseAttachmentsProcessor) always adds the missing-but-required CSS assets to the beginning of the HTML <head>.

Theme developers often rely on the loading order of the CSS assets, but due to the functionality described above, this becomes impossible when an ajax-driven operation happens on the page.

Proposed resolution

After superficially checking the CssCollectionRenderer, I would say it works fine: It returns the required CSS assets in the expected order (respecting the library dependencies).

Since we know that we have all off the required dependencies in the 'before-ajax' state, and the newly added CSS assets seems to be in the expected order, my proposed solutions are:

  1. Modify ajax.js's add_css command to add the CSS assets after the last stylesheet referrer link on the page <link rel="stylesheet">.
  2. Append to the HTML <head> (or <body> ?).

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Original report

See ajax_render()

And more specifically these lines:

  if (!empty($styles)) {
    $extra_commands[] = ajax_command_prepend('head', $styles);
  }

When you try to add stylesheets through ajax, isn't the expected behaviour that these stylesheets actually do something?
By prepending them to the head, you basically give them the lowest possible priority towards all other already loaded stylesheets.

Suggestion: use ajax_command_append() instead.

Example (shoddy, but it illustrates the problem):

  • I want to add and trigger a jQuery dialog through AJAX
  • I load the files using drupal_add_library and drupal_add_css in my AJAX callback
  • The JavaScript behaves as expected, the CSS doesn't because it has to yield to the system stylesheet for dialogs

Make Drupal\Core\Database\Query\Condition driver overridable

$
0
0

Problem/Motivation

At the moment all 3 by core supported driver can work with the same implementation of Drupal\Core\Database\Query\Condition.
The MSSQL database driver has to for #3113203: Kernel Test testDbLike mandates specific escape behavior. override the default implementation of the Condition class. Also there is for the SQLite driver an override necessary (see: #2031261: Fix SQLite variable limit). The way in which the override is implemented for the SQLite driver is very different to the other query operators. We should database driver override the default implementation of the Condition class in the same way as is done for: select, delete, insert, merge, schema, truncate, update and upsert.
If there are other examples of custom implementations of the class Drupal\Core\Database\Query\Condition, please add them here.

Proposed resolution

Change the calling of the Drupal\Core\Database\Query\Condition to the same way as is done for: select, delete, insert, merge, schema, truncate, update and upsert.

User interface changes

none

API changes

Add the method Drupal\Core\Database\Connection::condition().
All code like: new Condition('AND') must change to: Database::getConnection()->condition('AND').

Data model changes

none

When adding a new translation the entity should start from the draft state

$
0
0

Problem/Motivation

  1. Configure a site with two languages
  2. Enable content translation and content moderation for nodes
  3. Create a node in language-1 with the "published" state
  4. Translate to language-2
  5. The current state will be shown as "published", which seems odd because the translation has not been added.

This was discovered in #2915398: The moderation_state field is not computed during the creation of a new entity translation..

Proposed resolution

Use hook_entity_translation_create() to reset the moderation state.

Remaining tasks

Fix tests

User interface changes

API changes

Data model changes

Add a token for publication status

$
0
0

Problem/Motivation

We're using linkit to link to nodes. In the autocompletion we would like to display the status of an item. We can do this using tokens but there's no token for publication status.

Proposed resolution

Add tokens for publication status:

  • [node:status] (0, 1)
  • [node:published_status] (Published, Unpublished)

Nested Paragraphs create multiple drag handles

$
0
0

Problem:

Using nested paragraphs creates multiple drag handles for sub-paragraph field.

What it looks like:
multiple drag handles

Steps to reproduce:
1. Create a new paragraph type (sub paragraph) (can be empty without fields)
2. Create two other paragraphs (main paragraphs) (the other one can be empty without fields)
3. Add a Paragraph field to the other main paragraph and include to sub paragraph in the reference type.
4. Add a Paragraph field to basic page and include the two main paragraphs in the reference type
5. Add a basic page and add there the paragraph type which has the sub field. It shows the three drag handles for the sub paragraph

This seems to be an issue in the Claro tabledrag, which has overriden the core tabledrag, because this doesn't happen with Seven administration theme. It seems that the Claro tabledrag.js is adding some wrappers and other divs to the html so that we end up with 3 drag handles. The problem doesn't come up with any other place in admin UI, but the nested paragraphs use the "multiple drag".

The difference seems to be here:

The output for the Seven admin theme:

<td class="field-multiple-drag">
  <a href="#" class="tabledrag-handle" title="Drag to re-order">
    <div class="handle">&nbsp;</div>
  </a>
</td>

And the output for the Claro theme:

<td class="field-multiple-drag tabledrag-cell tabledrag-cell--only-drag">
  <div class="tabledrag-cell-content js-tabledrag-cell-content">
    <a href="#" class="tabledrag-handle js-tabledrag-handle" title="Drag to re-order"></a>
    <div class="tabledrag-cell-content__item">
      <div class="tabledrag-cell-content js-tabledrag-cell-content">
        <a href="#" class="tabledrag-handle js-tabledrag-handle" title="Drag to re-order"></a>
        <a href="#" class="tabledrag-handle js-tabledrag-handle menu-item__link" title="Drag to re-order"></a>
          <div class="tabledrag-cell-content__item"></div>
      </div>
    </div>
  </div>
</td>

It adds the handle three times.

Missing space between message and link in empty listing view

$
0
0

A very minor thing, I know. There is a space missing on the /admin/structure/block/block-content/ page in the sentence "There are no custom blocks available.Add a custom block."if there aren't any blocks added. Should be a space in between the two sentences.

The two sentences are put together in the core files
/core/modules/block_content/config/optional/views.view.block_content.yml
and
/core/modules/block_content/src/Plugin/views/area/ListingEmpty.php

I'm guessing there should be a better solution than to simply add a "" or a   at the end of the line in views.view.block_content.yml. If there isn't, and someone with better knowledge of Drupal core acknowledges that that is a viable solution, I could make a patch to make the work easier.

The "error" is visible in Drupal 8.7.8 and 8.7.10 as well.

Do not create a new file entity in order to overwrite an existing entity

$
0
0

Problem/Motivation

#2241655: EntityStorageInterface::create() should always create a "new" entity revealed some places where we have very interesting legacy code (and one new one!)

Part of this code can be found in file_copy() and file_save_data(), where a file or entity would always be created created even it already exists.

Proposed resolution

Stop doing that, in any way possible.

Remaining tasks

Find a way

User interface changes

API changes

Contributor tasks needed
TaskNovice task?Contributor instructionsComplete?
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standardsInstructions

Remove all @deprecated code from Drupal/Core/Form/

Remove all @deprecated code for prepareLegacyRequest form core/lib/Drupal/Core/ and from core/tests/Drupal

http user login needs to include the uuid

$
0
0

Problem/Motivation

To do anything with an entity, you need the UUID of it. For users, if the "View user information" is not granted to users then the request /jsonapi/user/user?filter[uid]= will come back empty and there's just no way to get from the (largely useless) uid to uuid as things stand.

Proposed resolution

Just add the uuid to the login response.

Remaining tasks

Agree, commit.

User interface changes

None.

API changes

It's an addition to a JSON reply.

Data model changes

It's an addition to a JSON reply.

Release notes snippet

Separate UI strings touching each other

$
0
0

On /admin/structure/block/block-content page when no custom blocks are available, then the two UI strings touches each other, which is grammatically incorrect. This is because the block_content core module's Views plugin alters the empty listing by concatenating its own plus string in extra. We could provide some separation before this happening.

Properly deprecate the stylesheets-remove key from theme info.yml files.

$
0
0

Problem/Motivation

ActiveTheme::getStyleSheetRemove() was marked as deprecated, but does not trigger a deprecation error.

Proposed resolution

This is a little tricky because the method is still used in core. In 8.0.x we 'deprecated' the stylesheets-remove key in theme info.yml files, but didn't quite know what we were doing. Here we should trigger an error if we detect a theme using that key, and test that the error is triggered. A decision should be made to either undeprecated the getStyleSheetRemove method until drupal 9 when it is no longer used, or to allow an exception to the deprecation policy and mark it deprecated with no trigger errir

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Viewing all 296830 articles
Browse latest View live


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