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

New non translatable field on translatable content throws error

$
0
0

Problem/Motivation

Even when access is denied to a widget, the value submitted propagates to the entity built from the sum of widgets.

Steps to reproduce

Enable at least content translation and content moderation modules and some entity providing module, node is typical. Set Hide non translatable fields on translation forms on the content translation admin form. Create an entity. Now add a nontranslatable field with a non-null default value. Try to add a non-default revision translation of the entity. Kaboom courtesy of EntityUntranslatableFieldsConstraint as the non-null value changes to the default.

Proposed resolution

Don't let widgets pass their values when access is denied to them.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Original report by pavlosdan

We use *Paragraphs + Content Moderation + Translations*. We have a lot of content that is moderated and translated. We've added a new field in one of the paragraphs that did not need to be translatable (it's a checkbox that should be the same across translations) but we noticed that if a user attempts to edit existing published translated content holding said paragraph type prior to the original having a value for that field then the system throws a "Non translatable fields can only be changed when updating the current revision" error.

So far the only workarounds we could think of was to make the field translatable even though it didn't need to be.

Another possibility would be to remove the constraint as suggested here: https://www.drupal.org/project/drupal/issues/2955321#comment-12541730 but we didn't test this.

Your thoughts on this would be greatly appreciated. :)


Allow menu items which link to unpublished nodes to be selected in the parent item selector

$
0
0

Problem/Motivation

I want to be able to create a role in Drupal that doesn't have the permission to bypass node access, but can create, edit, and delete content (including unpublished content) and be able to add menu links to them.

At the moment a user MUST have the bypass node access permission to be able to create a menu link as a child of an unpublished node via the node form

Proposed resolution

Remove the query condition on node status from DefaultMenuLinkTreeManipulators::checkNodeAccess if the user doesn't have the "bypass node access" permission. The query still checks access so should still filter the list for nodes that the user doesn't have access to.

This could be considered a bug as I find it odd that a user is able to create, edit, and delete content and menus/menu items but can't set a parent to an unpublished node that even they created.

ServiceNotFoundException You have requested a non-existent service "language_negotiator" - hook_modules_installed()

$
0
0

Problem/Motivation

Drupal 9.2 issue
In Open Y distribution where profile installation uses a bunch of features to import initial settings we faced with

 In ContainerBuilder.php line 1032:
                                                                              
   [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]  
   You have requested a non-existent service "language_negotiator".  

when installed via drush
Works well on 9.1 and below
Also works well on 9.2.1 when reverted #2160091

Steps to reproduce

See https://www.drupal.org/project/drupal/issues/3222577#comment-14163851

Proposed resolution

Patch, to verify if service exists in hook_modules_installed() before using it

Remaining tasks

Review

User interface changes

No changed

API changes

No changes

Data model changes

No changes

[PP-1] Upgrade filter system to HTML5

$
0
0

This issue is part of #1333730: [Meta] PHP DOM (libxml2) misinterprets HTML5.

The filter system needs to be upgraded to HTML5.

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue priorityMajor because the filter system needs HTML5 support.
Prioritized changesThe main goal of this issue is a bugfix to for HTML5 support, which is part of the Drupal 8 product.

