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

Base theme classy has not been installed

$
0
0

Problem/Motivation

I'm learning Drupal and reading a book "Handboek Drupal 8" by Maarten de Block.
I followed his instructions on how to custumize a theme.
This does not work because I get an error:
Drupal\Core\Theme\MissingThemeDependencyException: Base theme classy has not been installed. in Drupal\Core\Theme\ThemeInitialization->getActiveThemeByName() (line 122 of core/lib/Drupal/Core/Theme/ThemeInitialization.php)

I know classy is deprecated and a new system is in the make (but not included in 9.2.x).
So classy should still work.

Furthermore I understand that the goal for Drupal 10 is to make Drupal more accessible for novices.
Since there are not many books about Drupal 8 or later, and there is only one book explicitly about theming, and all other books discuss theming by using classy, it is not very helpful if classy was left in a broken state, since there is no alternative at the present, and new books about theming in Drupal 10 might never appear in print...

All this is a very good reason to keep classy in a deprecated state that is still working so novices might get up to speed learning theming.
Furthermore, there is no documentation about how the new system works, nor do I know how to install this new system on top of my current Drupal installation.

Steps to reproduce

In folder /themes/custom/
there is a folder drupalia
In /themes/custom/drupalia is a file drupalia.info.yml.
This file containts the following code:

name: Drupalia
core_version_requirement: ^8 || ^9
type: theme
version: 8.x-0.1.0
base theme: classy
libraries:
  - drupalia/global-styling

In /themes/custom/drupalia is also a file drupalia.libraries.yml.

global-styling:
  version: 1.x
  css:
    base:
      css/global-styling.css: {}

In folder /themes/custom/ is a folder css.
In the folder css is a file called global-styling.css.
This file contains the following code:

body{
  background: #e6f7ff;
}

Go to /appearance and install this theme and make it default.
Go to /structure/block layout.
Drupalia must be selected in the tabs.
Click on "Demonstrate block regions (Drupalia)"

I get this error:
Drupal\Core\Theme\MissingThemeDependencyException: Base theme classy has not been installed. in Drupal\Core\Theme\ThemeInitialization->getActiveThemeByName() (line 122 of core/lib/Drupal/Core/Theme/ThemeInitialization.php)

Proposed resolution

Tell me if I did something wrong (as a sidenote: the changes between Drupal 8 and 9 I found out by using Google...).
Put back what has been removed in the code that is the cause of classy not working anymore.
Keep classy in a deprecated state until enough learning material is available so that novices can learn theming.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Add back support for $form_state->setCached() for GET requests per setting

$
0
0

Problem/Motivation

#2502785: Remove support for $form_state->setCached() for GET requests has removed the support for $form_state->setCached() for GET requests and there are a lot of reasons for doing this and for the most of the use cases it makes perfect sense, however not in our use case where we have a CMS which does not have any open registrations and zero anonymous users and is used only by a specified number of users. The content entity forms which we use might be heavy and expensive to build. Usually in our case in 95 % of the time a user requests an edit form the intention will be to perform some editorial actions and one of the first actions in the most cases will be an ajax request, as our edit forms rely a lot on ajax.

Having said that in our case it will be better to cache the form and the form state on the GET request instead on the first ajax request, as by doing so the form will be built only once on the first ajax request instead of twice as it is currently, as form building is expensive in our system and doing it twice on the first ajax request makes the response time larger.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Claro theme + field_group seems to hide content of dropbutton

$
0
0

Problem/Motivation

When working with the claro theme, I noticed that using a combination of paragraphs, field_group and the claro theme results in not being able to select paragraphs in de dropbutton on the new node and edit node pages.

Steps to reproduce

Install:
paragraphs
field_group
claro (theme)

1. Create a couple of paragraphs (about 3-4)
2. Create a content type with a paragraph reference field. Make it so all paragraphs are selectable.
3. Add a field_group tabs (vertical) and tab.
4. Put the paragraph field created in step 2 under this tab
5. Try to add a page with paragraph 4

