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

Deprecate drupal_get_path() and drupal_get_filename() and replace with ExtensionList::getPath() and ExtensionList::getPathname()

$
0
0

Problem/Motivation

After the completion of the new Extension system API's in #2208429: Extension System, Part III: ExtensionList, ModuleExtensionList and ProfileExtensionList and #2659940: Extension System, Part III: ThemeExtensionList and ThemeEngineExtensionList, drupal_get_path() has been replaced with the theme, module and profile extension listing services. This issue will deprecate the usage of drupal_get_path() in core and replace with the relevant extension listing service calls (Module|Profile|Theme)ExtensionList::getPath().

Proposed resolution

Replace all dynamic uses drupal_get_path() with (Module|Profile|Theme)ExtensionList::getPath(). The earlier issue #2351919: Replace uses of drupal_get_path() with __DIR__ where possible had taken care of static includes where relative location of the files were fixed.

Remaining tasks

Reviews
Commit
Update documentation & related examples like: https://api.drupal.org/api/drupal/core!modules!ckeditor!ckeditor.api.php...

User interface changes

None

API changes

drupal_get_path() is deprecated.


Responsive Image not working in rewritten Views field/area due to XSS filtering

$
0
0

Hi folks

What have I do?
i created a content view with fields and add a normal image field from a normal content type. I set the image formatter to Responsive Image and select a Responsive Image style. After saving, the views shows the image in original size use not the Responsive Image style. But if I go to the Manage display option in the content type area and i select also the Responsive Image in the format settings, the Responsive Image displayed correctly in the default node view. So there the Responsive Image is working properly.

also interesting: if I set the image field in the same views to hidden, and insert a global text field where i put in the image field with {{ field_image }}, the views only shows me the fallback image from the Responsive Image style.

PDO Statements are never created with the connection's PDO options

$
0
0

Problem/Motivation
Drupal\Core\Database\Connection class has a custom prepare method:

public function prepare($statement, array $driver_options = array()) {
    return $this->connection->prepare($statement, $driver_options);
  }

But in prepareQuery it is directly calling the PDO prepare instead of it's custom implementation:

  public function prepareQuery($query) {
    $query = $this->prefixTables($query);

    return $this->connection->prepare($query);
  }

This means that statements are never prepared with the driver options! Also custom database drivers are unable to implement custom Statement classes without overriding prepareQuery to fix this issue.

Proposed resolution

prepareQuery should look like this:

  public function prepareQuery($query) {
    $query = $this->prefixTables($query);

    return $this->prepare($query);
  }

But still we are not passing the ['pdo'] options from the connectionOptions when obtaining the PDO Statement.

Remaining tasks

User interface changes

API changes

[D8 only] Add forwards-compatibility shim for assertEqualsCanonicalizing() in phpunit 6&7

Hitting Enter in Password Field on Update Manager Creates "Change Connection Type" Button

$
0
0

Working with a new Drupal 8 site and installing modules via the "Install from a URL" option.

I don't yet have encryption set up so I get the "You are not using an encrypted connection so your password will be sent in plain text" warning. The only available connection method in the dropdown is FTP.

I enter my username and password but hit "Enter" after putting in my password rather than clicking the Continue button, assuming this was the default.

Instead of installing, the form reloads with a "Change connection type" button under the FTP selection box. If I click the button, the form again reloads as originally presented--no "Change Connection Type" button.

If I enter my username and password and hit Continue instead of the enter key, the form works as expected.

I've included images that show the interface.

How to get feed title in correct language?

$
0
0

In Drupal 8.2 I have rss default feeds on front page and feeds on my views. On the bottom of the pages I can click on the feed icon to open the feed page.

On the feed pages the feed titles are not in the correct language. The feed titles appear always in the language the node was created. And the feed title links to the wrong language.

But I need the correct language for the feed title when switching to another language on my drupal site (/en/..., /fr/...., /de/....) and a correct link.

How can I repair this problem in Drupal 8.2?

Make browser-based tests autofail on PHP errors

$
0
0

Problem/Motivation

