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

Layout Builder actions are inconvenient to access via keyboard navigation

$
0
0

Problem/Motivation

From #3041143-14: Add ARIA group roles to Layout Builder UI

The Save Layout and Discard Changes buttons are only at the top of the custom layout, which means that the user will have to backwards tab all the way to the beginning of the customizable section in order to save their layout. I would suggest replicating these buttons at the bottom of the customizable layout area, as well, or providing the keyboard user some other means of getting to these buttons quickly once they have reached the final section of their layout.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Add a role=region wrapper to the Layout Builder action form to fix screen reader navigation barriers

$
0
0

Problem/Motivation

In #3004536: Move the Layout Builder UI into an entity form for better integration with other content authoring modules and core features, we converted Layout Builder's confusing local tasks for saving and discarding changes into actual form buttons, which improves the accessibility, usability, and extensibility of the UI. It's important for these to be form buttons so that other modules like Content Moderation can add elements there.

However, with Layout Builder out of the box, there is no other element in this form -- just the buttons. Since there's no other elements in the form, implicit form submission isn't available (e.g. by pressing enter when a radio button has focus). This means a user must locate the submit button.

Per @andrewmacpherson, screen readers will generally have a feature that lists all the buttons on the page, so there is a (somewhat unwieldy) workaround available. For that reason, this issue is a "should" have for #3007978: Accessibility Plan for Layout Builder. As a major accessibility bug, it is eligible for commit in upcoming releases, even if (e.g.) we need to introduce changes to stable templates (although this might also be changes in render arrays instead).

Proposed resolution

A role="region" wrapper. This will include the buttons in landmark region navigation so that they are more discoverable.
This wrapper element MUST also have an accessible name, preferably using a nested heading referenced byaria-labelledby (or aria-label will do as a less-preferable option).
Suggested name: "Layout builder tools".

A FormAPI '#type' => 'container' will probably suffice.

Remaining tasks

TBD

User interface changes

Additional role-region wrapper for the main action form in the Layout Builder UI.

API changes

TBD

Data model changes

None

Release notes snippet

TBD

Stop Using Title Case When Not Appropriate in Layout Builder UI

$
0
0

Problem/Motivation

The Local Tasks and Many of the Links Throughout the Layout Builder UI Use Title Case

Proposed resolution

They should not.

Remaining tasks

Fix it

User interface changes

Yes

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Layout Builder cannot be uninstalled while overrides exist; no easy way to revert all overrides

$
0
0

Problem/Motivation

The uninstall box for Layout Builder is grayed out with the message

The Layout Section field type is used in the following field: node.layout_builder__layout

The "Manage Fields" page shows the Layout field as locked.
The "Manage Display" page says

You must revert all customized layouts of this display before you can disable this option.

Without individually checking each node, there is no way to determine which must be reverted

Proposed resolution

Several options:
1) A page under /admin/reports (linked from Manage Display?) similar to the Field List that shows all overridden layouts, with a revert option (or bulk operation?)

2) A "Revert All" button on Manage Display that works for only that single bundle (probably behind a confirmation form?)

3) ???

Remaining tasks

Decide on an approach

User interface changes

Yes, but TBD

API changes

N/A

Data model changes

N/A

Allow block plugins to determine if they are being previewed

$
0
0

Problem/Motivation

#2992410: Provide placeholders for empty blocks (for example, an empty Views listing) added the ability for blocks to specify a preview fallback string.

However, this is only triggered when the block returned is empty.
There is currently no way for the block to know if it is being previewed.

See #3027593: Empty facet blocks with Layout Builder

Proposed resolution

Allow blocks to retrieve the preview value by context.
As the block.module does not use the concept of preview, this is only needed in Layout Builder at the moment.

Remaining tasks

N/A

User interface changes

API changes

Data model changes

Release notes snippet

Layout Builder's isOverridable()/setOverridable() do not respect the result of isLayoutBuilderEnabled()

$
0
0

Problem/Motivation

\Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay has methods supporting the two checkboxes on "Manage display":
"Use Layout Builder": isLayoutBuilderEnabled()/enableLayoutBuilder()/disableLayoutBuilder()
"Allow each @entity_type to have its layout customized.": isOverridable()/setOverridable($overridable = TRUE)

(Ignore the strangeness of one checkbox having 3 methods and the other having 2 with one taking a bool)

In the UI, the "customized" (overridable) checkbox cannot be checked unless Layout Builder is enabled.
However, that is not enforced on the API level.

Proposed resolution

There are multiple options:

  1. Throw an exception if isLayoutBuilderEnabled() is FALSE when setOverridable() is called with TRUE or if disableLayoutBuilder() is called when isOverridable() is TRUE
  2. Rewrite setOverridable() so that when it is called with TRUE enableLayoutBuilder() is called, and rewrite disableLayoutBuilder() so that when it is called setOverridable(FALSE) is called

#1 is more explicit but may be considered an API break

Remaining tasks

Write tests
Decide on an solution

User interface changes

N/A, this already is enforced in the UI and has test coverage

API changes

Maybe?

Data model changes

N/A

Release notes snippet

N/A

Convert FilterEntityBundleTest into a kernel test

$
0
0

Problem/Motivation

FilterEntityBundleTest makes no HTTP requests but is a functional test

Proposed resolution

Convert FilterEntityBundleTest into a Kernel test

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

Rename $id parameter to $type in SectionStorageManager


Rename SectionStorageTrait to SectionListTrait

$
0
0

Problem/Motivation

\Drupal\layout_builder\SectionListInterface provides methods for manipulating a list of sections.
\Drupal\layout_builder\SectionStorageInterface extends that interface to provide methods to load and persist that list.

\Drupal\layout_builder\Plugin\SectionStorage\SectionStorageBase exists to provide a base class for implementations of SectionStorageInterface

\Drupal\layout_builder\SectionStorage\SectionStorageTrait exists to provide a trait for implementations of SectionListInterface

That name mismatch is rather confusing.

Proposed resolution

Move the code to a new trait named SectionListTrait and empty out and deprecate the old trait, importing/using the new one for BC.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Inline blocks missing section delta extra data on filtered block definitions

$
0
0

Problem/Motivation

It is not possible to filter the inline blocks available for placement by the section to which a block is being added.

#2973615: Add Section delta as extra data on filtered block definitions added the section delta as $extra data on filtered block definitions for non-inline blocks. However, that patch failed to analogously add the section delta for inline blocks. The intent of #2973615 clearly was to affect all blocks (not just non-inline blocks), but that was not the end result so I categorized this as a bug report.

Proposed resolution

Add the delta for inline blocks too.

Remaining tasks

Review patch.

User interface changes

API changes

Data model changes

Back to site link returns user to manage layout for defaults

$
0
0

Problem/Motivation

If you

  1. Manage layout on /admin/structure/types/manage/article/display-layout/default
  2. Save/Cancel layout
  3. Will be redirected to admin/structure/types/manage/article/display/default
  4. Click "Back to site" in the toolbar
  5. This is will take you back to /admin/structure/types/manage/article/display-layout/default😦

This probably because this was the last page you were on using the "default" theme.

You should actually go back to the last page were on before you start admin tasks.

Proposed resolution

Fix it.

Remaining tasks

User interface changes

API changes

Data model changes

Form blocks rendered inside layout builder break save

$
0
0

I can no longer save changes to the layout after any kind of form has been added to the layout.

Steps to reproduce:
1. Enable layout builder on a content type, then open layout builder.
2. Add 'Search Form' block to a section
3. Save the layout
4. Re-open the layout builder, and make some change (e.g. reorder blocks)
5. Attempt to save the layout

The page refreshes, but still shows unsaved changes. At this point, it is no longer possible to save the layout until the search form is removed.

Use queue API for node and comment, user, node multiple deletes

$
0
0

