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

Installing Drupal from configuration (only certain profiles) from config/sync only fails.

$
0
0

https://www.drupal.org/node/2897299 states that there are currently 2 supported solutions to install configuration for an installation profile. First, using a settings.php fileOR second having a config/sync in a custom installation profile and changing your core.extensions.yml file.

The installation stops at the Installation Configuration step with the error:

The configuration synchronization failed validation.
This import is empty and if applied would delete all of your configuration, so has been rejected.

The directory:protected gets set in the config module with the default random sync location seeming to ignore config/sync location of the installation profile. It (config module) seems to expect a value in the sync key of $config_directories. This seems to imply that an entry in $settings.php is required which makes the second solution depend on the first one, which contradicts the described solution.

Reference and steps to reproduce can be found in: https://www.drupal.org/project/drupal/issues/2788777#comment-12931579.


No way to moderate published and archived content (to delete/archive/etc)

$
0
0

Problem/Motivation

Now that #2864938: Content moderation form doesn't appear on new entities is in, content can be moderated that has never been published. There is still one outstanding use case that is not covered, and that is to allow published content to be moderated out of published to archive, etc.

This is confusing since for certain cases, it's possible there would be users who do not have the permission to edit the content (in which case they could moderate it to archived, etc). If the user only has permission to moderate but not edit, there is no way through the UI to moderate content out of a published state, or back from archived.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Add the FieldStorageDefinition class to define field storage definitions in hook_entity_field_storage_info()

$
0
0

Problem/Motivation

We should add a dedicated field storage definition class which allows modules to define field storage definitions in hook_entity_field_storage_info() without having a config-field easily.

Proposed resolution

Add a FieldStorageDefinition class that implements FieldStorageDefinitionInterface.

Remaining tasks

Patch.

User interface changes

None.

API changes

Additional builder class for storage definitions.

Data model changes

None.

Out of scope

Any changes to BaseFieldDefinition, @see #3014760: [PP-1] Create an abstract composite field definition/storage definition and update BaseFieldDefinition to use it.

Insufficient link validation for external URLs

$
0
0

The link widget seems to rely purely on native browser side validation for checking the validity of external URLs. When an invalid URL such as "http:" (on Firefox) or "irc:" (on Chromium and Firefox) is used then these malformed URLs are accepted.

Steps to replicate:

  1. Add a link field on the "Article" node type with the option "Allowed link type" set to "External links only".
  2. Create an article, enter "http:" or "irc:" for the URL, and submit the form.
  3. Result: the invalid URL is accepted.

This was originally reported by idimopoulos.

Race condition with locale javascript translation generation

$
0
0

When we run our behat tests suite we run into a notice being shown on test pages from time to time:

User Notice: <em class="placeholder">Warning</em>: file_get_contents(public://languages/de_k6dYjbIG0GfEJl3YPQE4ZRnL5Rg9BPdBO3slQkKDHL0.js): failed to open stream: &quot;Drupal\Core\StreamWrapper\PublicStream::stream_open&quot; call failed in <em class="placeholder">Drupal\Core\Asset\JsOptimizer-&gt;optimize()</em> (line <em class="placeholder">25</em> of <em class="placeholder">/srv/default/vcs/web/core/lib/Drupal/Core/Asset/JsOptimizer.php</em>) #0 /srv/default/vcs/web/core/includes/bootstrap.inc(582): _drupal_error_handler_real(2, &#039;file_get_conten...&#039;, &#039;/srv/default/vc...&#039;, 25,

However, with further debugging the error is not reproducible in any way during regular site operation (with any kind of state of caches and state). I think it's caused by a race condition when the behat + drupal driver process and a request trigger both the generation of the same file, as in watchdog the notice of locale translation being triggered can be found twice in the "error" case.

Remove on-demand JavaScript translation parsing and do everything on rebuild

$
0
0

Problem/Motivation

JavaScript string translation, and particularly the discovery of the translatable strings, was designed for the D5/D6/D7 asset handling system's lowest common denominator, which was: drupal_add_js(). This function allowed you to add any JS asset to be loaded at any time during the request.

Consequently, the system to discover translatable strings had to be equally dynamic: detect all JS files on the fly, track which ones we've already seen, if we encounter one we haven't seen yet, rebuild the JS translation file.

In Drupal 8, that has changed: all assets must be defined in asset libraries, and to have an asset be present in the HTML/loaded by the browser, you must "attach asset libraries". (Already supported and recommended in Drupal 7, but not enforced; as of Drupal 8, this is the only supported mechanism.)

Proposed resolution

In Drupal 8, we can generate the translation files (one per language) all at once, without having to do that iterative building! That will mean, after a cache clear or a deployment:

fewer I/O (no need to first build a translation file for the strings on page A, then expand it for the additional strings discovered in page B, etc.)
no need to update the entry in the State system in sync with 1, hence avoiding race conditions/stampedes

_locale_rebuild_js() and friends can go away.

Disabling tableselect element options

$
0
0

Problem/Motivation

There's no handy way to mark some rows as disabled for selection in a tableselect element.

Proposed resolution

For tableselect elements with #multiple === TRUE, allow to pass an optional #disabled property in option.. When an option has #disabled === TRUE, the corresponding checkbox will be disabled. The new option doesn't have any effect for radio buttons (when #multiple === FALSE).

Workaround

Without this change there's still possible to disable certain rows:

  1. Add an additional #process callback to the tableselect element. Note that you should add also the original processor:
    $form['my_table'] = [
      '#type' => 'tableselect',
      ...
      '#process' => [
        // This is the original #process callback.
        [Tableselect::class, 'processTableselect'],
        // Additional #process callback.
        [static::class, 'processDisabledRows'],
      ],
      ...
    ];
    
  2. The additional #process callback:
    public static function processDisabledRows(array &$element): array {
      foreach (Element::children($element) as $key) {
        $element[$key]['#disabled'] = isset($element['#options'][$key]['#disabled']) ? $element['#options'][$key]['#disabled'] : FALSE;
      }
      return $element;
    }
    
  3. Set the #disabled property to TRUE on the rows that you want to disable:
    $form['my_table'] = [
      '#type' => 'tableselect',
      ...
      '#options' => [
        'row1' => [
          'col1' => '1.1',
          'col2' => '1.2',
        ],
        // This row is disabled.
        'row2' => [
          'col1' => '2.1',
          'col2' => '2.2',
          '#disabled' => TRUE,
        ],
      ],
      ...
    ];
    

Remaining tasks

None.

User interface changes

None.

API changes

A tableselect element can have disabled options.

Data model changes

None.

Release notes snippet

TBD

Initial report

Currently it is not possible to disable an option on a tableselect list.
Can we allow a Tableselect checkbox to be disabled on a specific option, like it currently is possible with the attribute and ajax parameters?

Add views area plugin to display a link to another view display within the same view

$
0
0

Problem/Motivation

This issue is created to solve #2981044: [PP-1] Unify the grid/table views of the media library in a more generic way. There are a lot of situations where site builders would like an alternative way to display the current view results, specially when presenting content in a very visual way with a large thumbnails. One example is displaying a grid view and table view of the same content.

Proposed resolution

Create a new area plugin where you can link view displays together. We only allow a display to be linked if:

  • It is a page display
  • It has the same filter criteria
  • It has the same sort criteria
  • It has the same contextual filters
  • It has the same pager settings

We render links to the other displays in the view area and pass the exposed input/arguments/pager when a link is clicked. This would mean you get the exact same result, but showed differently.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


DatabaseStorageExpirable:setWithExpireIfNotExists is not respecting expired

$
0
0

Problem/Motivation

Using DatabaseStorageExpirable:setWithExpireIfNotExists on expired keys is not setting a new element.

Proposed resolution

When calling DatabaseStorageExpirable:setWithExpireIfNotExists on an expired key the new value should be set.

Remaining tasks

User interface changes

none

API changes

none

Data model changes

none

Release notes snippet

Fix plural typo in workspaces field

$
0
0

hi,

the created field of workspaces entity containes a plural typo error : 'The time that the workspaces was created.'

for reviewer time saving, here are the other descriptions of other fields of this entity :
changed => 'The time that the workspace was last edited.'
uid => 'The workspace owner.'
lable => 'The workspace name.'

Ensure that Layout Builder Inline Blocks is section storage agnostic

$
0
0

Problem/Motivation

Currently the Inline Blocks functionality makes assumptions about how override sections are stored so it will only work with core's provide section storages.

Proposed resolution

Make inline blocks not assumption section storage internals

Remaining tasks

User interface changes

None

API changes

Hopefully we can do this with the existing API

Data model changes

None

Release notes snippet

Gracefully handle a non-existent cache service like cache.backend.memcache

$
0
0

I'm running into errors when a memcache backend is defined in settings.php, but the module that provides it isn't enabled (yet). I think the fix is to check for the non-existent cache service and default to using the database cache backend by default.

Examples where this is needed is when re-installing the site from scratch with config_installer which we are using for our automated testing. Also if one wanted to deploy memcache module along with it's settings to a site where it wasn't enabled yet.

There doesn't seem to be a way to confirm the existence of a module in settings.php (which makes sense from a performance standpoint), so I think it makes sense to add a graceful fallback when it's not available. Patch forthcoming.

To reproduce or test, set the memcache settings in settings.php and try to use the site.

  $settings['memcache']['servers'] = [$memcache_ip .':11211' => 'default'];
  $settings['memcache']['bins'] = ['default' => 'default'];
  $settings['memcache']['key_prefix'] ='';
  $settings['cache']['default'] = 'cache.backend.memcache';

Provide a relationship from the revision table to the main table

$
0
0

Problem/Motivation

Views currently doesn't provide a relationship from the revision table back to the base table by default.
There are though workarounds in both block_content and node module for that.

Proposed resolution

Let's add it.

Remaining tasks

Provide a patch
Review it

User interface changes

None

API changes

None

Data model changes

None

Add a views sort handler for sorting content by moderation state

$
0
0

Problem/Motivation

There's no views sort handler for sorting on the moderation state field. In #2862041: Provide useful Views filters for Content Moderation State fields, a filter handler was added for filtering on moderation state. It would be useful to have this so results could be ordered by their current moderation state.

Steps to reproduce this:

  • Install content moderation.
  • Go to Content > Moderated content.
  • Click on the "Moderation state" column.
  • Exception should appear.

Proposed resolution

Add the appropriate handlers to make sorting work.

Remaining tasks

Review patch.

User interface changes

Fixes exception that bubbles up to the UI.

API changes

None.

Data model changes

None.

PostgreSQL constraints are still not renamed properly on table renames

$
0
0

Problem/Motivation

#1013034: PostgreSQL constraints do not get renamed by db_rename_table() provided an initial fix for renaming constraints automatically when a table is renamed, but it didn't cover the case when the table name combined with the serial column name exceed 63 characters, which is the identifier limit in PostgreSQL.

Proposed resolution

Fix constraint renames and their test coverage.

Remaining tasks

Review.

User interface changes

Nope.

API changes

Nope.

Data model changes

Nope.

Release notes snippet

Nope.


Optimize migration of specific source IDs for SQL sources

$
0
0

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).