Browser-based tests should automatically fail if a page under test has PHP errors, exceptions, warnings, notices, HTTP 500 codes, etc.

Proposed resolution

Add few assertions to methods like drupalGet(), submitForm(), others?

Remaining tasks

For tests which explicitly assert on PHP errors, add some expectation methods to call before asserting in order not to fail.

User interface changes

None.

API changes

TBD.

Data model changes

None.

Release notes snippet

TBD.

Media Library: Default value for data-align attribute should not be center

$
0
0

Currently when embedding media in CKEditor with the Align images filter enabled, the default value for data-align is center. This is too opinionated from a design standpoint, especially when center would be one of the least common choices when embedding media in a text area.

It would make more sense to leave the value empty and let the content creator opt in to media alignment, rather than having to take the extra step to undo the center align value.


\Drupal\migrate\Plugin\MigrateDestinationInterface::fields() $migration argument is deprecated

$
0
0

Problem/Motivation

The $migration argument of \Drupal\migrate\Plugin\MigrateDestinationInterface::fields is

   * @param \Drupal\migrate\Plugin\MigrationInterface $migration
   *   Unused, will be removed before Drupal 9.0.x. Defaults to NULL.

This was added in #2543568: Remove the md_entity destination plugin hack.

Proposed resolution

Work out what to do.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Code execution prevention ineffective when PHP handler set in Apache If directive

$
0
0

The Code execution prevention (in Files directory .htaccess) will not function if the PHP handler is set inside an Apache If directive.

Tested on Drupal version 7.69. Believed to also affect 8.x.

