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

Fetch "User ID from route context" views' contextual filter for any entity

$
0
0

Currently, we can filter a view based on the current viewed user or node entity's uid.

There is a lot of contribs which define entity classes extending Drupal\Core\Entity\ContentEntityBase class. So, they all have getOwnerId() method. For example, commerce module which has product and stores entities or profile module's profile entity.

Suggestion: allow those entities to use "User ID from route context" contextual filter.


non-standard precision limits at testSchemaAddFieldDefaultInitial

Replace REQUEST_TIME in non-OO and non-module code

$
0
0

Problem/Motivation

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Make methods private in \Drupal\Core\Database\Log because they are going to obsolete

$
0
0

Problem/Motivation

#2867788: Log::findCaller fails to report the correct caller function with non-core drivers. added \Drupal\Core\Database\Log::getDriverNamespace() but this method will exist only until #3112476: Deprecate \Drupal\Core\Database\Database::getDatabaseDriverNamespace as it is no longer needed lands. Therefore lets make it private so we can remove it without breaking anything. As this method and property only exist in 8.9.x this is fine.

Proposed resolution

Do it.

Remaining tasks

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

N/a

Allow modules to alter messages during Node save

$
0
0

Problem/Motivation

In many projects - specifically when entity forms are displayed on front end - default messages from Node module are not relevant to contributors and should not be displayed.

Currently there is no easy way to alter messages displayed after a Node entity was saved.

As a site admin, I want to be able to disable the default "overcomplicated" messages displayed after Node save (currently, something like Article "Title of the article" has been updated).

As a developer, I want to be able to do custom things during Node save - e.g. display custom messages.

Proposed resolution

We should :

- add an option to enable/disable message display on save. Since website can have many different node types, we should add this option on the NodeType entity.
- add the opportunity to developper to alter things during NodeForm::save();. Until Event triggers are implemented in Entity's operations/forms, I suggest to add a custom hook.

Remaining tasks

  • Create a patch
  • Add test for the new NodeType option
  • Add test fot the new hook in NodeSave

User interface changes

New option in NodeType admin form.

API changes

None.

Issues:

Forum post about these messages:

t() calls should be avoided in classes, use dependency injection in action module.

$
0
0

FILE: /var/www/html/drupal_core/core/modules/action/src/ActionListBuilder.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
-----------------------------------------------------------------------------------------------------------------------
90 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
91 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
102 | WARNING | t() calls should be avoided in classes, use \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead

Remove unused variable $next from aggregator module

$
0
0

FILE: /var/www/html/drupal_core/core/modules/aggregator/src/Controller/AggregatorController.php
-----------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------
128 | WARNING | Unused variable $next.

Clarify if hook_node_access() $node argument can or cannot be a string

$
0
0

The documentation for hook_node_access() states that the first argument $node can be NodeInterface object or a string:

\Drupal\node\NodeInterface|string $node: Either a node entity or the machine name of the content type on which to perform the access check.

If this is correct then the function stub provided in node.api.php is incorrect, because it accepts only a NodeInterface argument and will throw an exception if a string is passed:

function hook_node_access(\Drupal\node\NodeInterface $node, $op, \Drupal\Core\Session\AccountInterface $account) {
  $type = $node
    ->bundle();
  // ...
}

This should be changed to check whether $node is an instanceof NodeInterface, and then determine $type accordingly.

Alternatively, if it can only ever be NodeInterface then the documentation is wrong and the part about it being a string should be removed.

I'm happy to make this change but I do not know what the real behaviour is. Can hook_node_access() really be invoked with a string argument? All the contrib modules I have looked at assume that $node will be a Node object because they have copied the example code.


Raise the minimum MySQL version to 5.7 and MariaDB version to 10.2 in Drupal 9

$
0
0

Problem/Motivation

In #3107113: [policy] Decide on MySQL/MariaDB/Percona Server version support status for Drupal 9 the general direction of raising MySQL requirements to 5.7 and MariaDB requirements to 10.2 was agreed on.

Proposed resolution

Raise version requirements.

It was discussed that this may require resolving #2985788: Add a separate MariaDB driver first, but that does not seem to be the case.

Remaining tasks

Raise version requirements.
Update documentation.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

Raised the minimum MySQL version to 5.7 and MariaDB version to 10.2 in Drupal 9.

[meta] Ensure correct button types are used on all pages

$
0
0

Problem/Motivation

There are three types of buttons supported in core and in the Seven style guide. Standard, primary, and danger.
It's important that the correct button types are used consistently throughout Drupal