Problem/Motivation

When deleting large datasets the delete multiple API does not invoke all dependent hook_[node|comment|user]_delete.
e.g. deleting a node does not invoke hook_comment_delete()

Proposed resolution

Use the queue API to delete large datasets so we can invoke all hooks.

Remaining tasks

This issue is looking for further direction. Some of the questions/issues are:

  • Does this issue cause problems/confusion for users that are expecting all records to be deleted?
  • Should the user be aware that the operation is happening via queues/cron?
  • If the deletes are happening through the UI, the batch API could process everything. Could the UI create a queue and parse to the batch API to process so you don't have to wait for cron to complete?

User interface changes

When deleting large datasets, you are advised that only a subset of the objects have been deleted and the remaining will been queued to be deleted on cron. A link is shown to run the cron manually if user has permission to "administer site configuration"

API changes

[node|comment|user]_delete_multiple no longer will always delete all items instantly, instead it deletes the the first 20 (or the defined queue threshold number) with the remaining items deleted on cron through a queue.

If the number of items being deleted is less than the queue threshold number, then the current behavior of the system will remain unchanged.

Original report by fajerstarter

Deleting a node that has comments deletes its comments. The problem is that this doesn't initiate hook_comment($op='delete'). Modules using hook_comment need this. This might be the case for Drupal-cvs as well though this hasn't yet been tested.

Cannot Enable "Cache pages for anonymous users"

$
0
0

Hi,

If I check "Cache pages for anonymous users" and hit "Save configuration" the check box resets. There are no error messages in UI, Drupal logs or PHP logs.

I have tried the following.

Adding this line to settings.php
$conf['cache'] = TRUE;

Searching for the following statements in the contrib modules:
drupal_page_is_cacheable(FALSE);
$GLOBALS['conf']['cache'] = 0;
$GLOBALS['conf']['cache'] = CACHE_DISABLED;
$conf['cache'] = FALSE;

Disabling these modules:
- CAPTCHA
- Flag
- Asynchronous Prefetch Database Query Cache
- ThemeKey Redirect

None of those things worked. I do wonder if the Domain Access module might be involved. However, I can't disable that.

Does anyone have any further suggestions how I might identify the source of this problem?

Thank you.

Brett Sh

P.S. have looked on forums & found issues like this and followed suggestions but to no avail.
https://www.drupal.org/project/drupal/issues/2844374

PHP7.1 vendor max Testing issue - DO NOT COMMIT

$
0
0

Problem/Motivation

Since testbot only tests issues with the vendor versions in the composer lock file, we need a way to test against recent vendor updates in order to catch issues like #3039408: Updating twig/twig to v1.38.0 or v1.38.1 causes fatal error and #3039584: The "Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory" class is deprecated since symfony/psr-http-message-bridge 1.2, use PsrHttpFactory instead.. If we enable Symfony 4 support in 8.8, we will need a way to test against that as well

Proposed resolution

Keep an RTBC issue with a patch to run composer update against the codebase prior to running the test suite.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Reference Field -- Sort By settings -- only shows 1 field label from 1 random bundle

$
0
0

Problem/Motivation

Steps to reproduce this issue:

a) Install with the Standard install profile.

b) Go to Admin > Structure > Content Types.

c) Edit the Article content type -- change its name to Recipe and title field label to Recipe name.

d) Edit the Page content type -- change its name to Vendor and title field label to Vendor name.

[Note: This is similar to the content types used as examples in the User Guide.]

e) Now go to the Recipe content type > Manage fields. Add a Vendor reference field. Or alternatively, go to the Vendor content type and add a Recipe reference field. When you get to the field settings page, you'll see that the title sort option in the "Sort by" select list says "Recipe name" in either case (or it might randomly say "Vendor name" in either case -- I've seen it both ways). Anyway, it is very confusing to say "Recipe name" if you are trying to add a Vendor reference field on the Recipe content type. Here is what the sort options look like:
Sort options for reference field

