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

Content remains tagged with a taxonomy term (via the {taxonomy_index} table) even after its corresponding term reference field is deleted and purged

$
0
0

Problem/Motivation

Deletion of a taxonomy field from a content type leaves references to affected nodes in taxonomy_index, which results in vocabulary terms remaining attached to those nodes.

Steps to replicate:

  1. Go to admin/structure/taxonomy/tags and add a new term.
  2. Go to admin/structure/types and add a new content type.
  3. On the “Manage fields” tab for the new content type, add a new term reference field using the select widget. Save and select the “tags” vocabulary on the field settings form.
  4. Go to node/add and add a node of the content type created in Step #2. Select the term you added in Step #1 in the field from Step #3 and save.
  5. Go to admin/structure/types and click on the "Manage fields" tab.
  6. Delete the term reference field created in Step #3.
  7. Go to admin/structure/taxonomy/tags and click on the tag created in Step #1.
  8. Observe that the node from Step #4 is still listed, despite that the field containing this term was removed from the content type.

Expected behaviour
You are given the message "If you have any content left in this field, it will be lost. This action cannot be undone." indicating that any tags given to content of this content type will be removed.

Actual behaviour
Content remains tagged with the vocabulary despite not having the field any more. These can be removed by readding the term reference field, removing the tags for the content and then removing the field again.

Proposed resolution

Deleting references by vocabulary is complicated by the potential for data loss if two taxonomy fields on a content type reference the same vocabulary. Proposed resolution is to clear and rebuild taxonomy_index. This may cause slowdown on large sites; suggested that it should run through Queue API.

Remaining tasks

This issue is currently waiting on a patch in #89181: Use queue API for node and comment, user, node multiple deletes.

User interface changes

Warning message noting the potential delay in taxonomy re-indexing and a link to cron for immediate rebuild if desired.


hook_ENTITY_TYPE_translation_delete not called

$
0
0

Problem/Motivation

hook_ENTITY_TYPE_translation_delete not called when an entity is deleted.

Steps to reproduce

To reproduce:

  1. Write a hook_ENTITY_TYPE_delete implementation and put a \Drupal::logger(__FUNCTION__)->notice(__FUNCTION__) inside of it
  2. Write a hook_ENTITY_TYPE_translation_delete implementation and put a \Drupal::logger(__FUNCTION__)->notice(__FUNCTION__) inside of it
  3. Create a node in the site default language
  4. Translate the node into another language
  5. Delete the node in the default language

Expected result:

  1. You see the notice that the node will be deleted in all the languages
  2. You get a log message that shows hook_ENTITY_TYPE_delete was called
  3. You get a log message that shows hook_ENTITY_TYPE_translation_delete was called

Actual result:

  1. You see the notice that the node will be deleted in all the languages
  2. You get a log message that shows hook_ENTITY_TYPE_delete was called
  3. You DO NOT get a log message that shows hook_ENTITY_TYPE_translation_delete was called

Note: If you directly delete a given translation you DO get a log message that shows that hook_ENTITY_TYPE_translation_delete was called.

Proposed resolution

Update hook documentation

Remaining tasks

Patch
Review
Make followup, #17
commit

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

Date FAPI element type do not support #attributes

$
0
0

Problem/Motivation

As a developper, you cannot add custom attributes to your 'date' element via form API without errors being displayed. In other words, this code generates an error:

$form['date'] = [
  '#type' => 'date',
  '#default_value' => date('Y-m-d'),
  '#attributes' => [
    'class' => ['custom']
  ]
];

The result of this is the display of the following error :

Notice: Undefined index: type in Drupal\Core\Render\Element\Date::processDate() (line 62 of core\lib\Drupal\Core\Render\Element\Date.php).

Categorizing

Bug: Because this is an announced feature that does not work well as expected.
Major: Because as per https://www.drupal.org/node/45111 :

  • Trigger a PHP error through the user interface, but only under rare circumstances or affecting only a small percentage of all users, even if there is a workaround.

