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

"Convert line breaks into HTML" filter should exclude <drupal-media> tag

$
0
0

Problem/Motivation

"Convert line breaks into HTML" filter is placing the `drupal-media` tag within a paragraph. It should exclude this tag, as it excludes others, such as `script` and `iframe`.

This is an alternative solution to #3097338: If a filter wraps the drupal-media tag in a paragraph, the edit button breaks, where the currently recommended fix is to fix drupalmedia plugin.js to be more flexible about what it encounters inside the widget wrapper.

This was only discovered now because we failed to test media embedding with the "Convert line breaks into HTML" filter enabled. Now more people are using Drupal 8.8 and are trying out the media embed feature, so they are reporting some configurations we didn't test against when building the feature. The "Convert line breaks into HTML" filter isn't really necessary with CKEditor, but the checkbox to enable it doesn't have that fact clearly displayed.

Proposed resolution

Add the `drupal-media` tag to the list of tags to exclude.

Remaining tasks

review, discuss, commit

User interface changes

API changes

Data model changes

Release notes snippet


@see tags don't use fully qualified class/interface names

$
0
0

On the database.api.php file the @see tags referring to class/interface names don't use a fully qualified class name, as the Drupal coding standards (API documentation and comment standards, classes) says.

Immediately after an @tag (@param, @return, @var, etc.), class and interface names must always include the fully-qualified namespace.

In that file, I found two comments that don't follow that standard.

/**
 * Perform alterations to a structured query.
 *
 * Structured (aka dynamic) queries that have tags associated may be altered by any module
 * before the query is executed.
 *
 * @param $query
 *   A Query object describing the composite parts of a SQL query.
 *
 * @see hook_query_TAG_alter()
 * @see node_query_node_access_alter()
 * @see AlterableInterface
 * @see SelectInterface
 *
 * @ingroup database
 */
/**
 * Perform alterations to a structured query for a given tag.
 *
 * Some common tags include:
 * - 'entity_reference': For queries that return entities that may be referenced
 *   by an entity reference field.
 * - ENTITY_TYPE . '_access': For queries of entities that will be displayed in
 *   a listing (e.g., from Views) and therefore require access control.
 *
 * @param $query
 *   An Query object describing the composite parts of a SQL query.
 *
 * @see hook_query_alter()
 * @see node_query_node_access_alter()
 * @see AlterableInterface
 * @see SelectInterface
 *
 * @ingroup database
 */

The same issue is probably present in more files.

Workspaces should only alter non-deprecated path_alias services

$
0
0

When the workspaces module is already enabled, I can't update core to 8.8.0 and enable path_alias because WorkspacesAliasRepository.php throws an error Error: Class 'Drupal\path_alias\AliasRepository' not found in include() (line 10 of /var/www/html/docroot/core/modules/workspaces/src/WorkspacesAliasRepository.php)

A workaround is:

  1. delete all workspaces in 8.7.x
  2. disable the workspaces module
  3. update core to 8.8.0
  4. enable the path_alias & workspaces modules
  5. re-add workspaces

but that is less than ideal.

does robots.txt file need Disallow: \. to exclude .well-known

$
0
0

With the extensive use of letsencrypt and acme challenges does robots.txt file need Disallow: \. to exclude .well-known directory?

PHP Parse error using composer to install

$
0
0

I've been trying using the instructions at: https://www.drupal.org/docs/develop/using-composer/using-composer-to-ins... to install 8.8 into a working directory to see how it works before I upgrade my 8.7 site to it. I'm also switching to using composer to maintain the site.

I ran the commands from the /var/www/vhosts/mysite.com directory to be installed into /var/www/vhosts/mysite.com/working.mysite.com/.
I CD into the directory and run:

composer create-project drupal/recommended-project working.mysite.com -n

but it's not working. I seem to crash with:

Generating autoload files

PHP Parse error: syntax error, unexpected 'DEFAULT' (T_DEFAULT), expecting identifier (T_STRING) in /var/www/vhosts/mysite.com/working.mysite.com/vendor/drupal/core-composer-scaffold/Operations/OperationData.php on line 15