Remaining tasks

  1. Write UI documentation on when and why to use each button type. Drupal's UI standards page would work for now until #2102191: Discuss the availiable solutions to document the Seven style guide is resolved.
  2. Audit all forms in core, building a list of incorrect button types.
  3. Fix them

Test pages

  • Views modal forms. To reproduce: admin/structure/views/view/content > edit any field
  • Delete a view form. To reproduce: admin/structure/views/view/content/delete. I would suggest to use the "danger" button for the "Delete"/submit action to avoid accidentally deleted views.
  • Edit image styles effects form. To reproduce: admin/config/media/image-styles/manage/xx/add/image_crop.
  • Manage permissions form. To reproduce: admin/people/permissions.
  • Install new theme form / update form. To reproduce: admin/theme/install
  • Extend/modules page. To reproduce: admin/modules

Remove \Drupal\Core\Messenger\LegacyMessenger

$
0
0

The ultimate goal of this issue is to remove \Drupal\Core\Messenger\LegacyMessenger entirely (which is deprecated and scheduled for removal prior to 9.0.0) and solely rely on the Messenger service.

If possible, 3rd party code should use the Messenger service or find alternative solutions that don't involve using this deprecated class.

If there is any 3rd party code that provides a legitimate use case for keeping this around, we may have to re-think how messages work (highly unlikely, but currently a complete unknown).

This is partially due to the fact that the drupal_set_message() and drupal_get_messages() proceedural functions have been around for over 14 years and usage of these functions was heavy throughout core, contrib and 3rd party code alike.

Thus, this issue also serves as a way to track usage of this deprecated class.

Use cases:

  • Drush - Used when creating a new site and the container is not yet initialized. Unclear if this is a hard dependency or its code can be fixed, needs research

Provide theme-development.services.yml to make twig_debug easier

$
0
0

Problem/Motivation

Is there any reason why development.services.yml does not disable TWIG cache by default? Every core update overrides this file with the default one. Themers routinely set those 3 lines, but this is a repetitive task. And the file loads only when settings.local.php is included, so it will not cause any problems on production sites.

Proposed resolution

  1. Create a file at sites/theme-development.services.yml containing the twig.config related lines under the parameters: key:
      twig.config:
        debug: true
        auto_reload: null
        cache: true
    
  2. Reference this new services file in sites/example.settings.local.php, below the line of code where development.services.yml is referenced. Leave the reference commented out with a note explaining the potential dangers and implications of enabling theme debugging.
    /**
     * Enable theme development services.
     *
     * Note: theme debugging can break parts of Drupal. Not recommended in
     * production environments. See https://www.drupal.org/i/2914733
     */
    # $settings['container_yamls'][] = DRUPAL_ROOT . '/sites/theme-development.services.yml';
    

    For the website themer, this code is more or less analogous to adding $config['theme_debug'] = TRUE; option in Drupal 7 settings.php file. Optionally, a CR could be added to describe this difference between D7 / D8.

Fix update XML fixtures bad data

$
0
0

Problem/Motivation

There are various problems with the update xml in core/modules/update/tests/modules/update_test

These problem don't make the test fail but should be fixed

For example

  1. aaa_update_test.8.x-1.2.xml should not have version_* tags
  2. aaa_update_test.1_2-alpha1.xml has a release with both <tag>DRUPAL-8--1-1-alpha1</tag> and <version>8.x-1.2-alpha1</version>
  3. Decide if all releases need core_compatibility

There are probably others.

The doc for this feed is https://www.drupal.org/drupalorg/docs/apis/update-status-xml

Proposed resolution

Identify all problems and fix

Remaining tasks

Patch

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

None

[PP-1] Add logic to figure out the latest/recommended release a site could update to with the currently installed version of core

$
0
0

Problem/Motivation

Both #3102724: Improve usability of core compatibility ranges on available updates report and #3113992: [PP-1] The 'Update' page has no idea that some updates are incompatible would benefit from being able to tell a site admin the latest available update that could be installed, given the current version of core on the site.

For (hypothetical) example (if all the other issues were backported all the way to 8.7.x right now):

  • Site is currently on 8.7.11 core.
  • Site has redis 8.x-1.2 installed.
  • Redis 8.x-1.3 is compatible with 8.7.x
  • Redis 8.x-1.4 is latest/recommended release, but only compatible with 8.8.*