Config entity get() and set() should invoke getters/setters

$
0
0

Problem/Motivation

Quoting #2016679: Expand Entity Type interfaces to provide methods, protect the properties:

Public properties on our entities allow APIs to be circumvented, and increases the likelihood of introducing bugs because an entity object may not be in a reliable or accurate state. (Additionally, ->something->value is cumbersome DX.)

The result of that issue was:
1) Content entities now have getters and setters which act as wrappers around the get() and set() methods.
2) Config entities now have getters and setters, and don't care about get() and set() at all.

This means that unlike content entities, config entities now have two ways (and code paths) to get or modify a property.
This makes all benefits of the getters and setters moot, since they can be bypassed (and actually are, by CMI, forms, entity_create(), etc).

EDIT: There's also a third way, the constructor, being fixed in #2399999: ConfigEntityBase::__construct() should use set() to populate the values.

For getters, the main benefit is ensuring BC:
- A config entity has first_name and last_name properties, which get deprecated (removed from the forms, kept in schema) in favor of a more generic name property.
The getName() accessor can see if first_name and last_name are available, and use them to construct and return the name. But ->get('name') will bypass that.

For setters, the benefit is data consistency:
Imagine a workflow entity type that has an array of states:

protected $states = array();

public function setStates(array $states) {
  $this->states = $states;
  return $this;
}

This ensures getStates() always returns an array, and the data is always valid. But set('states', 'banana') still works. Sure, it will fail on save when the schema is consulted, but other code has plenty of time to crash until then.

Solution

Change ConfigEntityBase's get() and set() to invoke the getters and setters when found.
The property name is camelized, the method's existence is checked (for first_name we search for getFirstName() and setFirstName()), if found it is used.
Otherwise the old behavior is kept (the property is modified directly).

Fix 'Access to an undefined property' PHPStan L0 errors in test code

Insecure Cookie Attributes configuration

$
0
0

The application uses a cookie The path attribute is '/' as default which exposes Security Misconfiguration vulnerability

Enable the SECURE attribute to disallow the cookie to be sent over an unencrypted channel.
The 'path' attribute signifies the URL or path for which the cookie is valid. The proper scope of the ‘path’ attribute should be set. Example: If the application resides at /myapp/, then set to ""; path=/myapp/"" and NOT ""; path=/"".

CachedStorage::readMultiple uses array_filter instead of strict comparisons

$
0
0

Below is the code for the readMultiple method of the CachedStorage class.

  /**
   * {@inheritdoc}
   */
  public function readMultiple(array $names) {
    $data_to_return = [];

    $cache_keys_map = $this->getCacheKeys($names);
    $cache_keys = array_values($cache_keys_map);
    $cached_list = $this->cache->getMultiple($cache_keys);

    if (!empty($cache_keys)) {
      // $cache_keys_map contains the full $name => $cache_key map, while
      // $cache_keys contains just the $cache_key values that weren't found in
      // the cache.
      // @see \Drupal\Core\Cache\CacheBackendInterface::getMultiple()
      $names_to_get = array_keys(array_intersect($cache_keys_map, $cache_keys));
      $list = $this->storage->readMultiple($names_to_get);
      // Cache configuration objects that were loaded from the storage, cache
      // missing configuration objects as an explicit FALSE.
      $items = [];
      foreach ($names_to_get as $name) {
        $data = isset($list[$name]) ? $list[$name] : FALSE;
        $data_to_return[$name] = $data;
        $items[$cache_keys_map[$name]] = ['data' => $data];
      }

      $this->cache->setMultiple($items);
    }

    // Add the configuration objects from the cache to the list.
    $cache_keys_inverse_map = array_flip($cache_keys_map);
    foreach ($cached_list as $cache_key => $cache) {
      $name = $cache_keys_inverse_map[$cache_key];
      $data_to_return[$name] = $cache->data;
    }

    // Ensure that only existing configuration objects are returned, filter out
    // cached information about missing objects.
    return array_filter($data_to_return);
  }