Proposed resolution

Some points to consider for resolving this issue:

  • One field may have multiple different labels across different bundles. The current code is arbitrarily choosing to display one of the labels and ignoring other labels. But in a simple select list, we cannot really show all of the labels -- there could be a LOT, especially for things like Title that are often labeled differently in different content types.
  • The same label may be used on multiple fields. The current code is only displaying the label (ambiguous), not the field machine name (unambiguous). We need to display the machine name too, or perhaps instead of the label.
  • This is a page that is used by site builders, not content editors, so perhaps displaying only the machine name would make sense -- but on some sites that have been around for a while, certain fields get repurposed and relabeled without changing their machine name, so machine names may not be so intuitive either. Also, removing the label would be disruptive for people who are familiar with the current approach. However, when you're adding a field to a content type, if you want to use an existing field, the Field UI module is already only showing the machine name in that dialog.
  • Similar existing UIs in Core:
    (a) Views -- Add Field/Filter/Sort dialog -- gives you the labels and not the machine names. But it has an entire table with wrapping to put lots of information in, not just a select list.
    Field add dialog in Views

    (b) Field UI -- add existing field for -- what you have in the select list is "Field Type Name: field_machine_name". For example, it says "Entity reference: field_test" for one test field I set up. It does not show the label of the field at all, just the label for the field type.

So... here are some conclusions:
1. We want the machine name to be displayed.
2. We want the label to be displayed. But there could be a lot of labels. So, we need to convey that somehow.
3. We probably want the label(s) first, then machine names, to be least disruptive.
4. The list should be sorted alphabetically.

Formatting options