We'll soon have code that detects 8.x-1.4 is not compatible, wants the user, hides download link / update-me checkbox, etc.
But it'd be nice to at least be able to update them to 8.x-1.3 (e.g. via the UI), which would still be compatible with 8.7.x core.

Proposed resolution

Add logic (presumably to core/modules/update/src/ProjectCoreCompatibility.php) to figure this out.

Use this logic to enhance the UI of both the Available updates report (admin/reports/updates) and the update-my-site-via-the-UI form (admin/reports/updates/update) to help site builders make better choices.

Remaining tasks

  1. Decide what to do:
    1. TBD
    2. ...
  2. Land #3102724: Improve usability of core compatibility ranges on available updates report which adds some necessary API this would build on
  3. Implement it
  4. Update / add tests
  5. Reviews
  6. ...

User interface changes

TBD.

API changes

TBD.

Data model changes

Probably none.

Release notes snippet

TBD.

Update module has no tests for changes to status of the installed release (revoked, etc)

$
0
0

Problem/Motivation

Discovered at #3111929-31: If no recommended update is found, Update Status recommends the latest release, even if it is unsupported ... the patch that was already RTBC would have broken this block of code from update.compare.inc:

    // First, if this is the existing release, check a few conditions.
    if ($project_data['existing_version'] === $version) {
      if (isset($release['terms']['Release type']) &&
          in_array('Insecure', $release['terms']['Release type'])) {
        $project_data['status'] = UpdateManagerInterface::NOT_SECURE;
      }
      elseif ($release['status'] == 'unpublished') {
        $project_data['status'] = UpdateManagerInterface::REVOKED;
        if (empty($project_data['extra'])) {
          $project_data['extra'] = [];
        }
        $project_data['extra'][] = [
          'class' => ['release-revoked'],
          'label' => t('Release revoked'),
          'data' => t('Your currently installed release has been revoked, and is no longer available for download. Disabling everything included in this release or upgrading is strongly recommended!'),
        ];
      }
      elseif (isset($release['terms']['Release type']) &&
              in_array('Unsupported', $release['terms']['Release type'])) {
        $project_data['status'] = UpdateManagerInterface::NOT_SUPPORTED;
        if (empty($project_data['extra'])) {
          $project_data['extra'] = [];
        }
        $project_data['extra'][] = [
          'class' => ['release-not-supported'],
          'label' => t('Release not supported'),
          'data' => t('Your currently installed release is now unsupported, and is no longer available for download. Disabling everything included in this release or upgrading is strongly recommended!'),
        ];
      }
    }

% grep -ri revoke core/modules/update/tests is empty. We have no test coverage of the above code block.

Proposed resolution

Add tests.

Remaining tasks

  1. Add tests:
    • NOT_SECURE See #11 and #16
    • REVOKED patch #4
    • NOT_SUPPORTED patch #10
  2. Review.
  3. RTBC.
  4. Commit.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A


Make clear why each XML update.module fixture is created the way it is

$
0
0

Problem/Motivation

#3102724: Improve usability of core compatibility ranges on available updates report and other issues there has been confusion about why certain XML features were made they way they were.

We should make it clear.

Proposed resolution

  1. Add comments to each XML fixture in the update module that makes clear why it's data is the way it is
  2. Add comments to test methods to make clear which fixtures they use and why

They might be additions or better ideas for making this clear.

Remaining tasks

All the tasks

User interface changes

API changes

Data model changes

Release notes snippet

Add a new clean_unique_id Twig filter for Html::getUniqueId

$
0
0

Problem/Motivation

Both \Drupal\Component\Utility\Html::getId and \Drupal\Component\Utility\Html::getClass are available as Twig filters (clean_id and clean_class respectively), but \Drupal\Component\Utility\Html::getUniqueId is not available.

Proposed resolution

Add a clean_unique_id Twig filter that calls back to \Drupal\Component\Utility\Html::getUniqueId.

Release notes snippet

To do.

Add sorting configuration to composer.json

$
0
0

Problem/Motivation

When adding packages doesn't sort them in composer.json.

Proposed resolution

Add sort-packages:true in root composer.json and core/composer.json

Remaining tasks

Add a patch.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

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)

Remove autoloader-suffix from core/composer.json

$
0
0

Problem/Motivation

The core/composer.json file has the following config:

"autoloader-suffix": "Drupal8",

It's not Drupal8 anymore :)

Proposed resolution

The root composer.json has the correct configuration and the one in core/composer.json is never used to build an autoloader so let's remove it from core/composer.json.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Viewing all 292436 articles
Browse latest View live


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