As you can see, it filters out "missing objects". Except it also filters out objects where the data, the valid data, simply evaluates to false as well.
And, naturally, also valid data that just actually IS false.

I'd like to know why? A few lines above, all configuration names that aren't present in the return from $this->storage->readMultiple() is set to FALSE. Fair enough. But shouldn't the array_filter be replaced with a strict evaluation to FALSE then? So that it doesn't throw out empty arrays and empty strings and 0, etc etc? You may say "but we don't support configuration without any keys" except you do. Language collections are full of empty arrays. Empty arrays for days.

Moreover, the read method doesn't filter anything. If read finds an empty array, it'll return an empty array. Unless, of course, readMultiple was called earlier and has cached the lie that the empty array is actually FALSE. This happens because CachedStorage wraps itself before wrapping DatabaseStorage or FileStorage. So the first time, the result, including empty arrays, are cached by $this->cache->setMultiple($items). But then it array_filters, and returns to itself. Suddenly, the empty arrays of before are turned into FALSEs. And those values are then cached. And those values are returned by a later call to read.

The fact that read() can have a different value based on whether readMultiple was called earlier or not is cause for concern. Disabling the cache gets in this class can return wholly different results. That can't be right. A cache can't transform the data it's saving.

This came to light when, using Config Filter, and specifically Config Ignore, I discovered it didn't ignore config translations. There were a bunch of items, and they kept popping up as "Changed". Because CachedStorage->FilteredStorage->DatabaseStorage returns an empty array (which is the actual, correct value also present in the database) but CachedStorage->CachedStorage->DatabaseStorage returns boolean FALSE due to its array_filtering and recursive nature (and caching of the boolean).

Adding an array_filter to FilteredStorage::readMultiple fixes it, but to me that just feels like breaking FilteredStorage instead of fixing CachedStorage.

Finalise the name for Drupal recipes

$
0
0

Problem/Motivation

Drupal recipes allow the automation of Drupal module install and configuration via the user interface and via the Drupal recipe composer plugin.

A Drupal recipe is a tool for Site Builders and Developers to add functionality to a Drupal site. It is like a recipe that provides a series of steps to add functionality. These steps could be taken manually to arrive at the same point. For example, I might want to provide a blog recipe that configures modules to provide a great blogging experience and creates a few sample posts. Or it can include a number of other starter templates and modules to build a full site experience. Ideally Drupal recipes would not configure an entire site themselves but would break out their functionality into smaller starter templates that can be reused by other Drupal recipes.

Drupal recipes are:

  • Applied to Drupal sites, they are not installed.
  • Easy to share
  • Do not lock sites in
  • Composible from other Drupal recipes

Proposed resolution

Maybe "Drupal recipe" is not the best name. In Dries's recent keynote they were called Starter templates. Starter template as a name has been dropped because It potentially clashes with starterkit themes. To some people "starter" suggests something that can only be used during install. Template is a word that clashes with HTML and twig templates.