You can see this vulnerability by:
1. Configure Apache to handle PHP using the attached configuration for PHP-FPM. (Note that the If "-f %{REQUEST_FILENAME}" configuration is recommended by https://cwiki.apache.org/confluence/display/HTTPD/PHP-FPM#PHP-FPM-Proxyv... )
2. Install Security Review module and run Security review checklist.
3. Security Review Executable PHP in files directory test will show that execution of PHP files in the files directory is allowed.

This happens because the Apache If directive is merged after the Files * directive in files/.htaccess.

A potential fix is to add an If directive to files/.htaccess. For example see attached potential_fix.txt.

Background information

  • security.drupal.org private issue: https://security.drupal.org/node/171843
    (included for reference. Please do not report access denied as an error.)
  • Conclusion of the Drupal Security Team was that this issue could be made public. The reason is hackers already try to execute files in these directories even on sites where the protection is working. The public knowledge that a site could be vulnerable doesn't actually increase the risk.
  • Credit for helping with the private issue: cilefen, catch, mcdruid

Add support for .FLAC and .AAC audio type of file with HTML 5 audio player

$
0
0

Is it reasonable to ask to add support for .FLAC and .AAC audio type of file with HTML 5 audio player?
Is it scheduled? Does it ask a lot of dev?

the problem i face is that i use mediaelement.js as audio player and i can play flac and aac with it on front end. the problem is that in the backend if i render audio file with the native drupal player audio, the player audio display for mp3, wav and ogg, but dont display for flac and aac. i dont want to use the mediaelement.js in the backend.
screenshot

Convert all get_called_class()/get_class() to static::

$
0
0

Problem/Motivation

We have some left behind get_called_class()and incorrect get_class() calls that there is a keyword static:: that has replaced the need for that call to get the late binding class.

@see https://secure.php.net/get_called_class

Proposed resolution

Replace get_called_class() and incorrect get_class() with static::

API changes

None.

Installing drupal/core-composer-scaffold (9.0.0-beta3) with composer causes 'ErrorException stream_context_create()'

$
0
0

OS: MacOS Catalina 10.15.3
Webserver: Localhost (nginx/1.17.9 from Valet Plus
PHP Version: 7.3.11 (from Valet Plus)
Drupal Version: 9.0.0-beta3

Just tried installing D9 beta3 with Composer using the command composer create-project drupal/recommended-project:9.0.0-beta3 and got the following error:

- Installing drupal/core-composer-scaffold (9.0.0-beta3):

  [ErrorException]
  stream_context_create(): options should have the form ["wrappername"]["optionname"] = $value

The composer installation cannot continue after this.

The installation works as intended if I switch to using beta2.

Composer template ignores core version constraints for profiles

$
0
0

I'm trying to make a simple Drupal installation profile compatible with D9. The project is https://www.drupal.org/project/mandatory.
In the first step I've just added core_version_requirement to the *.info.yml file, in release 8.x-1.3:

name: Mandatory
type: profile
description: 'Build a custom site without any optional components (modules/themes)'
core: 8.x
core_version_requirement: ^8 || ^9

Then I've tried to test this by installing a D9 core:

composer create-project drupal/recommended-project:9.0.0-beta2 .
composer require drupal/mandatory

Result: while create-project worked, requiring the profile failed with multiple composer errors:

...
Using version ^1.3 for drupal/mandatory
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove drupal/core-recommended 9.0.0-beta2
    - Conclusion: don't install drupal/core-recommended 9.0.0-beta2
    - Conclusion: don't install drupal/mandatory 1.3.0
    - Conclusion: remove doctrine/annotations v1.8.0
    - Conclusion: don't install drupal/mandatory 1.3.0|remove drupal/core 9.0.0-beta2|install drupal/core 8.0.0|install drupal/core 8.0.0-beta10|install drupal/core 8.0.0-beta11|install drupal/core 8.0.0-beta12|...

Next thing I tried was restricting core version requirements to >= 8.7.7, in the current dev release:

name: Mandatory
type: profile
description: 'Build a custom site without any optional components (modules/themes)'
core_version_requirement: '^8.7.7 || ^9'

The result was similar:

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove doctrine/annotations v1.8.0
    - Conclusion: don't install doctrine/annotations v1.8.0
    - drupal/core 8.0.0 requires doctrine/annotations 1.2.* -> satisfiable by doctrine/annotations[v1.2.0, v1.2.1, v1.2.2, v1.2.3, v1.2.4, v1.2.5, v1.2.6, v1.2.7].
    - drupal/core 8.0.0-beta10 requires doctrine/annotations 1.2.* -> satisfiable by doctrine/annotations[v1.2.0, v1.2.1, v1.2.2, v1.2.3, v1.2.4, v1.2.5, v1.2.6, v1.2.7].
    - drupal/core 8.0.0-beta11 requires doctrine/annotations 1.2.* -> satisfiable by doctrine/annotations[v1.2.0, v1.2.1, v1.2.2, v1.2.3, v1.2.4, v1.2.5, v1.2.6, v1.2.7].
...

Finally I've added a composer.json file to the project:

{
  "name": "drupal/mandatory",
  "type": "drupal-profile",
  "description": "Build a custom site without any optional components (modules/themes)",
  "license": "GPL-2.0-or-later",
  "homepage": "https://www.drupal.org/project/mandatory",
  "support": {
    "issues": "https://www.drupal.org/project/issues/mandatory",
    "source": "https://cgit.drupalcode.org/mandatory"
  },
  "require": {
    "drupal/core": "^8.7.7 || ^9"
  }
}

Result: same problem.

I've tried the dev version of Drupal 9 core, too. No success.

Now I'm stuck a bit. I have no problems installing ported modules like e.g. Pathauto or Metatag, only this installation profile. Why does Composer try to check old Drupal releases like 8.0.0 given a version constraint of "^8.7.7 || ^9"? And is the Composer template drupal/core-recommended already compatible with Drupal 9? Or did I add a stupid typo? Help appreciated, thanks a lot!

Add benjifisher as a sub-system maintainer for migrate

$
0
0

Benji Fisher has been very active for some time in the migrate issue queue, answering questions in slack and moving things along in that space. He has helped manage and run migrate meetings, and is well versed in the migration sub-system. He has the full support from the migrate maintainers to add him as an official maintainer.


Problem with entityreference revisions field, that resides in field data base table for entity queries.

$
0
0

I see problem with jsonapi query that is caused by Tables.php.
If I create entity reference revision field in custom entity with cardinality 1, it is created in entity table (field data).
In this way it is mapped in Tables.php by ensureEntityTable() method that does not mapps sql_column to real field column and throws exception throw new QueryException("'$property' not found");

For example I created custom entity EntityA and EntityB.
I create a reference revision field entity_b on EntityA to EntityB with cardinality 1 as base field definition.
So when I query in jsonapi with path enitiy_b.id, as filter path this throws error
"title": "Internal Server Error",
"status": "500",
"detail": "'enitiy_b' not found",

Because of we have 2 columns: enitiy_b__target_id and enitiy_b__target_revision_id.
But method ensureEntityTable() does not sees this but only enitiy_b prop.
This problem does not exist for simple entity reference field.

Enable blocks instead of single IP-addresses in UI

$
0
0

The ban module enables you to store single IP-addresses, from which any access of the website will be prevented.
In some cases spammers uses IP-ranges from where they spam contact forms. So it would be nice to have a comfortable opportunity to block IP-ranges or if the usage of wildcards would be supported.

Use NotNull constraint for nullable config schema validation

$
0
0

Problem/Motivation

There are two different ways that a nullable property of a configuration type can be defined, one that uses a custom property name and custom code to evaluate it and one that uses the standard Symfony NotNull constraint.

The first approach uses a boolean 'nullable' property. Example:

# Schema for the entity reference 'default' selection handler settings.
entity_reference_selection.default:
  type: entity_reference_selection
  label: 'Default selection handler settings'
  mapping:
    target_bundles:
      type: sequence
      label: 'types'
      nullable: true

This property is set if the item is optional; if not set, the item is required. If the 'nullable' property is used, validation is done on a custom basis in \Drupal\Core\Config\Schema\SchemaCheckTrait::checkValue().

Second, by adding NotNull to an array of constraints. Example:

system.site:
  type: config_object
  label: 'Site information'
  mapping:
    uuid:
      type: uuid
      label: 'Site UUID'
      constraints:
        Uuid: []
        NotNull: []

If NotNull is used, the item is required, while if its absent it is presumed to be optional (though, in fact, is required because of the handling of 'nullable'). Validation for NotNull is done via a Symfony constraint.

Proposed resolution

Probably most consistent to standardize on NotNull constraint, but doing so would require changes to almost all configuration items, as the default (not nullable) would now require an explicit NotNull constraint.

Alternately, remove the NotNull constraint on UUID in system.site and, maybe, switch to applying NotNull constraint if 'nullable' property is empty in place of current custom validation code.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Keep all sniffs in phpcs.xml.dist in sync with the list got from the locked version of coder

$
0
0

Problem/Motivation

As discussed in #3134731: Update coder to 8.3.9 with @longwave and @jonathan1055, we decided to get phpcs.xml.dist sorted first in #3135933: Sort sniffs/rules in phpcs.xml.dist and write test to keep them sorted. and furthermore in this issue, to write a test to ensure all sniffs (commented out or not) phpcs.xml.dist are in sync with the list got from the locked version of coder.

Proposed resolution

@longwave:

Alternatively: is it possible to say something like

<rule ref="Drupal">
<exclude name="..." />
<exclude name="..." />
<exclude name="..." />
<exclude name="..." />
</rule>

so we only explicitly exclude sniffs we know about? Then when we upgrade Coder and get new sniffs, they automatically apply, and we have to either fix or exclude them?

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Views Exposed Filter Auto Complete "Has taxonomy term" field too wide

$
0
0

In a fresh install of Drupal 8.8.5, when adding an exposed filter using the criteria of "Has taxonomy term", the field is twice as wide as all other fields that are exposed. I have attached images. The default character length in most text based fields is 30 but in "has taxonomy term" it is set at 60. This makes the filter region look like ... you know.

I know I have to find a way to make a sub theme just to fix that one little item, but the more I thought about it is a minor bug and one that is easily fixed in Core.

See attached files

Viewing all 296940 articles
Browse latest View live


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