There are several ways we could format the options. Let's consider each option for the following cases:
C1: Title field, where one content type has it as "Recipe name" and another has it as "Vendor name".
C2: Image field field_image, label "Image", which has subfields of alt, target ID, etc. [see comments #21/22]
C3: Field added in Field UI, with machine name field_foo, with label "Foo" on all content types.

Here are 4 possible options for the option labels:

F1: Patch in #23

- C1:
Recipe name|... [title]
- C2:
Image (alt) [field_image.alt]
Image (target_id) [field_image.target_id]
- C3:
Foo [field_foo]

For this one, we have a patch (#23) and a screenshot. Notice that the highlighted item is an example of (C1):
Sort by list with the patch

F2: Use () for the fields

This is not great -- see also comments #21/22.

- C1:
Recipe name|... (title)
- C2:
Image (alt) (field_image.alt)
Image (target_id) (field_image.target_id)
- C3:
Foo (field_foo)

F3: Separate by :

- C1:
Recipe name|...: title
- C2:
Image (alt): field_image.alt
Image (target_id): field_image.target_id
- C3:
Foo: field_foo

F4: Machine name first with :

- C1:
title: Recipe name|...
- C2:
field_image.alt: Image (alt)
field_image.target_id: Image (target_id)
- C3:
field:foo: Foo

Remaining tasks

  1. Decide on which formatting option is best (F1-F4)
  2. Probably make a different patch to implement it (latest patch is F1)
  3. Does it need a test?

User interface changes

Less confusing labels on the choices for sorting reference fields if there are multiple bundles with different field labels for the same field or multiple fields with the same label. In my experience building web sites for clients, the former is pretty common for the Title field, and somewhat column for other fields, and the second is also fairly common.

Also the choices are sorted for better scanning.

API changes

None.

Data model changes

None. Behind the labels, the machine names of the choices do not change, only the UI.

D7 taxonomy term fields are not migrated with allowed vocabularies

$
0
0

Problem/Motivation

On migration from D7, the taxonomy term fields get migrated fine, but they are set to allow all vocabularies, even though that wasn't the case in source.

Proposed resolution

In D7, the allowed vocabularies is a part of field settings which is not available in instance migration, which is where it needs to be in D8. We should add the settings first and then process it during migration.

For all the allowed vocabularies the vid needs to be added to the row so somewhere in the pipeline a migration_lookup can be done to determine the new, migrated vocabulary name.

Remaining tasks

Patch
Review
Testing - patch confirmed to work in #49
Commit

User interface changes

None

API changes

None

Data model changes

None

Migrate D7 i18n taxonomy term language

$
0
0

Problem / motivation

D7 i18n_taxonomy module provides two different taxonomy translation concepts: 'localized terms' and 'translated terms'. In addition to this, there is also a possibility to say that all terms of give vocabulary get a 'fixed language'. See screenshot below on the vocabulary settings that i18n_taxonomy provides.
D7 i18n_taxonomy vocabulary settings

Note that the multilingual capabilities provided by i18n_taxonomy module are different than the D7 Entity Translation module.

In 'localized terms' concept, there is one term entity but the fields (title, description, possible custom fields) of this term can be translated to different languages. In other words, there is just one term ID but several translations of the fields.

In 'translated terms' concept, each language version of the term is a separate term entity with an own term ID and each term has a language code.

Proposed resolution

The scope of this issue is to migrate the language code of the terms from D7 to D8. The language code is stored in taxonomy_term_data.language database column.

Similar migration has already been implemented for migrating the D6 i18n_taxonomy term language codes in #2784371: Migrate D6 i18n taxonomy term translation (but not yet localized translations)

Remaining tasks

1. Patch
2. Review and test
3. Commit

User interface changes

N/A.

API changes

N/A.

Data model changes

N/A.

Add entity bundles condition plugin for entities with bundles

$
0
0

Problem/Motivation

We have node type condition in core \Drupal\node\Plugin\Core\Condition\NodeType. It is specfic to the node types. Drupal 8 has a lot more content entities with bundles and ctools provides EntityBundle condition which allows any bundleable entity to use that condition plugin. Move EntityBundle condition to core and replace it with node type conditon in followup #2914188: Deprecate \Drupal\node\Plugin\Condition\NodeType plugin in favor of \Drupal\Core\Entity\Plugin\Condition\EntityBundle.

Proposed resolution

Moved \Drupal\ctools\Plugin\Condition\EntityBundle to core \Drupal\entity\Plugin\Core\Condition\EntityBundle

Remaining tasks

    Commit

User interface changes

None

API changes

Nothing

node_access filters out accessible nodes when node is left joined

$
0
0

Updated: Comment #334

Problem/Motivation

Currently, when a node table is left joined into a query, adding a node_access tag to the query filters out accessible rows from the base table (effectively acting more like an inner join). In particular, rows containing null values are incorrectly filtered out by node_access (i.e., if the base table has null entries for the node ID, node_access denies access to all users based on those null values, even though they should have no relevance to node_access checks). The most common example is a view where rows disappear from the table after adding an optional relationship to the view.

See the tests in patch #326 to reproduce, or more manually in D7:
1. Install Entityreference and Views,
2. Create a field referencing nodes (using entityreference),
3. Create a node having the entityreference field empty,
4. Create a View with a relationship using the entityreference field. Do NOT select "Require this relationship".
5. Expected result is that regular users can see the node in the View. Current result is that regular users cannot see the node.

Proposed resolution

The problems can be fixed by altering how the node_access conditions are added into the query whenever the node table is a joined table. Currently the conditions are added to the overall query conditions; the proposal is to instead add the node_access conditions into the join conditions.

This approach maintains the integrity of the node_access checks: all nodes to which the current user is denied access are removed from the query results. However, it makes as few additional changes as possible to the query results.

The primary effect is that rows containing optional, empty (null node ID) entries are no longer removed. Furthermore, if rows contain optional (left-joined) content from an access-denied node, only the content of the denied node is removed from the results. In the context of a view, this means that any individual cells of a table containing restricted content will be blanked, but non-restricted content in the rest of the row is still visible to the user.

Adding the node_access conditions into the join conditions is made more difficult by limitations of the database API: #2275519: Unable to use Condition objects with joins. The current patch has opted to add this missing feature to the database API, instead of implementing more complex code that tries to work around the limitation.

Both D8 (#326) and D7 (#332) patches implementing this approach have been provided.

Remaining tasks

  1. Patch needs to be reviewed by the community. Earlier patches (in particular D7) were extensively reviewed, but more feedback on the current patch is needed. Some specific recent questions include:
    1. Is the current patch, which avoids an API change, preferable (see #321)?
    2. Is it appropriate for a bug-fix patch to incorporate code for a requested feature (see #319)?
    3. Are there use cases that cannot be handled by patch #326, and would instead require patch #302? (See also Detailed Example)
  2. Write tests.(Patch #326 contains comprehensive tests, including nested joins and all combinations of accessible and restricted content.)
  3. In Postgres with 3 node tables and a count query, placeholders are getting inserted in the wrong sequence.(This was an issue for patch #149 but was reported as fixed by a subsequent patch. The current D8 patch doesn't edit the placeholders, and has been tested successfully using PostgreSQL.)
  4. Address issue of node access with a type of "entity" -- no known cases where this bug is triggered, recommend creating new issue.(The entity-specific query alterations have been removed in D8, making the issue no longer relevant.

User interface changes

None

API changes

None

Data model changes

None

Detailed example

As an example, a site has 'page' nodes containing a field that is a reference to a related 'article' node. A view is created to list the page nodes: the page title is shown in the first column; the related article's title is shown in the second column (using an optional relationship). The following is the view as seen by an admin. Any node with 'public' in the title is visible to everyone; any node with 'private' in the title should not be visible to regular users.

Case A: admin view
Page titleArticle title
Public-page-1Public-article-a
Public-page-2[none]
Public-page-3Private-article-b
Private-page-4Private-article-c


With current code, the table shown to non-admins incorrectly removes some rows containing public pages:

Case B: public view, unpatched
Page titleArticle title
Public-page-1Public-article-a


With patch #326, regular users will see:

Case C: public view, patched
Page titleArticle title
Public-page-1Public-article-a
Public-page-2[none]
Public-page-3[none]

All private pages and private articles have been filtered out. Public-page-3 is still displayed because it is public content; the reference to private-article-b is in an optional column, implying that unavailable content should result in a blank cell instead of removing the entire row.

Some users may prefer to construct a view where the entire row is removed if it contains a reference to an inaccessible article. In many cases, such views will simply want to change the article column into a required column. If, however, it is necessary to keep rows with missing articles, and only filter rows with inaccessible articles, users can add the appropriate filter into the view, for example, "where article_title is null AND article_reference is not null". This would produce:

Case D: public view, alternate
Page titleArticle title
Public-page-1Public-article-a
Public-page-2[none]

Note that one proposed patch, patch #302, uses a different approach that directly produces Case D, without the need for additional filters. However, using patch #302 it is impossible to produce Case C (except by gutting the node_access checks). In other words, patch #326 can be used to handle all reported use cases, but patch #302 cannot.

Original report by [username]

I'm loving the Entity Reference module, but I've come across some weird behavior. It's probably just something I've missed setting.

I have a content type called Album. I've got another content type called Review which has an entity reference to Album.

I've created a View which lists Albums. I wanted to include some fields from my Review content type, but I still want to list each Album, even if a review referencing the album has not been created yet.

In my view, under Relationships, I add an "Entity Reference: Referencing entity" relationship. I make sure "Require this relationship" is NOT checked.

When I'm logged in as an administrator, all Albums are returned, as expected. But when I'm not logged in, or I'm logged in as a regular user, only albums that are referenced by a review are displayed. I'm really puzzled as to why I get different results depending on my user role.

I get the same results regardless of if I add fields from the Review content type or not. I've tried clearing the cache multiple times, and I've tried checking and unchecking the "Require this relationship" box. I've deleted the relationship and tried adding it again, but I always get the same results.

Viewing all 291923 articles
Browse latest View live