Drupal recipe has some current usages: Lando, DrupalRecipes project (the ​​Fox Valley Drupal group has no issues with core's usage).

Other potential suggestions have been:

  • Starter template
  • Feature template or Feature builder
  • Component template or Component builder
  • Drupal build recipe
  • Site Recipes
  • Feature starter templates

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Remove usages of the JavaScript ES6 build step

datetime date views filter: DateTime object not set

$
0
0

Problem/Motivation

Using datetime views filter and filtering with an invalid date, there is no validation and fatal error occured.

To reproduce:

  • Add a datetime field in an entity bundle.
  • Create a view to list this entities and add a filter on this datetime field
  • Search for a date with wrong format or for example day in french: lun 2018-04-27. The following error occur:
    <em class="placeholder">Exception</em>: DateTime object not set. in <em class="placeholder">Drupal\Component\Datetime\DateTimePlus-&gt;__call()</em> (line <em class="placeholder">355</em> of <em class="placeholder">core/lib/Drupal/Component/Datetime/DateTimePlus.php</em>). <pre class="backtrace">Drupal\datetime\Plugin\views\filter\Date-&gt;opSimple(&#039;sesame_quota_option__field_sesame_opt_date.field_sesame_opt_date_value&#039;) (Line: 314)
    Drupal\views\Plugin\views\filter\NumericFilter-&gt;query() (Line: 1370)
    Drupal\views\ViewExecutable-&gt;_build(&#039;filter&#039;) (Line: 1259)
    Drupal\views\ViewExecutable-&gt;build() (Line: 390)
    Drupal\views\Plugin\views\display\PathPluginBase-&gt;execute() (Line: 180)
    Drupal\views\Plugin\views\display\Page-&gt;execute() (Line: 1627)
    Drupal\views\ViewExecutable-&gt;executeDisplay(&#039;page_1&#039;, Array) (Line: 77)
    Drupal\views\Element\View::preRenderViewElement(Array)
    call_user_func(Array, Array) (Line: 378)
    Drupal\Core\Render\Renderer-&gt;doRender(Array, ) (Line: 195)
    Drupal\Core\Render\Renderer-&gt;render(Array, ) (Line: 226)
    Drupal\Core\Render\MainContent\HtmlRenderer-&gt;Drupal\Core\Render\MainContent\{closure}() (Line: 582)
    Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 227)
    Drupal\Core\Render\MainContent\HtmlRenderer-&gt;prepare(Array, Object, Object) (Line: 117)
    Drupal\Core\Render\MainContent\HtmlRenderer-&gt;renderResponse(Array, Object, Object) (Line: 90)
    Drupal\Core\EventSubscriber\MainContentViewSubscriber-&gt;onViewRenderArray(Object, &#039;kernel.view&#039;, Object) (Line: 76)
    Drupal\webprofiler\EventDispatcher\TraceableEventDispatcher-&gt;dispatch(&#039;kernel.view&#039;, Object) (Line: 156)
    Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
    Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
    Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
    Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
    Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 38)
    Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware-&gt;handle(Object, 1, 1) (Line: 50)
    Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
    Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 664)
    Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
  • Search for the same date with day in english works: mon 2018-04-27. Same for date only: 2018-04-27

Proposed resolution

Mimic the date filter validation from views module.

Remaining tasks

  1. Add tests
  2. Review

locale_translation_build_projects() function comment is outdated

$
0
0

Problem/Motivation

https://git.drupalcode.org/project/drupal/-/blob/9.5.x/core/modules/loca...

See http://drupalcode.org/project/drupalorg.git/blob/refs/heads/7.x-3.x:/drupalorg_project/plugins/release_packager/DrupalorgProjectPackageRelease.class.php#l219

This url has been changed, the class file is here currently:

https://git.drupalcode.org/project/drupalorg/-/blob/7.x-3.x/drupalorg_project/plugins/release_packager/DrupalorgProjectPackageRelease.class.php

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Configuration langcode is forced to site default language

$
0
0

Problem/Motivation

In #2212069: Non-English Drupal sites get default configuration in English, edited in English, originals not actually used if translated, the function locale_system_set_config_langcodes() was introduced in locale.module. This function is called whenever a module (hook_modules_installed()) or theme (hook_themes_installed()) is installed, and it forces the language of configuration to be set to the site default language.

My case is that we have a multi-site (shared codebase, separate databases). Some of these sites have English as default language, many of them have some other language as the default. English language is still enabled on all sites. Currently, each site has its full configuration exported to /config/<site name>. As the sites mostly consist of the same set of features, a lot of the configs are just duplicates.

Our plan is to start combining all of the common config using the config_split module, in order to reduce duplicate config files. Due to this, we want to keep the configuration language as English, since otherwise it would become really hard to start combining those.

We currently have the configuration language as English for all configs, but whenever a module gets installed, the behaviour of locale module causes the configuration language to change, which we would not want.

Another factor is that when we are developing the sites, for example creating new fields and such, we want to do the development in English as we don't necessarily speak all of the languages that the multi-site uses. Example: If I were to create a new field to example.no, I want to enter the field label in English and not in Norwegian. The same config would then be used also in example.se and example.fi, and the field label would be translated on each site via the Translate Interface tool.

Proposed resolution

I came up with three different approaches:

  1. Defining our own implementations of hook_modules/themes_installed(), make sure that they are called after locale modules hooks, and then call our own helper function, which reverses the logic of what locale_system_set_config_langcodes() does
  2. Defining our own implementations of hook_modules/themes_installed(), make them be run instead of locale modules hooks, and make them be identical with locale modules hooks with the difference that they don't call locale_system_set_config_langcodes()
  3. Patching the locale module and remove the body of the locale_system_set_config_langcodes() function

Approach 1:


use Drupal\locale\Locale;

/**
 * @file
 * My module.
 *
 * We have multiple different sites and most of them have a non-English default
 * language. Currently the sites have their own configs exported to their own
 * directories, but we aim towards combining all of the common config using
 * config_split. Therefore we want to keep all of the configs in English.
 *
 * The locale module implements hook_modules_installed() and
 * hook_themes_installed(). Both implementations call
 * locale_system_set_config_langcodes(), which will force the langcode of all
 * config files to be set to the site's default language.
 *
 * In this module we implement the same hooks and then call our own function,
 * which basically reverses what locale module does.
 *
 * We also make sure our hooks are implemented after local module's hooks.
 */

/**
 * Implements hook_module_implements_alter().
 */
function mymodule_module_implements_alter(&$implementations, $hook) {
  if ($hook === 'modules_installed' || $hook === 'themes_installed') {
    // Move this module's hook's to be run immediately after the locale
    // module's hooks, since our code fixes configuration langcodes issues that
    // locale messes up.
    // The code below removes 'mymodule' from which ever position it
    // currently is in, finds the position of 'locale', and inserts
    // 'mymodule' immediately after it.
    $group = $implementations['mymodule'];
    unset($implementations['mymodule']);
    $local_position = array_search('locale', array_keys($implementations)) + 1;
    // Slice 1 contains all elements from the start to 'locale'.
    $slice1 = array_slice($implementations, 0, $local_position);
    // Slice 2 contains all elements that are after 'locale'.
    $slice2 = array_slice($implementations, $local_position);
    // Insert 'mymodule' so it's directly after 'locale'.
    $slice1['mymodule'] = $group;
    // Merge slices back together.
    $implementations = array_merge($slice1, $slice2);
  }
}

/**
 * Implements hook_modules_installed().
 */
function mymodule_modules_installed($modules) {
  mymodule_set_config_langcodes();
}

/**
 * Implements hook_themes_installed().
 */
function mymodule_themes_installed($theme_list) {
  mymodule_set_config_langcodes();
}

/**
 * Updates configuration langcodes to English.
 *
 * Basically this reverts what locale_system_set_config_langcodes() does, since
 * we want config langcodes to be in English.
 */
function mymodule_set_config_langcodes() {
  $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId();
  if ($default_langcode !== 'en') {
    $names = Locale::config()->getComponentNames();
    foreach ($names as $name) {
      $config = \Drupal::configFactory()->reset($name)->getEditable($name);
      if (!$config->isNew()) {
        $langcode = $config->get('langcode');
        if ($langcode === $default_langcode) {
          $config->set('langcode', 'en')->save();
        }
      }
    }
  }
}

Approach 2:


use Drupal\locale\Locale;

/**
 * @file
 * My module.
 *
 * We have multiple different sites and most of them have a non-English default
 * language. Currently the sites have their own configs exported to their own
 * directories, but we aim towards combining all of the common config using
 * config_split. Therefore we want to keep all of the configs in English.
 *
 * The locale module implements hook_modules_installed() and
 * hook_themes_installed(). Both implementations call
 * locale_system_set_config_langcodes(), which will force the langcode of all
 * config files to be set to the site's default language.
 *
 * In this module we implement the same hooks and use them INSTEAD of locale's
 * hooks. They are identical with the original hooks but with the callback to
 * locale_system_set_config_langcodes() removed.
 *
 * We use hook_module_implements_alter() to remove the original hooks.
 */

/**
 * Implements hook_module_implements_alter().
 */
function mymodule_config_module_implements_alter(&$implementations, $hook) {
  if ($hook === 'modules_installed' || $hook === 'themes_installed') {
    unset($implementations['locale']);
  }
}

/**
 * Implements hook_modules_installed().
 *
 * @see locale_modules_installed()
 */
function mymodule_config_modules_installed($modules) {
  $components['module'] = $modules;
  locale_system_update($components);
}

/**
 * Implements hook_themes_installed().
 *
 * @see locale_themes_installed()
 */
function mymodule_config_themes_installed($themes) {
  $components['theme'] = $themes;
  locale_system_update($components);
}

Approach 3:

See attached patch and apply it using composer.
This approach allows us to notice if locale.module is changed by a core update, since the patch would probably not apply anymore.

I can only assume that others have also faced similar problems as what I've described here. Even though I understand that this is the intended behaviour of Drupal core and of the locale module, it just doesn't fit our needs at the moment, which is why I posted some different approaches here for those who are interested.

Add #element_submit and #limit_element_submit just like #element_validate and #limit_validation_errors

$
0
0

Problem/Motivation

For certain usecases, especially embeddded forms inside forms, you want to fire submit handlers similar to the way validation can be done on every element.

Proposed resolution

A typical usecase if inline entity forms. You have a form with multiple subentity forms in there. For each, you want to be able to have an easy way to just submit one of the entities inside. #element_submit allows you to do that.

On top of that, once you have more than one subform for example, you also want to be able to limit the possible elements you want to submit. Just think of a form with two embedded entity forms, each with its own submit button. On every Submit button, you want to just validate and submit their corresponding form elements. Therefore this patch introduces #limit_element_submit, similar to #limit_validation_errors.

Remaining tasks

User interface changes

None

API changes

Two new FAPI Element properties
#element_submit
#limit_element_submit

Data model changes

None

Pass current route parameters to the confirmation form route

$
0
0

Currently, a blank parameters array is passed into $form_state->setRedirect(), which doesn't allow dynamic routes.

Getting raw parameters from RouteMatch will allow dynamic routes and at the same time does not affect routes without required parameters.

Allow media items to be edited in a modal when using the field widget

$
0
0

Problem/Motivation

In #2962525: Create a field widget for the Media library module, the media edit/view link was disabled in the field widget and widget view in order to prevent unintended data loss. Long term, we would still like the ability to quickly edit media items from the field widget, without navigating to a new page.

Proposed resolution

Allow media items to be edited in a modal while using the field widget. The Entity Browser module allows for similar functionality.

This has some major UX and possibly a11y implications, since it needs to be crystal clear to users that, if they edit a media item in the library, they are editing that item everywhere it appears.

Remaining tasks

  • Write a patch
  • Write automated tests
  • Get sign-off from the usability team
  • Get accessibility review and sign-off
  • Review code
  • Commit!

User interface changes

Undecided.

API changes

None.

Data model changes

None.


Add the container parameter asynchronous

$
0
0

Problem/Motivation

The Swoole PHP Server runs Drupal in CLI mode, instead of the regular mode which is used by Apache or NginX. The Swoole module for Drupal needs to know when the Swoole PHP server is used. For instance session handling is different and cookies need to be set in a special way with the Swoole PHP Server.

Proposed resolution

Add a new container parameter "asynchronous", which defaults to false.

The container parameter can be set by using a new fifth parameter to the method Drupal\Core\DrupalKernel::__construct() or by a new sixth parameter to the method Drupal\Core\DrupalKernel::createFromRequest(). Both new parameters will default to false.

Remaining tasks

TBD

User interface changes

None

API changes

See proposed solution.

Data model changes

None

Release notes snippet

TBD

Allow the UUID field to be used as a bundle field

$
0
0

Problem/Motivation

Two problems with the core UUID field:

  1. It does not have schema like for example its parent the string field
  2. If you create a bundle field for it, then it is impossible to save new revisions

The problem with the second point is that it defines the value as unique in schema, but this is impossible for revisionable fields because there will be an entry for each entity revision.

Actually I don't want the field it be revisionable for my use case, but bundle fields are currently only revisionable.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

[PLAN] Create an index of UUIDs

$
0
0

Problem/Motivation

Currently with Drupal 8 a UUID is useless. It maybe universally unique, but it doesn't really identify anything on it's own.

In Multiversion module there is multiple entity indexes for UUID, revision hash, sequence, and revision tree. All but UUID are irrelevant for core at the moment.

In Multiversion all of the indexes are grouped by workspace, which is important for how Multiversion uses these indexes. If we put indexes into core before workspaces go into core we will need to find a way for contrib modules like Multiversion to alter these indexes.

Proposed resolution

- Create an interface for all indexes
- Create a base class for all indexes
- Create an index of UUIDs with their entity type, entity id and revision id.

Remaining tasks

This is already implemented in Multiversion module, so mostly just needs porting over. However Multiversion introduces workspaces which would need to be removed from the uuid index code in a way that still allows Multiversion to add them.

Technical summary

- entity.index.uuid service
- getters and setters in service
- hook_install to add all existing entities to index
- hook_entity_insert to add new entities to index

How the indexes in Multiversion are used

The main use case is the RELAXed Web Services module which implements the CouchDB API (http://docs.couchdb.org/en/stable/http-api.html) this API focuses 100% on UUIDs, so we need a way to know when GETting or POSTing a URI which entity that relates to without looping through every entity type.

Other use cases

#2353611: Make it possible to link to an entity by UUID - Wouldn't it be cool if we didn't need the entity type in the URI, and out UUIDs were universally identifiable?
#2577923: MenuLinkContent entities pointing to nodes are not deployable: LinkItem should have a "target_uuid" computed property - Wouldn't it be cool if menu links could link to a UUID and we can look up what entity type that relates to?

Links on dark backgrounds have a green and a white focus outline

$
0
0

When checking a few pages in the context of #3163810: [META] Assess conformance with WCAG SC 2.4.7 "Focus Visible" I've noticed when testing the Tour module on a Views edit page that there is a green as well as a white focus outline for a link which looks kind of odd and distracting. It turns out it is because of box-shadow using white along green as colors. For Claro that pattern works out well since the general background color is white and therefor the focus outline creats some sort of white "padding" to the element it is highlighting, but as soon as there is a black background that default becomes kind of problematic.

a) Tour tooltips (fixed in #4)
The following screenshot illustrates the issue for Tour tooltips
a green and white focus outline for a button within a tour widget
In the subsequent screenshot I've just replaced the color white with black in the devtools to illustrate how the focus outlines looks without the second white outline:
tour tooltip with only a green focus outline and the corresponding devtools output

b) admin messages
Admin messages containing a link like this warning message have the problem as well
drupal warning message with green and white outlines for a link in that message

Those are the occasions found so far. If there are more please update the IS accordingly

Navigation bar not working for unauthenticated

$
0
0

Hello, I come to you because I am stuck on a bug and I do not understand the cause.

When I am logged in as an administrator, the site works normally. If I log out, the navigation bar no longer works. The main menu no longer appears and if I click on the magnifying glass, a bug appears in the console.

This problem appears on all pages of the site, with the exception of the taxonomy terms pages.

Would you have an idea of the problem? There are no messages in the drupal logs.

Viewing all 295290 articles
Browse latest View live


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