Expected to be able to select any item in the dropbutton but some items are hidden in overflow (note that this issue is only at certain widths because of the media rule (@media screen and (min-width: 85em)))

Proposed resolution

I do not know how to fix this. I fixed this locally by removing:

diff --git a/themes/claro/css/components/vertical-tabs.css b/themes/claro/css/components/vertical-tabs.css
old mode 100644
new mode 100755
index 8998a15483..09e8ed83df
--- a/themes/claro/css/components/vertical-tabs.css
+++ b/themes/claro/css/components/vertical-tabs.css
@@ -344,7 +344,6 @@
 
 @media screen and (min-width: 85em) {
   .js .vertical-tabs__item {
-    overflow: hidden;
     margin: 0;
     border: 0;
   }

Remaining tasks

Test the above patch or create a solution

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

Add UI for 'loading' html attribute to images

Optimize migration of specific source IDs for SQL sources

$
0
0

Problem/Motivation

Any time a migration is run, the code loops over every row in the source. There is no way to migrate an individual row, or a few selected rows.

There are some source plugins that cannot support anything better, but any source plugin that extends SqlBase should be able to access individual rows efficiently. There may be other sources that can also do this.

Steps to reproduce

Using drush and the Migrate Tools module, try drush mim my_migration --idlist=123. The migration loops over all rows. If there are enough rows, then this can take a long time.

Proposed resolution

Provide an API that some source plugins can implement, allowing specific rows to be migrated.

Remaining tasks

  • Design an API.
  • Implement the API.

User interface changes

None

API changes

Add an API for selective migrations.

Data model changes

None

Release notes snippet

Original report

The D7 migrate system has a great feature whereby you can import specific IDs, and not have to loop over all IDS in the source query. This is vital for speed when testing a migration and you need to test and entity that has a certain field or odd values. SQLBase should support that by looking for an 'idlist' and altering the source query accordingly. The first user of this feature will be the --idlist option of drush migrate-import (see migrate_plus module).

Deleting a translation leaves behind orphaned revisions

$
0
0

Problem/Motivation

Deleting a translation leaves behind orphaned revisions that can never be retrieved using the UI. The easiest way to describe the problem is to read the steps to reproduce that show the content of the node_field_revision table.

  1. Steps to reproduce:
  2. Install Standard profile in enlgish and enable content_translation module
  3. Add a language (for example French) (admin/config/regional/language)
  4. Enable content translation of article bundles (admin/config/regional/content-language)
  5. Create an English article
    mysql> select nid, vid, langcode from node_field_revision;
    +-----+-----+----------+
    | nid | vid | langcode |
    +-----+-----+----------+
    |   2 |   6 | en       |
    +-----+-----+----------+
    1 row in set (0.00 sec)
    
  6. Edit the edit english article (you now have 2 revisions)
    mysql> select nid, vid, langcode from node_field_revision;
    +-----+-----+----------+
    | nid | vid | langcode |
    +-----+-----+----------+
    |   2 |   6 | en       |
    |   2 |   7 | en       |
    +-----+-----+----------+
    2 rows in set (0.00 sec)
    
  7. Create a french translation
    mysql> select nid, vid, langcode from node_field_revision;
    +-----+-----+----------+
    | nid | vid | langcode |
    +-----+-----+----------+
    |   2 |   8 | fr       |
    |   2 |   6 | en       |
    |   2 |   7 | en       |
    |   2 |   8 | en       |
    +-----+-----+----------+
    4 rows in set (0.01 sec)
    
  8. Edit the english node
    mysql> select nid, vid, langcode from node_field_revision;
    +-----+-----+----------+
    | nid | vid | langcode |
    +-----+-----+----------+
    |   2 |   8 | fr       |
    |   2 |   9 | fr       |
    |   2 |   6 | en       |
    |   2 |   7 | en       |
    |   2 |   8 | en       |
    |   2 |   9 | en       |
    +-----+-----+----------+
    6 rows in set (0.00 sec)
    
  9. Delete the french tranlation
    mysql> select nid, vid, langcode from node_field_revision;
    +-----+-----+----------+
    | nid | vid | langcode |
    +-----+-----+----------+
    |   2 |   8 | fr       |
    |   2 |   6 | en       |
    |   2 |   7 | en       |
    |   2 |   8 | en       |
    |   2 |   9 | en       |
    +-----+-----+----------+
    5 rows in set (0.00 sec)
    
  10. At this point:
    • although we have a row for a french translation the node is showing as untranslated on node/2/translations
    • And on the revisions tab you can only revert to revision 6 & 7.
  11. Hacking the URL to revert to revision 8... does magic and the french translation appears again...
    mysql> select nid, vid, langcode from node_field_revision;
    +-----+-----+----------+
    | nid | vid | langcode |
    +-----+-----+----------+
    |   2 |   8 | fr       |
    |   2 |  10 | fr       |
    |   2 |   6 | en       |
    |   2 |   7 | en       |
    |   2 |   8 | en       |
    |   2 |   9 | en       |
    |   2 |  10 | en       |
    +-----+-----+----------+
    7 rows in set (0.00 sec)
    

We need decide what the expected behaviour should be. i don't think deleting the current translation revision is the expected behaviour. It is a halfway house between removing all revisions that pertain to the translation and just creating a new revision without the translation.

Discovered whilst working on #1239558: Deleting an entity with revisions and file/image field does not release file usage of non-default revisions, causing files to linger.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Uncaught TypeError: Cannot read property 'replace' of undefined

$
0
0

Receiving this error when clicking a button that submits a form in an ajax modal.

Proposed solution:

Adding this.url = ''; to line 402 in core/misc/ajax.js

Not sure if this will cause an issue further down the line but it stops the error from appearing in my console.

Attached are errors and code locations.

Style maintenance page for Olivero


Fix IndexTidDepth views argument plugin and TaxonomyIndexTidDepth views filter plugin performance

$
0
0

Problem/Motivation

This issue is to propose two significant optimizations to \Drupal\taxonomy\Plugin\views\argument\IndexTidDepth and \Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTidDepth.

  • the subselect the code generates is a multi-level left-join which is inefficient on MySQL because it cannot make use of indexes
  • in particular, the left join generates many duplicates
  • it generates a WHERE ... IN ( subselect ) clause, which is inefficient on MySQL if the subselect returns anything but a trivially small result set

Here is the complete query HEAD generates for a single TID query with a depth of 3.

SELECT DISTINCT node_field_data.created AS node_field_data_created, node_field_data.nid AS nid FROM node_field_data node_field_data LEFT JOIN taxonomy_index taxonomy_index ON node_field_data.nid = taxonomy_index.nid LEFT JOIN node__field_promote_states node__field_promote_states ON node_field_data.nid = node__field_promote_states.entity_id AND node__field_promote_states.field_promote_states_value = 'landing' WHERE (((node__field_promote_states.field_promote_states_value IS NULL)) AND (node_field_data.nid IN (SELECT tn.nid AS nid FROM taxonomy_index tn LEFT OUTER JOIN taxonomy_term__parent th ON th.entity_id = tn.tid LEFT OUTER JOIN taxonomy_term__parent th1 ON th.parent_target_id = th1.entity_id WHERE (tn.tid = '353') OR (th1.entity_id = '353')))) AND ((taxonomy_index.status = '1') AND (node_field_data.status = '1') AND (node_field_data.type IN ('article', 'recipe'))) ORDER BY node_field_data_created DESC LIMIT 6 OFFSET 5;
+-------------------------+--------+
| node_field_data_created | nid    |
+-------------------------+--------+
|              1594378800 | 110686 |
|              1594360800 | 110446 |
|              1593946800 | 110321 |
|              1593342000 | 109946 |
|              1593241200 | 109896 |
|              1592823600 | 109591 |
+-------------------------+--------+
6 rows in set (0.49 sec)

Proposed resolution

The patch changes the code in two aspects:

taxonomy hierarchy subselect with union of specific inner joins instead of left join

Existing code

The existing code generates subselect following this pattern (tid 353, +3 levels):

explain SELECT tn.nid AS nid FROM taxonomy_index tn LEFT OUTER JOIN taxonomy_term__parent th ON th.entity_id = tn.tid LEFT OUTER JOIN taxonomy_term__parent th1 ON th.parent_target_id = th1.entity_id LEFT OUTER JOIN taxonomy_term__parent th2 ON th1.parent_target_id = th2.entity_id WHERE (tn.tid = '353') OR (th1.entity_id = '353') OR (th2.entity_id = '353');
+----+-------------+-------+------------+-------+---------------+-----------+---------+------------------------------+--------+----------+--------------------------+
| id | select_type | table | partitions | type  | possible_keys | key       | key_len | ref                          | rows   | filtered | Extra                    |
+----+-------------+-------+------------+-------+---------------+-----------+---------+------------------------------+--------+----------+--------------------------+
|  1 | SIMPLE      | tn    | NULL       | index | term_node     | term_node | 14      | NULL                         | 124367 |   100.00 | Using index              |
|  1 | SIMPLE      | th    | NULL       | ref   | PRIMARY       | PRIMARY   | 4       | instyle.tn.tid               |      1 |   100.00 | NULL                     |
|  1 | SIMPLE      | th1   | NULL       | ref   | PRIMARY       | PRIMARY   | 4       | instyle.th.parent_target_id  |      1 |   100.00 | NULL                     |
|  1 | SIMPLE      | th2   | NULL       | ref   | PRIMARY       | PRIMARY   | 4       | instyle.th1.parent_target_id |      1 |   100.00 | Using where; Using index |
+----+-------------+-------+------------+-------+---------------+-----------+---------+------------------------------+--------+----------+--------------------------+

The code in head has to scan all of the taxonomy_index rows.

New code

The patch generates much more efficient code using a UNION of specific inner joins, the replacement for the example above is:

explain SELECT tn.nid AS nid FROM taxonomy_index tn WHERE tn.tid = '353' UNION SELECT tn.nid AS nid FROM taxonomy_index tn INNER JOIN taxonomy_term__parent th ON tn.tid = th.entity_id INNER JOIN taxonomy_term__parent th1 ON th.parent_target_id = th1.entity_id WHERE th1.entity_id = '353' UNION SELECT tn.nid AS nid FROM taxonomy_index tn INNER JOIN taxonomy_term__parent th ON tn.tid = th.entity_id INNER JOIN taxonomy_term__parent th1 ON th.parent_target_id = th1.entity_id INNER JOIN taxonomy_term__parent th2 ON th1.parent_target_id = th2.entity_id WHERE th2.entity_id = '353';
+----+--------------+--------------+------------+------+--------------------------+------------------+---------+-----------------------+------+----------+--------------------------+
| id | select_type  | table        | partitions | type | possible_keys            | key              | key_len | ref                   | rows | filtered | Extra                    |
+----+--------------+--------------+------------+------+--------------------------+------------------+---------+-----------------------+------+----------+--------------------------+
|  1 | PRIMARY      | tn           | NULL       | ref  | PRIMARY,term_node,bundle | term_node        | 4       | const                 |  102 |   100.00 | Using index              |
|  2 | UNION        | th1          | NULL       | ref  | PRIMARY                  | PRIMARY          | 4       | const                 |    1 |   100.00 | Using index              |
|  2 | UNION        | th           | NULL       | ref  | PRIMARY,parent_target_id | parent_target_id | 4       | const                 |    5 |   100.00 | Using where; Using index |
|  2 | UNION        | tn           | NULL       | ref  | term_node                | term_node        | 4       | instyle.th.entity_id  |   17 |   100.00 | Using index              |
|  3 | UNION        | th2          | NULL       | ref  | PRIMARY                  | PRIMARY          | 4       | const                 |    1 |   100.00 | Using index              |
|  3 | UNION        | th1          | NULL       | ref  | PRIMARY,parent_target_id | parent_target_id | 4       | const                 |    5 |   100.00 | Using where; Using index |
|  3 | UNION        | th           | NULL       | ref  | PRIMARY,parent_target_id | parent_target_id | 4       | instyle.th1.entity_id |  223 |   100.00 | Using index              |
|  3 | UNION        | tn           | NULL       | ref  | term_node                | term_node        | 4       | instyle.th.entity_id  |   17 |   100.00 | Using index              |
| NULL | UNION RESULT | <union1,2,3> | NULL       | ALL  | NULL                     | NULL             | NULL    | NULL                  | NULL |     NULL | Using temporary          |
+----+--------------+--------------+------------+------+--------------------------+------------------+---------+-----------------------+------+----------+--------------------------+

Far fewer rows are scanned and indexes are used.

using an INNER join instead of a WHERE IN (...) for the taxonomy filter

if the outer query constructed by views is inefficient (as can easily be the case with any non-trivial LEFT-join), the query as a whole will still remain inefficient because the efficient subselect is used in a WHERE IN (...) which MySQL only uses as a filter on the outer query result.

This can be made much more efficient by using an INNER join. Here's an example for how the patch will change the SQL (reformatted for readability again)

Existing code + the above fix
SELECT DISTINCT node_field_data.created AS node_field_data_created, node_field_data.nid AS nid FROM node_field_data node_field_data LEFT JOIN taxonomy_index taxonomy_index ON node_field_data.nid = taxonomy_index.nid LEFT JOIN node__field_promote_states node__field_promote_states ON node_field_data.nid = node__field_promote_states.entity_id AND node__field_promote_states.field_promote_states_value = 'landing' WHERE (((node__field_promote_states.field_promote_states_value IS NULL)) AND (node_field_data.nid IN (SELECT tn.nid AS nid FROM taxonomy_index tn WHERE tn.tid = '353' UNION SELECT tn.nid AS nid FROM taxonomy_index tn INNER JOIN taxonomy_term__parent th ON tn.tid = th.entity_id INNER JOIN taxonomy_term__parent th1 ON th.parent_target_id = th1.entity_id WHERE th1.entity_id = '353'))) AND ((taxonomy_index.status = '1') AND (node_field_data.status = '1') AND (node_field_data.type IN ('article', 'recipe'))) ORDER BY node_field_data_created DESC LIMIT 6 OFFSET 5;
+-------------------------+--------+
| node_field_data_created | nid    |
+-------------------------+--------+
|              1594378800 | 110686 |
|              1594360800 | 110446 |
|              1593946800 | 110321 |
|              1593342000 | 109946 |
|              1593241200 | 109896 |
|              1592823600 | 109591 |
+-------------------------+--------+
6 rows in set (0.08 sec)
New code
SELECT DISTINCT node_field_data.created AS node_field_data_created, node_field_data.nid AS nid FROM node_field_data node_field_data LEFT JOIN taxonomy_index taxonomy_index ON node_field_data.nid = taxonomy_index.nid LEFT JOIN node__field_promote_states node__field_promote_states ON node_field_data.nid = node__field_promote_states.entity_id AND node__field_promote_states.field_promote_states_value = 'landing' INNER JOIN (SELECT tn.nid AS nid FROM taxonomy_index tn WHERE tn.tid = '353' UNION SELECT tn.nid AS nid FROM taxonomy_index tn INNER JOIN taxonomy_term__parent th ON tn.tid = th.entity_id INNER JOIN taxonomy_term__parent th1 ON th.parent_target_id = th1.entity_id WHERE th1.entity_id = '353') node_taxonomy_depth ON node_taxonomy_depth.nid = node_field_data.nid WHERE ((node__field_promote_states.field_promote_states_value IS NULL)) AND ((taxonomy_index.status = '1') AND (node_field_data.status = '1') AND (node_field_data.type IN ('article', 'recipe'))) ORDER BY node_field_data_created DESC LIMIT 6 OFFSET 5;
+-------------------------+--------+
| node_field_data_created | nid    |
+-------------------------+--------+
|              1594378800 | 110686 |
|              1594360800 | 110446 |
|              1593946800 | 110321 |
|              1593342000 | 109946 |
|              1593241200 | 109896 |
|              1592823600 | 109591 |
+-------------------------+--------+
6 rows in set (0.01 sec)

EXPLAIN is not so useful for this one because the join via query makes for complicated reading - but you can clearly see the performance improvement when running the query.

Overall gains

Use MySQL profiling we can compare the original query versus the final query...

+----------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Query_ID | Duration   | Query                                                                                                                                                                                                                                                                                                        |
+----------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|        1 | 0.49241525 | SELECT DISTINCT node_field_data.created AS node_field_data_created, node_field_data.nid AS nid FROM node_field_data node_field_data LEFT JOIN taxonomy_index taxonomy_index ON node_field_data.nid = taxonomy_index.nid LEFT JOIN node__field_promote_states node__field_promote_states ON node_field_data.n |
|        2 | 0.00789575 | SELECT DISTINCT node_field_data.created AS node_field_data_created, node_field_data.nid AS nid
FROM
node_field_data node_field_data
LEFT JOIN taxonomy_index taxonomy_index ON node_field_data.nid = taxonomy_index.nid
LEFT JOIN node__field_promote_states node__field_promote_states ON node_field_data.n |
+----------+------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

This shows that original query took 0.49241525 seconds to execute and the new query takes 0.00789575 seconds. This is 98% decrease in the time take to run the query!

Performance testing notes

node_field_data contains 34299 rows
taxonomy_index contains 129814 rows
taxonomy_term__parent contains 6712 rows
node__field_promote_states contains 96159 rows

Remaining tasks

User interface changes

N/a

API changes

N/a

Data model changes

N/a

Release notes snippet

Views that use either the taxonomy depth filter or taxonomy depth argument are massively more performant.

Unpublished book pages get into the html export

$
0
0

Problem/Motivation

With Drupal 9.2 the following patch/issue was resolved:
Make Book navigation translatable

Like I also mentioned in this issue (#241), there were patches with a critical issue: unpublished nodes gets into the export of the book

Steps to reproduce

  1. Create a book content with workflow activated
  2. Publis some nodes and subnodes
  3. Put a node in an unpublished state (e.g. archived)
  4. use the print preview / html export

Proposed resolution

Unpublished nodes should not be part of the html export

Remaining tasks

Create patch

User interface changes

API changes

Data model changes

Release notes snippet

Layout Builder: Configure section icon focus too large in Firefox

$
0
0

Olivero: configure section icon focus breaking in firefox.

Steps to reproduce:

1. edit page by layout builder.
2. focus on configure section icon.

Adding chrome and Firefox screenshots for reference.

Add a #disable_inline_form_errors_summary property to disable the Inline Form Errors summary

$
0
0

Problem/Motivation

In certain cases we want to disable duplicate messages (on top - summary - and inline).
We currently have the #error_no_message property which allowed us to disable errors messages for individual elements.

There may be some field that does not display the inline error, so the message is only visible in the summary. As an example, the Captcha field.
We should then keep the messages in the summary - even when the new property to disable the summary is requested - for fields that contain errors but can't display them inline (Eg. invisible elements, missing elements, ...).

Proposed resolution

Add a form property which can be used to disable IFE summary$form['#disable_inline_form_errors_summary'] = TRUE.
Keep the message in the summary for fields which can't show inline-error (Eg. invisible elements, missing elements, ...).

Completed tasks

Remaining tasks

User interface changes

  • Developers will be able to remove the Summary message when IFE is enable.
  • The summary should still be visible for an element which can't show inline-error (invisible element, missing element, ...).

API changes

The form element will have an optional #disable_inline_form_errors_summary boolean, that if TRUE, disables the duplicate messages from summary & inline-error elements. If one or more elements with errors can't show inline-error (Eg. invisible elements, missing elements, ...) , the summary will remain visible with those messages only.

Olivero: Header menu should not close if menu item has focus

$
0
0

The header menu should not close if an item within the menu has focus

Steps to reproduce:

  1. Tab into the primary menu and open a submenu
  2. Scroll down the page. Note that the header menu will collapse.

Ajax attached to Views exposed filter form does not trigger callbacks

$
0
0

If you try to use #ajax on a Views exposed filter form element, the callback is never invoked. This was discussed at length in the Views issue queue here:

#1183418: Ajax attached to exposed filters in form_alter doesn't trigger callback

The same bug exists in the version of Views in Drupal 8 core. As merlinofchaos wrote:

Views are $_GET forms and they specifically remove the form_id and form_build_id and form_token because they are 'submitted' even when they aren't submitted. That means the standard #ajax tools don't work with them, since those rely on being able to cache the form in core's form cache. That system is to naive to work with core's filters. I've never really tried to do anything like this in D7 yet, so I don't know what the solutions might be, but I can say that it's going to provide very ugly URLs if you hack the form id back in.

The proposed solution is to add a little custom JS magic so that we identify all the form info via after_build callbacks, stash those in JS settings, and then inside the JS, we reattach the relevant form info to the #ajax-enabled form elements so that their callbacks can be properly invoked.

File rest permission issue

$
0
0

Problem/Motivation

Uploading files via rest is not allowed when a user / role DOES have permission for the bundle. The error thrown is below;

Path: /file/upload/node/{bundle}/{field}?_format=hal_json. Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException: in Drupal\file\Plugin\rest\resource\FileUploadResource->validateAndLoadFieldDefinition() (line 443 of /var/www/d9/core/modules/file/src/Plugin/rest/resource/FileUploadResource.php).

A bare-bone Drupal installation does not have "field permissions" unless installing "Field Permissions" module. The way I see it, it is impossible to upload a file for other roles apart from an administrator.

If a role has create/edit permission on the bundle, the field should inherit the bundle permissions.

```

$entity_access_control_handler = $this->entityTypeManager->getAccessControlHandler($entity_type_id);
    $bundle = $this->entityTypeManager->getDefinition($entity_type_id)->hasKey('bundle') ? $bundle : NULL;
    $access_result = $entity_access_control_handler->createAccess($bundle, NULL, [], TRUE)
      ->andIf($entity_access_control_handler->fieldAccess('edit', $field_definition, NULL, NULL, TRUE));
    if (!$access_result->isAllowed()) {
      throw new AccessDeniedHttpException($access_result->getReason());
}

```

Steps to reproduce

Make a post request to "/file/upload/node/{bundle}/{field}?_format=hal_json" as any role apart from administrator.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Olivero: Ensure long words break properly when zoomed in to provide proper reflow

$
0
0

This is split off from #3190262: [META] Assess Olivero for WCAG Resize Text and Reflow success criteria. and is an Olivero stable blocker.

I worked with core accessibility maintainer @bnjmnm on this.

The problem is that long words without spaces can cause horizontal scrolling. This gets more likely as users zoom in using browser controls, and are at narrower viewports.

This is a violation of Success Criterion 1.4.10: Reflow and more information can be found on Allowing for Reflow with Long URLs and Strings of Text.

[META] Make Olivero stable

$
0
0

Problem/Motivation

Olivero was committed in. This META issue is tracking tasks to make it stable and the default theme.

Proposed resolution

Must-have issues for stable release:

Features

Todo: N/A

Done:

Accessibility

Todo:

Done:

Bugs

Todo: N/A

Done:

Technical debt

Todo:

Done:

Should-have issues for stable release / settings as default theme:

Accessibility

Todo:

Done:

Features

Todo:

Design

Done

Bugs

Done

Related Drupal Core Issues

API changes

None.

Data model changes

None.

Release notes snippet

TBD

[META] Assess Olivero for WCAG Resize Text and Reflow success criteria.

$
0
0

(credit for writing this issue summary goes to @andrewmacpherson, as this is largely pasted in from the issue he created here: #3087225: [META] Assess Claro's conformance with WCAG Text spacing, Text resize, and Reflow.

Problem/Motivation

WCAG 2.1 introduced success criterion 1.4.12 Text spacing:

In content implemented using markup languages that support the following text style properties, no loss of content or functionality occurs by setting all of the following and by changing no other style property:

  • Line height (line spacing) to at least 1.5 times the font size;
  • Spacing following paragraphs to at least 2 times the font size;
  • Letter spacing (tracking) to at least 0.12 times the font size;
  • Word spacing to at least 0.16 times the font size.

The Bartik theme pre-dates WCAG 2.1, so addressing this criterion in Olivero is a great way to follow modern accessibility practices.

Note: Olivero doesn't have to use these minimum dimensions in it's own stylesheets. Rather, this is about making sure Olivero doesn't break when someone overrides the author styles with a user stylesheet (e.g. with a browser extension like Stylish).

Note that the word "paragraphs" in WCAG is the general English sense. It doesn't exactly mean the HTML <p> element.

Proposed resolution

Assess Olivero's conformance with WCAG 1.4.12 Text spacing.

Apply the specified spacing dimensions, and see if anything breaks. Before-and-after screenshots are good evidence of testing.

Make child issues to fix any problems found for particular pages or components.

Useful tools

  • Styleguide module.
  • Form Style module. This provides a page which has all core form elements. Press submit, and you them all marked with errors. Works with and without Inline Form Errors module enabled. The module was originally developed for manual testing of the Inline Form Errors module, but it's handy for robustness tests like this too.
  • Dylan Barrell's Text Spacing Bookmarklet. When activated, this adds these brute force CSS rules:
    * {
      line-height: 1.5 !important;
      letter-spacing: 0.12em !important;
      word-spacing: 0.16em !important;
    }
    
    p, li, h1, h2, h3, h4, h5, h6 {
      margin-bottom: 2em !important;
    }
    

    These are the sort of thing someone might put in their user stylesheet.

Note: the bookmarklet doesn't add 2em space after everything that might qualify as a paragraph under WCAG. It will be a good idea to test with 2em after DIV wrappers for things like form errors, form descriptions, and messages.

Background reading

These have examples of the kind of problems which can occur. Content hidden in overflows is a common problem.

Remaining tasks

Complete a first-pass survey of WCAG 1.4.12 Text Spacing. A few full-page screen captures from the styleguide test modules will provide a broad overview of how well the theme performs.

  • Basic typography. A full-page screen capture from the Styleguide module as evidence here.
  • All standard form inputs. A full page screen capture from the Error Style module as evidence here.
  • Inline form errors. Use the Error Style module again.
  • Form descriptions.

Note the bookmarklet doesn't apply the 2em bottom margin to DIVs. Use browser dev tools to add 2em after the form description and inline form error DIVs.

Assess a full range of special components and pages. Include scenarios combining WCAG "Text Resize" and "Reflow" success criteria too.

Components

Special pages

  • Login form
  • Search form
  • More???

Scenarios

  • Test in combination WCAG 1.4.4 Resize text. Set the browser zoom to 200%, then apply the bookmarklet.
  • Test narrow viewports. Suggested approaches:
    • Viewport width somewhere in the middle of the portrait tablet breakpoint range.
    • Viewport width in the mobile breakpoint range.
    • Also 960px window width on desktop. This is a common scenario when using window tiling to half the screen width on (a.k.a. Windows "Snap") on a HD monitor.
    • Test in combination with WCAG 1.4.10 Reflow. Use the bookmarklet in a viewport 1280 CSS pixels wide, at 400% browser zoom (or 960px at 300% zoom).

Next Steps

Waiting on core accessibility maintainer @bnjmnm to confirm and close. I walked through this with @bnjmnm on this and we identified one followup issue (added below).

Followup issues

Taxonomy Term List Save Resorting

$
0
0

Taxonomy Term List sorting bug in 7.56 core.

To reproduce drag and sort some taxonomy terms and SAVE.

Then Alphabetical sort that term list and confirm.

Terms List should now be alphabetical.

Then simply choose SAVE.

Your terms will go from alphabetical ordering to an unpredictable order.

Hover effect while creating image style.

$
0
0

When creating the image style and hover on the anchor instead of hovering over the particular box it is showing a hover effect on the whole row.
Steps to Reproduce

  1. Create new image style
  2. Add Scale and Crop as a style

For example Hovering on A11 Brings hover effect on A12 and A13 also

Viewing all 291852 articles
Browse latest View live


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