Commit credits
Please give commit credits to all who have worked on the parent issue (#1333730: [Meta] PHP DOM (libxml2) misinterprets HTML5).

Allow end date to be optional

$
0
0

Problem/Motivation

The 7.x Date module allowed the field to has an optional or required end date. D8 requires the end date always.

Proposed resolution

Make end_value in DateRangeItem optional, add validation constraint via configuration.

Remaining tasks

  1. Add tests for formatters (and probably widgets). (See #75.)
  2. Add missing match limit to test code. (See #81.)
  3. If the start date is missing, stop deleting the end date on saving the form. (See #84.)
  4. If missing, indicate that the end date is unknown/unspecified on display. (See #84.)

User interface changes

API changes

Data model changes

Deprecate masterminds/html5 as a production dependency for Drupal 10

$
0
0

Problem/Motivation

@alexpott:

We shouldn't update masterminds/html5 or jcalderonzumba/* - the PhantomJS stuff because it is very fickle with versions and basically unsupported at this point. The html5 library has proved tricky because of the amp project and it's library. See #3040037: Update masterminds/html5 to 2.7.5 for more.

@alexpott:

I’ve just realised something about masterminds/html5 and Drupal 9 - that I think we want to fix prior to RC

  1. It’s a dev only dependency but it is listed in the main deps
  2. Our d9 composer updates have updated it to a version that require a new PHP extension - ctype
  3. Funnily enough we have a polyfill for the extension so nothing is broken if you don’t have the ctype extension - there’s symfony/polyfill-ctype

Proposed resolution

@alexpott:

I think we should move it to a dev dependency and then I’d argue this does not matter

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

The masterminds/html5 is no longer a runtime dependency of Drupal and will not be included in tagged releases. Contributed or custom modules using this package need to add the dependency to their composer.json.

Make the JsWebAssert::waitFor*() methods behave like real assertions

Project Browser Initiative meeting for July 14, 2021

$
0
0

The meeting kicked off roughly on time. It became immediately apparent that without someone from the Association there, we could not enable captioning. We were able to, after the meeting, sync up with someone from the Association (Tim L. / @hestenet) who provided credentials we can use to ensure host abilities are available in the future.

Ron Northcutt started by laying out an agenda. First up was an email from Dries announcing project leadership. Chris Wells (chrisfromredfin) and Ron Northcutt (rlnorthcutt) were assigned as co-initiative leads.

We reviewed the documents that Dries created which clarified goals, audience, and basic approach for the project. The first of these is the Project Brief document, which explains the problem, the audience who the solution should be implemented for, and the approach (as well as leadership structures). That document is here: https://docs.google.com/document/d/1qTimOmoEbqE-abQOu19D2ylvP36zGUvGTCxe...

These documents were created in a working session with Chris Wells, Ron Northcutt, Dries Buytaert, and Danielle Soares, with Dries providing much of the written words. Ron clarified that this document therefore primarily represents Dries's input, and not the entire group's. Though we should adhere to it, it is just that.

With the appointment of Initiative Leads, the discussion on leadership is not over. The general approach is to work out an MVP which uses Matt Grasmick's initial prototype (based off established UI in other projects), as well as coming up with a longer-term vision that iterates from that MVP. We are still looking for leaders in a number of roles that were brought forth from a working session of the Site Builder Sub-Committee.

 initiative leads, two site build leads, two dev leads, document lead, project manager, association liasion, contrib mentor/onboarding

In opening up the meeting to questions, Rajab agreed with the two phases and looks forward to contributing in the areas of coding, documentation, and testing.

Ron mentioned that Matt had made some quick decisions based on current limitations, and people should pull down the current MVP and test it out. Mihaela asked where that was, and we determined Matt was able to secure the "project_browser" namespace at https://drupal.org/project/project_browser - and that the 1.x-dev branch is his prototype. Ron is going to set up a demo site based on Matt's code so installation of a whole stack is not necessary to understand it. The code is also available on Github.

We are hoping to schedule a technical walk-through with Matt G. so he can demonstrate the internals of how the existing prototype is coded.

A concern was raised that there was no research going into the ideas of the prototype. Per Dries's thoughts, there is a huge amount of value that can be added to Drupal by using this with no research, and that is the MVP phase. The research will come as we iterate toward a core-committed version of the Project Browser that represents our second phase.

Mihaela had the question of - is it even possible to present an MVP without addressing the actual data/content of the project pages themselves? Do we need a "sub-initiative" to propose copy edits to project descriptions and screenshots/images using what we have now (perhaps a co-community-lead initiative between Project Browser Initiative and Marketing Initiative?).

Neil Drumm was able to speak up for the Association in response to Ron's comment that we cannot change the Drupal.org API in Phase I, which is actually not necessarily a limitation. We can build something on the current Drupal 7 site that is forward-looking to when Drupal.org (d.o) runs on Drupal 9. This means there IS an opportunity to think about good API design early on. So, there is certainly work to do in this area.

When Chris Wells asked about the timeline for the Drupal 9 upgrade, Neil re-iterated that we shouldn't let that be a blocker for this initiative.

Back to the topic of the actual content/data, Leslie Glynn voiced a concern that more than just the images and project descriptions need some curation, but also the "Category," which is self-selected by module maintainers. For example, AddToAny module (used for social sharing) shows up under the "Commerce" category, which may confuse users looking for add-ons to Drupal Commerce.

As to whether or not we approach these data corrections in Phase I or Phase II - well, that's what we need to decide. We still need to scope the MVP from the list of user stories. So, for next week (July 21), the plan is to review the prototype itself and capture general thoughts on strengths/weaknesses about it.

AmyJune asked about the deliverable / expectation for DrupalCon Europe. Ron thought the best goal was to be able to show some sort of progress on the initiative, be it simple screenshots or something for a presentation, but not necessarily anything super functional. That is, we are not under the wire to get something "done" by that time.


[policy, no patch] Consider moving Quick Edit to contrib

$
0
0

Problem/Motivation

Quick Edit has usability issues, accessibility issues, and several challenges which make it hard to integrate with other parts of core and a number of unresolved bugs.

Technical issues

Maintenance issues

Usability issues

  • The user interactions of QuickEdit are clunky and unfinished, with usability bugs that have not been fixed after many years.
  • QuickEdit is not well-integrated with existing UI patterns from more finished core elements like Layout Builder and CKEditor.
  • The basic use-case - of being able to edit content or configuration via the front end of the website, is already served by contextual links, which while it's not as seamless, is a lot more reliable.

Accessibility issues

Usage

  • The usage data we have on QuickEdit is not necessarily correct. Since the module is in the Standard profile, many site owners probably don't think or know to disable it, but also don't use the feature. In #3158669: By default deprecate non-experimental modules that are used by less 5% of sites before the next major version, QuickEdit has 73.8% usage, which is one of lowest usages of any module in Standard, and less than the usage of Standard itself. This indicates that site owners are actively turning it off. Unlike modules like Comment, which are valuable in Stnadard because useful to many sites but also not appropriate to many sites, QuickEdit should theoretically be used by content authors as much as (e.g.) CKEditor. But it's not.
  • Multiple individuals and Drupal organizations report deliberately never using it in their builds, including:
    • Lullabot
    • 1x

    Proposed resolution

    Move Quick Edit to contrib.

    Remaining tasks

    Find a contrib maintainer.

    User interface changes

    API changes

    Data model changes

    Release notes snippet

Ensure that above-the-fold images are not lazy loaded, to improve Largest Contentful Paint and Cumulatiive Layout Shift score

$
0
0

Problem/Motivation

The 'Core Web Vitals' defined by Google are good, user-centric metrics for the experience of first loading and navigating a site, and are also going to become increasingly relevant to search placement.

One of the downsides to lazy-loading images, is that if you Lazy-Load the primary images 'above the fold' you can actually harm your Largest Contentful Paint and Cumulative Layout Shift behavior.

References & Resources:

Steps to reproduce

  • To do: Determiine if Drupal's current lazy-load implementation suffers from this issue

Proposed resolution

  • Fix it, if it exists! :)

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Release notes snippet

TBD

Let GDToolkit support AVIF image format

$
0
0

Problem/Motivation

AVIF image file format is getting traction in browsers' support.

This issue is proposing to implement support to this image format in Drupal core's GD Toolkit.

Prerequisites:

  • libgd should support the AVIF format - DONE, first release supporting is 2.3.2, released on: March 6, 2021
  • a PHP version supporting an IMAGETYPE_AVIF constant - upstream PR https://github.com/php/php-src/pull/5127
  • a DrupalCI testbot container should be available for testing.

Proposed resolution

Need to decide, once the prerequisites are met, whether to provide conditional support (i.e. the toolkit supports AVIF only when libraries are availble and compiled), or strict support (i.e. libraries are required).

In the #2340699: Let GDToolkit support WEBP image format issue, the second path was taken.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

system_sort_modules_by_info_name() is misnamed

$
0
0

Problem/Motivation

system_sort_modules_by_info_name() is also used to sort themes, and is thus misnamed.

Proposed resolution

Rename the function to system_sort_by_info_name().

Remaining tasks

Discuss whether we should add backwards-compatible, deprecated "wrappers" to help transition to the new function names. See #778346-5: system_sort_modules_by_info_name() is misnamed (which includes a D7 patch using this method) and #1221904: RFC: forwards compatibility in D7 / 'backports' defgroup (for a broader discussion).

If not, the D8 patch can go in by itself.

User interface changes

None.

API changes

system_sort_modules_by_info_name()
will be renamed to:
system_sort_by_info_name()
optionally with backwards-compatible wrappers that make backportable.

Original report by @cwgordon7

system_sort_modules_by_info_name() is also used to sort themes, so perhaps it should be renamed to system_sort_by_info_name()?

Project Browser Initiative meeting for June 23, 2021

$
0
0

High level summary of meeting

TBD

Meeting recording

TBD

Next steps

TBD

Block Name Collision on Theme Creation

$
0
0

Problem/Motivation

During theme initialization, block_theme_initialize() copies over existing blocks and gives them a machine name prefixed with the theme name. It does not check to see if a block exists with this name already.

Proposed resolution

Move the logic in \Drupal\block\BlockForm::getUniqueMachineName to a location where it can be shared with block_theme_initialize.

Remaining tasks

User interface changes

API changes

Data model changes

UrlHelper::encodePath() doesn't support Windows paths

$
0
0

I never used Drupal on windows before but now I just wanted to test my module on clean drupal and found out that I just cant use

drupal_add_js(MY_MODULE_ROOT_REL. '\\js\\somejs.js'); 

// or

drupal_add_js(MY_MODULE_ROOT_REL. '/js/somejs.js');

I defined my custom constants as

/**
 * Define root constant. (An absolute path: /home/var/www/)
 * This is used to prevent using drupal_get_path() cause __DIR__ is much faster and
 * don't use database connection to find out there this module is located.
 * @note requires PHP 5.3+
 */
define('MY_MODULE_ROOT', __DIR__);

/**
 * Relative path to this module (sites/default/....)
 */
define('MY_MODULE_ROOT_REL', str_replace(DRUPAL_ROOT. DIRECTORY_SEPARATOR, '', MY_MODULE_ROOT));

Disclaimer:
I know that Windows is not platform for develop but I think it is not good if Drupal won't work on windows too.
I know about drupal_get_path() but I don't want to use database connection just to find out the path to my module (I use drupal bootstrap_database layer and only include constant.inc files)


Olivero: Normalize JavaScript selectors in messages.es6.js

Admin content view does not display unpublished translations of published nodes when content moderation is enabled

$
0
0

Steps to reproduce:

1. Install Drupal (tested on 8.7.5) in English
2. Enable modules content_moderation, content_translation
3. Add a Language (e.g. German)
4. Enable translations of Article and Editorial Workflow
5. Create a new Article content and set it into published state in default language (English):
6. Add a German translation to the Article content, save it to Draft state
7. Go to /admin/content, see only the English version of the article appears in the List

Expected is that in point 7, admin content view shows English (Published) and German (Unpublished) versions of the article.

Note: If you keep both translations in Draft state, both items properly appear in the admin content view

Side Bug 1: The "moderated content" view properly displays the draft German article, however the "Content Type" column is empty.
Side Bug 2: If you edit the German translation of the Article and change moderation state from Draft to Published, it appears correctly in the admin content view. However, as you change the state of the Article from Published back to Draft, it appears in the admin content view with wrong "Published" state.

[PP-1] Node/comment views-based theme suggestions have no cacheability metadata

$
0
0

Problem/Motivation

See views_theme_suggestions_node_alter(), and views_theme_suggestions_comment_alter(), also the code in views_preprocess_node() and views_preprocess_comment() actually.

That does stuff on $node->view. Which is assigned by views when displaying a node. But there is no cache context for this, can't really be, so it is not cached correctly.

Related to #2528314: template_preprocess_node() does not add cacheability metadata as well.

Proposed resolution

The only thing I can think of is to implement hook_entity_build_defaults_alter() and there, based on the view id and display, define a cache key. The obvious downside is that it results in more cache variations.

I'm also not 100% sure that it is completely accurate then. hook_entity_build_defaults_alter() has some limitations, if dynamic page cache doesn't know about those conditions. But that already has to know about the view/display, if not, you already have a problem.

I think as a long term solution, we should deprecate $node->view and everything that depends on it, but there is no way to make that obvious in something like twig theme suggestions debug output, so people will continue to use it.

Remaining tasks

User interface changes

API changes

Data model changes

Allow deprecating theme suggestions

Drupal 7.82 release notes link to SA-CORE-2021-004 wrong

Viewing all 293211 articles
Browse latest View live


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