"This block is broken or missing..." should only be shown to users that have access to do something about it

$
0
0

When a block gets broken, this message is shown to all users, even anonymous:

This block is broken or missing. You may be missing content or you might need to enable the original module.

This message should only be shown to users who have access to edit the block. However, because the block is broken we no longer know the details of the block, so it will be tricky to determine who gets to see the message. At the very least we can hide this from anonymous users.

Add a token for the site logo

$
0
0

Problem/Motivation

Spun off from this request for Drupal 7 (token module): #823780: Add site logo token, where a token for the logo and logo-url have been proposed. However, since all site:* tokens are in core, I feel this belongs to core as well. Therefore I am proposing it here for Drupal 8.

Proposed resolution

The new tokens are [site:logo] and [site:logo-url] and they provide a rendered image and a local path respectively. In addition to that, both tokens also take a theme parameter ([site:logo:?], [site:logo-url:?]) to fetch a logo for a specific theme.

Steps to reproduce:
- without applying patch, install and enable 'token' module (so you can easily browse the list of available tokens)
- edit Article content type, go to manage fields, edit Body
- click "Browse available tokens" link underneath Help text, to open Available tokens popup
- verify no site logo tokens in the Site information list

- now apply patch
- drush cr
- reload Available tokens popup, verify [site:logo] and [site:logo-url] added
- insert them into help text and create or edit an article to verify the Drupal logo and standard URL (/core/themes/bartik/logo.svg) are now visible
- configure a different logo for another theme (seven)
- insert [site:logo:seven] and [site:logo-url:seven] to have the logo show up.
- [site:logo:non-existing-theme] should not be replaced

Remaining tasks

Review.
Resolve #2855653: FilterHtmlImageSecure filters out valid local svg images so the default logo's work as well (user uploaded png/jpg files already work).

User interface changes

None.

API changes

None.

Data model changes

None.

Saving date range fields programmatically without start or end date throws exceptions

$
0
0

Date range field requires that both start and end dates are set. Values are enforced via validation. In addition field schema has NOT NULL for both value and end_value.

When attempting to save an entity with a date range field programmatically, and you leave out either start or end date, a database error is shown:

he website encountered an unexpected error. Please try again later.Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'myfield_end_value

This is due to \Drupal\datetime_range\Plugin\Field\FieldType\DateRangeItem::isEmpty using and instead of or operators. If the or operator was used then the value would be declared invalid and emptied on save. Validation would normally be used to check things are valid before saving.

Add wrappers to fix permission checks

$
0
0

Right now Drupal is unusable with filesystem (POSIX) ACLs. It's been broken for years. This was previously #944582: ./sites/default/files directory permission check is incorrect during install AND status report (affects Docker on Windows) and #1333390: file_prepare_directory() / is_writable() on Linux don't support ACLs which are/were doomed to failure.

Steps to reproduce in Drupal 7 (change apache to your web server user):

  1. Build a clean Drupal 7 development environment
  2. In /sites/default:
    • mkdir files
    • chmod -R 700 files
    • setfacl -R -m user:apache:rwx files/
    • setfacl -Rd -m user:apache:rwx files/
  3. Install Drupal
  4. Do anything that calls file_prepare_directory('public://', FILE_CREATE_DIRECTORY). For instance, install the IMCE module and open its file browser from your "My Account" page.

Anything that calls file_prepare_directory('public://', FILE_CREATE_DIRECTORY) will fail, claiming that the directory (sites/default/files) is not writable.

Viewing all 297408 articles
Browse latest View live