In the working.mysite.com directory I end up with /vendor and /web for folders. The only two files are composer.json and composer.lock. I checked on the error, and some say it has to do with the php version. I tried it with 7.2 and 7.2 with the same fail each time.

Update normalize.css to the most recent version

$
0
0

Problem/Motivation

Firefox 49 is out and has support for <details> which means our polyfill doesn't kick in. Normalize.css sets <details> and <summary> element as display:block which means Firefox won't display the marker, they fixed this in 5.0.0 (https://github.com/necolas/normalize.css/issues/604).

Checkout comparison aligned by @droplet: (removed comments & unchanged rules, re-reordering to match v3)
https://www.drupal.org/files/issues/diff-manual-aligned-by-%40droplet.patch

Here are the change logs for Normalize.css, starting at 4.0.0 (scroll up): https://github.com/necolas/normalize.css/blob/f06565fe8e0e1ad1b88f273271.... There are a lot of changes due to reorganization/sectioning of the code as well as comment changes.

There is one notable change that causes a regression in, at least, Seven: https://github.com/necolas/normalize.css/commit/02c5c7adbbec1707900fde86..., see the attached screenshot.

There may be regressions upgrading from 3.0.3 to the most recent normalize.css.

Proposed resolution

Upgrade core's Normalize to most recent version.
Normalize 3.0.3 should be copied to Stable. Stable needs to continue using 3.0.3 for BC.

Remaining tasks

  1. Replace normalize with 5.0.0
  2. Determine which removed or changed selectors will cause regression.
  3. Add them back to Stable theme.

User interface changes

Hopefully none!

Node edit - Elements are visually missing

$
0
0

I updated to the latest Drupal core 8.8 and enabled Claro for the admin theme.

When I edit a node, certain elements on the right column are visually missing: menu link, authoring information, scheduling options, and metatags.

It only displays the revision message and URL alias.

The missing elements are rendering in the code, but as vertical tabs instead of accordion items. I have included an image of the rendered code.

Any ideas of why they don't have the correct classes?

It's not an issue when I revert back to the Seven theme.

Create test to aggregator\Form\SettingsForm

$
0
0

Problem/Motivation

The class aggregator\Form\SettingsForm has no kernel tests

Proposed resolution

Create test to aggregator\Form\SettingsForm


[PP-2] Create test for confirming Themes do not depend on Classy templates

$
0
0

Problem/Motivation

As mentioned in #3050389: Remove dependency to Classy from core themes, Classy will be moved to contrib before Drupal 9 and we have to remove dependencies on Classy from all core themes. Part of removing these dependencies includes providing each theme their own copies of templates that previously belonged to Classy.

There's considerable potential for error when copying ~100 templates to four different themes, so we need a test that removes some of the uncertainty from the process.

Proposed resolution

Create a test that confirms that themes do not inherit templates from Classy, and that none of the templates they use include/extend Classy templates or attach Classy libraries.

The test will include a per-theme ignore-list of templates that do not need to be included as part of the test. At first, the ignore-lists will be very large, and will shrink with each template-copying issue filed. When a new template-copying issue is filed (for example, copy aggregator templates to Bartik), the first patch will be this test, but with aggregator's templates removed from Bartik's ignore list. This way, the test won't pass until the templates are properly copied.

Every Classy-inheriting core theme currently extends, includes or attaches something from Classy, so these tests will not pass at first.

Remaining tasks

Write the test, configured it to ignore templates that still need to be copied.

Create issues to address existing attach_library() calls to Classy libraries in Bartik/Seven/Claro/Umami, as these will cause the test created here to fail.

  • Umami calls {{ attach_library('classy/node') }} in node--article--full.html.twig, node--card--common.html.twig, node--card.html.twig, node.html.twig
  • Bartik calls {{ attach_library('classy/node') }} in node.html.twig
  • Claro calls {{ attach_library('classy/file') }} in file-link.html.twig
  • Seven calls {{ attach_library('classy/image-widget') }}in image-widget.html.twig

These library-copying followup issues can't be created until #3096203: Create Classy library dependency tests that can be used for all themes, and verify by providing an Umami-specific classy/dropbutton is complete.

The Claro template include/require's should be addressed in the scope of this issue as this is where the test exists to verify they were done properly. This needs to be addressed with the following:

  • Bartik {% extends ""@classy/block/block--search-form-block.html.twig"" %} in block--search-form-block.html.twig
  • Bartik {% extends "@classy/block/block--system-menu-block.html.twig" %} in block--system-menu-block.html.twig
  • Bartik {% extends "@classy/content/page-title.html.twig" %} in page-title.html.twig
  • Bartik {% extends "@classy/misc/status-messages.html.twig" %} in status-messages.html.twig
  • Seven {% include '@classy/content-edit/image-widget.html.twig' %} in image-widget.html.twig
  • Claro {% extends '@classy/form/form-element-label.html.twig' %} in form-element-label.html.twig

The template copying can't happen until #3095713: Create classy directory with README, in the templates and css directories for all themes subtheming Classy is complete

User interface changes

n/a

API changes

n/a

Data model changes

n/a

Release notes snippet

n/a

Requests that start a session should not be allowed to be cached in page cache

$
0
0

Problem/Motivation

I've been tracking down a bug that happen on a custom page that set some session variables but ended up being cached.

The result was that later users then mananged to get to that page (it's part of a multi-step process) without the session being initialized, leading to errors on the next page.

Pretty sure this is the same in 7.x.

Proposed resolution

Do not treat a page with session data as cacheable?

Remaining tasks

User interface changes

API changes

Data model changes

Deprecate DRUPAL_PHP_FUNCTION_PATTERN and replace its usages

$
0
0

I'm not sure it belongs anywhere. It's only used in two places: by update.module, to look for .info.yml files, and install.inc, to detect... a database driver, of all things.

So I'd suggest removing this one from the patch and filing a separate issue to deprecate and get rid of it entirely. It has two usages that are not even really conceptually related. Seems like a legacy thing.

Invalid .eslintrc.json file in the scaffold fixtures

$
0
0

Problem/Motivation

We are updating eslint as part of #3101543: Update core JavaScript dependencies listed in package.json.

It seems like eslint 5.4.0 introduced .eslintrc overrides, and for that reason, .eslintrc files are being read from subfolders.

There's an invalid .eslintrc.json file in the scaffold fixtures which leads to following error message:

Failed to read JSON file at /Users/lauri.eskola/Projects/drupal/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/fixtures/drupal-assets-fixture/assets/.eslintrc.json.

Proposed resolution

Make the file a valid .eslintrc.json file so that it doesn't lead into an error.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

EditorConfig file lack settings for markdown files

$
0
0

Removing trailing whitespace in markdown files will ruin line breaks.
To fix it the following settings needs to be added to the .editorconfig file:

[*.md]
trim_trailing_whitespace = false

path_alias.info.yml missing required keys (core) InfoParserDynamic.php

$
0
0

After upgrade to drupal 8.8 and
After login and using the admin menu you will get this error:

The website encountered an unexpected error. Please try again later.Drupal\Core\Extension\InfoParserException: Missing required keys (core) in core/modules/path_alias/path_alias.info.yml in Drupal\Core\Extension\InfoParserDynamic->parse() (line 29 of core/lib/Drupal/Core/Extension/InfoParserDynamic.php).

The content of the path_alias.info.yml file:
name: Path alias
type: module
description: 'Provides the API allowing to rename URLs.'
package: Core
version: VERSION
required: true
hidden: true

A new installation works fine with same content of this file but an upgrade returns errors.
How to fix this?

EntityForm's use of magic setter/getter breaks any subclasses that don't declare a property

$
0
0

EntityForm has a magic setter and getter to take care of triggering a deprecation error, eg:

  public function __get($name) {
    // Removing core's usage of ::setEntityManager means that this deprecated
    // service wont be set. We provide it here for backwards compatibility.
    if ($name === 'entityManager') {
      @trigger_error('EntityForm::entityManager is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use EntityForm::entityTypeManager instead. See https://www.drupal.org/node/2549139', E_USER_DEPRECATED);
      return $this->privateEntityManager ?: \Drupal::entityManager();
    }
  }

However, this does nothing when $name is not entityManager. So any form class that does $this->foo = 'bar' without having declared $foo as a class property will suddenly find that setting the value has no effect.

Credit to @aalin to figuring this one at #3093329: $moduleEntityData error in ComponentSectionForm.php.


Drupal 8.x on Postgresql 12

$
0
0

Hi,

Tried to run drupal 8.7 on Postgresql 12beta1.
It does not run, is version 12 supported ?

Regards,

Assert the current path on Views AJAX requests is not set with two leading slashes

$
0
0

In the AJAX request, Views passes the current path (retrieved in views_views_pre_render()) in the page request as the view_path parameter – for example, /admin/content. As nearly everywhere in Drupal 8, a leading slash is included.

However, in \Drupal\views\Controller\ViewAjaxController::ajaxView() there is then the following code dealing with this parameter:

$path = $request->request->get('view_path');
// …
$this->currentPath->setPath('/' . $path, $request);

As you can see, a second slash is prepended to the method argument. When other code then tries to get, e.g., the route match for that request, the router will throw a ResourceNotFoundException with message No routes found for "//admin/content"..
It seems there is normally just no code that does this (or otherwise uses the current path without left-trimming it first) during Views AJAX requests, so this bug could go undetected so far. But it does cause errors in combination with some contrib modules, like Facets.

Remove PHPUnit 4.8 class aliasing BC layer

$
0
0

Problem/Motivation

Drupal core now uses a minimum PHPUnit version of 6.5. We should remove the class aliasing layer which allowed us to have BC for PHPUnit 4.

Proposed resolution

Remove BC PHPUnit class aliasing. Adopt PHPUnit 6.5 as our baseline.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Adding JS/CSS assets in AJAX responses requires 'unsafe-inline' Content Security Policy

$
0
0

Problem/Motivation

The Content Security Policy module needs to add 'unsafe-inline' exceptions for scripts and styles in order to support AJAX responses (#3100068: Script/style included in AJAX responses blocked without 'unsafe-inline').
This is because CSP blocks script and style elements dynamically added to the page by appending HTML, even if their sources comply with the page's policy.
Since AJAX is widely used, this opens a significant gap in the Cross-Site Scripting protections that Content Security Policy offers.

Proposed resolution

- Add a new Drupal\Core\Ajax\CommandInterface() implementation that serializes an array of assets the calling page needs to add.
- Update \Drupal\Core\Ajax\AjaxResponseAttachmentsProcessor::buildAttachmentsCommands() to use the new command instead of rendering the assets to HTML and using an append/prepend command.
- Update Drupal.AjaxCommands with a new method to execute the corresponding command and add assets in a CSP-safe manner (see https://github.com/jquery/jquery/issues/3969).
- Deprecate \Drupal\Core\Ajax\AddCssCommand, which expects a rendered HTML string.

Remaining tasks

User interface changes

None

API changes

Release notes snippet

Missing migration filters that are replaced with filter_null may have invalid settings applied

$
0
0

Problem/Motivation

Whever I try the upgrade, it hangs at 38%. Checking the error log, I see multiple entries with the message "Missing filter plugin: filter_null."

I know that the PHP plugin was enabled on the old site, so not sure if it's related to that. I did try enabling the contrib version of the D8 PHP filter, but php still showed up as a missing dependency, and there was no change in the import.

Proposed resolution

When replacing a filter with filter_null, be sure we are stripping out any settings that may fail a validation check.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

In previous versions of Drupal 8, if a corresponding D8 filter was not found for a D6/D7 filter, it would get mapped to filter_null, but the settings would be retained. This "mixed-mapping" was a bug, which could later lead to configuration schema validation errors. The new behaviour is to instead drop the filter settings, with a message directing users to either re-configure the format by hand, or attempt the migration again with a D8 version of the dropped filter in question.

Viewing all 298712 articles
Browse latest View live


Latest Images

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