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

Deprecate format_date() in classes

$
0
0

Problem/Motivation

As part of #2999721: [META] Deprecate the legacy include files , deprecate format_date()

Proposed resolution

Replace with calls to DateFormatterInterface::format().

In classes, inject the date formatter service from the container, and use it.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.


Form API #ajax not working on link element

$
0
0

Problem/Motivation

When adding Form API #ajax parameter to a Link type element:

    $form['link'] = [
      '#type' => 'link',
      '#title' => $this->t('AJAX link'),
      '#url' => Url::fromRoute('ajax_example.example_form_ajax', [], ['query' => ['some_parameter' => 'some_value']]),
      '#ajax' => [
        'callback' => [$this, 'ajaxCallback'],
        'wrapper' => $container_id,
      ],
    ];

, form values are not included in the AJAX request, resulting with a confusing error: "An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (50 MB) that this server supports." that has nothing to do with the actual problem and originates from \core\lib\Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber.php.

This bug seriously limits development possibilities when using AJAX API, because the only way a link can influence a form is by adding query parameters to the FormBuilder as in my Ajax Example sandbox, and always having to build a new form with empty storage etc, instead of working with the current form.

Proposed resolution

I checked the request object and when a link has #ajax parameter, the resulting request object has no form values in $request->query->parameters, as opposed to a submit element for example. Solution most likely requires modifying javascript to include form values in the request.

Also it'd be good to change the error message to be more descriptive, as the problem has nothing to do with file uploads.

quickedit_library_info_alter() doesn't handle admin theme properly because config export+import sets the admin theme to "0"

$
0
0

Hi,
I've got problem with Bartik theme. The problem is resolved after using drush cache-rebuild, but after some time it is showing up again.

User warning: The following theme is missing from the file system: in drupal_get_filename() (line 232 of core/includes/bootstrap.inc).

drupal_get_filename('theme', '')
drupal_get_path('theme', '')
{closure}(Array, '')
quickedit_library_info_alter(Array, 'quickedit', NULL)
Drupal\Core\Extension\ModuleHandler->alter('library_info', Array, 'quickedit')
Drupal\Core\Asset\LibraryDiscoveryParser->parseLibraryInfo('quickedit', 'core/modules/quickedit')
Drupal\Core\Asset\LibraryDiscoveryParser->buildByExtension('quickedit')
Drupal\Core\Asset\LibraryDiscoveryCollector->getLibraryDefinitions('quickedit')
Drupal\Core\Asset\LibraryDiscoveryCollector->resolveCacheMiss('quickedit')
Drupal\Core\Cache\CacheCollector->get('quickedit')
Drupal\Core\Asset\LibraryDiscovery->getLibrariesByExtension('quickedit')
Drupal\Core\Asset\LibraryDiscovery->getLibraryByName('quickedit', 'quickedit')
Drupal\Core\Asset\LibraryDependencyResolver->doGetDependencies(Array)
Drupal\Core\Asset\LibraryDependencyResolver->getLibrariesWithDependencies(Array)
Drupal\Core\Asset\AssetResolver->getLibrariesToLoad(Object)
Drupal\Core\Asset\AssetResolver->getCssAssets(Object, 1)
Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAssetLibraries(Array, Array)
Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAttachments(Object)
Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond(Object, 'kernel.response', Object)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.response', Object)
Symfony\Component\HttpKernel\HttpKernel->filterResponse(Object, Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1)
Stack\StackedHttpKernel->handle(Object, 1, 1)
Drupal\Core\DrupalKernel->handle(Object)

Revert cache_menu patch removal, add a $conf setting instead (was: cache_menu: huge table size)

Add a media widget setting to only add or only choose existing media

$
0
0

Problem/Motivation

Story: A sitebuilder can configure the (gorgeous!) media reference widget so, that the user can
a) only add media items
b) only choose existing media items
c) both

Proposed resolution

Add widget settings.

Remaining tasks

Codeit.

User interface changes

Added widget settings.

API changes

None.

Data model changes

None.

Unable to create new draft for content translation even if the path alias does not change

$
0
0

Report based on #2930599: Unable to save a translation if the path alias changes (which is 'works as designed' imho).

Problem/Motivation

User can't add new draft for a content translation of a node if the path alias of the latest published entity (original language) is different from the path alias of the new translation draft's form.

Steps to reproduce

Setup

  1. (as an administrator user, suggested install profile: standard)
  2. Enable node, content_moderation, content_translation and path modules.
  3. Add an another language.
  4. Create a node type, add a workflow to it and make it translatable. Use the defaults settings of the content translation form.
  5. Create a node with in the default language with path alias. Publish it.
  6. Create a translation for the node with a translated path alias which is different from the one the default node has. Publish this translation as well.

Scenario 1

  1. Try to add a new draft for the translation while not changing the path alias.
  2. Expected: new draft is successfully saved while alias of the published translations remain the same.
  3. What happens: PathAliasConstraintValidator returns a validation error You can only change the URL alias for the published version of this content.

Scenario 2

  1. Now try to add a new draft for the translation while changing the path alias to the one what the original published entity revision has (original means the original language).
  2. Expected: Validation error.
  3. What happens: New translation draft successfully saved, and the alias of the published (default) translation revision changes to the one we just filled in.

Proposed resolution

Extend logic of PathAliasConstraintValidator to check for the default revision of the current entity language, and not the original entity.

Remaining tasks

Copy my patch from #2930599: Unable to save a translation if the path alias changes here.
Extend it with a test for Scenario 2
Get a review.

User interface changes

Nothing.

API changes

Nothing.

Data model changes

Nothing.

[PHP 7.2] Avoid count() calls on uncountable variables

States weights aren't taken in account when display select list

$
0
0

When setting weight of states in workflows and adding content moderation select field to contents, the listing order is not reflected.

Create a workflow
Set order to different states (published - draft - deleted)
Add content moderation field to a content type
Add a new node -> select list default value is draft, instead of published.

In Drupal\content_moderation\Plugin\Field\FieldWidget\ModerationStateWidget formElement() method, $default returns 'draft'.

Any idea on this behavior? Can this be related to #2844594?

Thank you.


Add jQuery Timepicker for the Time element of the datetime field

$
0
0

Problem/Motivation

Some browsers don't support HTML5 time entry. A polyfill should be provided to improve UX.

Proposed resolution

Use http://jonthornton.github.io/jquery-timepicker/ as a polyfill.

Remaining tasks

None.

User interface changes

Users with browsers that don't support HTML5 time entry get a shiny time picker.

API changes

None.

Data model changes

None.

[Regression] login link has no destination=drupalSettings.path, so dumps you on the profile

$
0
0

Problem/Motivation

Follow-up to #2503755: Switch from user login block to login menu link and search block in standard profile

login link has no destination=[current.path], so dumps you on the profile

Proposed resolution

Add destination.

User interface changes

None.

API changes

None. API addition: links can set the data-current-path-destination attribute to automatically get the destination query argument

Data model changes

None.

Why this is an RC target

This is severe UX regression introduced by #2503755: Switch from user login block to login menu link and search block in standard profile

ImageItem should have an "derivatives" computed property, to expose all image style URLs

$
0
0

Problem/Motivation

This is a sister issue of #2517030: Add a URL formatter for the image field and #2825487: Fix normalization of File entities: file entities should expose the file URL as a computed property on the 'uri' base field. The former issue solved it for image entities exposed via Views REST export displays. This issue must solve it at the serialization/normalization level, so that all REST resources (as well as JSON API) benefit.

The latter issue already is doing it for FileItem (and hence ImageItem because it extends FileItem), but only for the "canonical" file URL. In the case of ImageItem, we also want image style URLs.

Proposed resolution

Add ImageItemNormalizer.

Remaining tasks

None.

User interface changes

None.

API changes

Adds an API to allow explicit bubbling of cacheability metadata: pass in a 'cacheability' => instanceof CacheableMetadata key-value pair in the serialization context.

(The ImageItem normalizer that we add here uses this to its advantage: this new capability allows that normalizer to be properly unit-testable. No more global state manipulation! See #67's interdiff.)

Data model changes

None.

Non interactive install not in English with configuration overrides is broken

$
0
0

Problem/Motivation

Steps to reproduce:

  1. Install standard in German
  2. Enable config_translation
  3. Add the english language
  4. Edit the standard profile to not have an standard_install() and add keep_english: true to its .info.yml file
  5. Export the configuration using drush
  6. Re-install the site using drush site-install with the --existing-config flag.

You'll see an error like

 [info] Undefined index: id ConfigurableLanguageManager.php:312 [16.45 sec, 58.13 MB]
 [info] Undefined index: id ConfigurableLanguageManager.php:312 [16.45 sec, 58.13 MB]
 [info] Undefined index: id ConfigurableLanguageManager.php:312 [16.45 sec, 58.13 MB]
 [info] Undefined index: id ConfigurableLanguageManager.php:312 [16.45 sec, 58.13 MB]
 [info] Undefined index: id ConfigurableLanguageManager.php:312 [16.45 sec, 58.13 MB]
 [info] Undefined index: id ConfigurableLanguageManager.php:312 [16.45 sec, 58.13 MB]
 [info] Undefined index: id ConfigurableLanguageManager.php:312 [21.25 sec, 62.74 MB]
 [info] Undefined index: id ConfigurableLanguageManager.php:312 [21.25 sec, 62.75 MB]
 [info] Undefined index: id ConfigurableLanguageManager.php:312 [21.25 sec, 62.75 MB]
 [info] Undefined index: field_type FieldConfigStorageBase.php:25 [22.66 sec, 76.9 MB]
 [info] Undefined index: field_type FieldConfigStorageBase.php:28 [22.66 sec, 76.94 MB]

In FieldConfigStorageBase.php line 28:

  [RuntimeException]
  Unable to determine class for field type '' found in the 'field.field.' configuration

Proposed resolution

The problem is caused by container invalidation not causing a reboot. In a non-interactive install container invalidation shouldn't occur because we don't know what the next task is going to do with the container.

Remaining tasks

User interface changes

API changes

Data model changes

Use getDisplayName() for user names consistently

$
0
0

Problem/Motivation

  • Realname module alters the display name, but at user/1234 the username is shown. This is incorrect.
  • Tons of places in core that show the username, but need to show the users display name.
  • Comments do not show DisplayName for registered users.
  • Security problem as usernames should never shown on websites. With real names you cannot login and try passwords, with a username you can.

In Drupal 8.0.0 we deprecated \Drupal\Core\Session\AccountInterface::getUsername(). This is because it was being used for both the display name and getting the username.

The deprecation message is:

   *   Use \Drupal\Core\Session\AccountInterface::getAccountName() or
   *   \Drupal\user\UserInterface::getDisplayName() instead.

The docs for getAccountName() describe the difference:

  /**
   * Returns the unaltered login name of this account.
   *
   * @return string
   *   An unsanitized plain-text string with the name of this account that is
   *   used to log in. Only display this name to admins and to the user who owns
   *   this account, and only in the context of the name used to login. For
   *   any other display purposes, use
   *   \Drupal\Core\Session\AccountInterface::getDisplayName() instead.
   */
  public function getAccountName();

We need to carefully go through the usages and change to getAccountName() or getDisplayName() as required. This is not that simple. For example, another issue was created to covert the following code in UserController to getDisplayName().

          $this->messenger()
            ->addWarning($this->t('Another user (%other_user) is already logged into the site on this computer, but you tried to use a one-time link for user %resetting_user. Please <a href=":logout">log out</a> and try using the link again.',
              [
                '%other_user' => $account->getUsername(),
                '%resetting_user' => $reset_link_user->getUsername(),
                ':logout' => $this->url('user.logout'),
              ]));

However as this is dealing with the logged in user and a password reset link that works using the account name maybe these should be changed to getAccountName().

Proposed resolution

Blocked by #2787871: Properly deprecate getUserName() and use getAccountName() instead

  • Fix all places where getAccountName() is used, but getDisplayName() should be used.
  • Change core to enable a DisplayName by default. That is why tons of tests are failing because of wrong usage.
  • Where changing to getDisplayName() add test coverage\
  • Ensure getDisplayName() and getAccountName() have good documentation so contrib and custom pick the correct function.

Followup tasks

Allow for configurable truncation length of display name: #2767787: Allow custom truncate username settings

User interface changes

Users display name will be properly shown where appropriate.

API changes

API addition: Entity::getDisplayNameTruncated to get the correct abreviation used in theme_preprocess_username() function.

Data model changes

none

Route normalizer: Global Redirect in core

$
0
0

Problem/Motivation

Originally, some work was started in #2430335: Browser language detection is not cache aware to resolve a caching issue. A language redirect was introduced, but the implementation was more general than just adding the language prefix. The target redirect URL was constructed from current route. This caused some test fails (especially, in case if this redirect is enabled always even if the language module is not installed, see 2430335#89). And this issue was created.

Current implementation

There is a new route_normalizer_request_subscriber service that perform redirects like the Global Redirect module. On a GET request, it construct a URL from the current route and the current route/query parameters, and redirects to that URL if it does not match the incoming URL. This causes:
- language redirect, for example from "/" to "/en", this resolves #2430335: Browser language detection is not cache aware
- path alias redirect, for example from "node/1" to "content/my-node"
- front page redirect, for example from "/node" to "/"
There can be more cases, but they are unknown at the moment.

Also, the patch contains some fixes for bugs caught during development, and some documentation changes.

Arguments for this feature:
- globalredirect has a lot of installations, people might need this feature in the core
- better SEO
- less cache entries
- it allows to catch bugs at early development stage (check the fixes provided in the patch)

Remaining tasks

- fix remaining test fails
+ write tests
- try to use CacheableRedirectResponse

User interface changes

The default Drupal installation will behave like the one having the Global Redirect module enabled.

API changes

The "disable_route_normalizer" request attribute can be set to disable the route normalization:

$request->attributes->set('disable_route_normalizer', TRUE);

Data model changes

none

taxonomy_update_8601 failing

$
0
0

When updating from 8.5.4 to 8.6.1 I keep getting the following error while running taxonomy_update_8601:

The field content_translation_status has already been deleted and it is in the process of being purged.

I have a multilingual site with translatable taxonomy terms.

Here is the complete output of drush updb:

$ drush updb -y --entity-updates
The following updates are pending:

block_content entity type : 
  The Reusable field needs to be installed.
commerce_order_item entity type : 
  The Uses legacy adjustments field needs to be installed.
commerce_product_variation entity type : 
  The List price field needs to be installed.
menu_link_content entity type : 
  The Custom menu link entity type needs to be updated.
taxonomy_term entity type : 
  The Taxonomy term entity type needs to be updated.
  The Published field needs to be installed.
paragraph entity type : 
  The paragraph.field_two_column field needs to be uninstalled.
block_content module : 
  8600 -   Add 'reusable' field to 'block_content' entities. 

commerce_order module : 
  8204 -   Add the 'uses_legacy_adjustments' field to 'commerce_order_item' entities. 

commerce_product module : 
  8204 -   Create the 'list_price' field. 

dblog module : 
  8600 -   Change 'No logs message available.' area plugin type. 

menu_link_content module : 
  8601 -   Add the publishing status entity key to custom menu links. 

pathauto module : 
  8107 -   Initialize the new safe tokens setting. 

search_api_db module : 
  8103 -   Converts the old "partial_matches" option to the new "matching" option. 

taxonomy module : 
  8501 -   Convert the custom taxonomy term hierarchy storage to a default storage. 
  8502 -   Copy hierarchy from {taxonomy_term_hierarchy} to {taxonomy_term__parent}. 
  8503 -   Update views to use {taxonomy_term__parent} in relationships. 
  8601 -   Add the publishing status fields to taxonomy terms. 

webform module : 
  8144 -   Issue #2998239: Swift Mailer no longer working after custom email handler theme option was added 
  8145 -   Issue #3002183: Upload Total Limit instead of Upload File limit. 
  8146 -   Issue #3000542: Remove webform_devel.module logger debugging. 

xmlsitemap module : 
  8001 -   Change the primary key of the 'xmlsitemap' table to include the language. 
  8002 -   Update the path of the frontpage link. 

block_content module : 
  Adds a 'reusable' filter to all Custom Block views.

commerce_order module : 
  Grants the "manage order items" permission to roles that can update orders.

commerce_product module : 
  Grants the "manage variations" permission to roles that can update products.

image module : 
  Add 'anchor' setting to 'Scale and crop' effects.

system module : 
  Change plugin IDs of delete actions.
  Update all entity displays that contain extra fields.
  Force cache clear for language item callback.   @see https:www.drupal.orgnode2851736

taxonomy module : 
  Clear entity_bundle_field_definitions cache for new parent field settings.
  Clear caches due to updated taxonomy entity views data.
  Add a 'published' = TRUE filter for all Taxonomy term views and converts  existing ones that were using the 'content_translation_status' field.

Do you wish to run all pending updates? (y/n): y
Performing taxonomy_update_8501                                     [ok]
Performing taxonomy_update_8502                                     [ok]
Performing taxonomy_update_8502                                     [ok]
Performing taxonomy_update_8502                                     [ok]
Performing taxonomy_update_8502                                     [ok]
Performing webform_update_8144                                      [ok]
Performing taxonomy_update_8503                                     [ok]
Performing webform_update_8145                                      [ok]
Performing xmlsitemap_update_8001                                   [ok]
Performing block_content_update_8600                                [ok]
Performing commerce_order_update_8204                               [ok]
Performing commerce_product_update_8204                             [ok]
Performing dblog_update_8600                                        [ok]
Performing menu_link_content_update_8601                            [ok]
Performing pathauto_update_8107                                     [ok]
Performing search_api_db_update_8103                                [ok]
The field content_translation_status has already been deleted and it[error]
is in the process of being purged.
Performing taxonomy_update_8601                                     [ok]
Performing webform_update_8146                                      [ok]
Performing xmlsitemap_update_8002                                   [ok]
Failed: The field content_translation_status has already been       [error]
deleted and it is in the process of being purged.
Failed: Drupal\Core\Entity\EntityStorageException: !message in      [error]
Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema-&gt;onFieldStorageDefinitionDelete()
(line 497 of
/var/www/drupal/public_html/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php).
Cache rebuild complete.                                             [ok]
Finished performing updates.                                        [ok]

Entity Links fields does not have translation support

$
0
0

Problem/Motivation

The Entity link field uses the wrong translation of the entity. It always uses the original language which is not always desired.
This applies to both deletion and editing.
You can use the Entity operations field instead but that is not always desired to do so.

To reproduce:

  1. I have downloaded latest 8.4.x-dev release
  2. I have installed Drupal 8.4 with the Standard profile
  3. I have added a new language "Swedish" and then enabled that language for the "Article" content type
  4. I have created a new node Article example and then translating it to Swedish Artikel exempel.
  5. I have created a new View "Articles" that lists content type articles for both languages
  6. I have configured the view to use table format. I add "Link to edit Content" and "Link to delete Content" fields

The exported view:

uuid: b6c259e3-3fbc-46b9-9979-8df90333fff2
langcode: en
status: true
dependencies:
  config:
    - node.type.article
  module:
    - node
    - user
id: articles
label: Articles
module: views
description: ''
tag: ''
base_table: node_field_data
base_field: nid
core: 8.x
display:
  default:
    display_plugin: default
    id: default
    display_title: Master
    position: 0
    display_options:
      access:
        type: perm
        options:
          perm: 'access content'
      cache:
        type: tag
        options: {  }
      query:
        type: views_query
        options:
          disable_sql_rewrite: false
          distinct: false
          replica: false
          query_comment: ''
          query_tags: {  }
      exposed_form:
        type: basic
        options:
          submit_button: Apply
          reset_button: false
          reset_button_label: Reset
          exposed_sorts_label: 'Sort by'
          expose_sort_order: true
          sort_asc_label: Asc
          sort_desc_label: Desc
      pager:
        type: mini
        options:
          items_per_page: 10
          offset: 0
          id: 0
          total_pages: null
          expose:
            items_per_page: false
            items_per_page_label: 'Items per page'
            items_per_page_options: '5, 10, 25, 50'
            items_per_page_options_all: false
            items_per_page_options_all_label: '- All -'
            offset: false
            offset_label: Offset
          tags:
            previous: ‹‹
            next: ››
      style:
        type: table
      row:
        type: fields
      fields:
        title:
          id: title
          table: node_field_data
          field: title
          entity_type: node
          entity_field: title
          alter:
            alter_text: false
            make_link: false
            absolute: false
            trim: false
            word_boundary: false
            ellipsis: false
            strip_tags: false
            html: false
          hide_empty: false
          empty_zero: false
          settings:
            link_to_entity: true
          plugin_id: field
          relationship: none
          group_type: group
          admin_label: ''
          label: Title
          exclude: false
          element_type: ''
          element_class: ''
          element_label_type: ''
          element_label_class: ''
          element_label_colon: true
          element_wrapper_type: ''
          element_wrapper_class: ''
          element_default_classes: true
          empty: ''
          hide_alter_empty: true
          click_sort_column: value
          type: string
          group_column: value
          group_columns: {  }
          group_rows: true
          delta_limit: 0
          delta_offset: 0
          delta_reversed: false
          delta_first_last: false
          multi_type: separator
          separator: ', '
          field_api_classes: false
        edit_node:
          id: edit_node
          table: node
          field: edit_node
          relationship: none
          group_type: group
          admin_label: ''
          label: 'Link to edit Content'
          exclude: false
          alter:
            alter_text: false
            text: ''
            make_link: false
            path: ''
            absolute: false
            external: false
            replace_spaces: false
            path_case: none
            trim_whitespace: false
            alt: ''
            rel: ''
            link_class: ''
            prefix: ''
            suffix: ''
            target: ''
            nl2br: false
            max_length: 0
            word_boundary: true
            ellipsis: true
            more_link: false
            more_link_text: ''
            more_link_path: ''
            strip_tags: false
            trim: false
            preserve_tags: ''
            html: false
          element_type: ''
          element_class: ''
          element_label_type: ''
          element_label_class: ''
          element_label_colon: true
          element_wrapper_type: ''
          element_wrapper_class: ''
          element_default_classes: true
          empty: ''
          hide_empty: false
          empty_zero: false
          hide_alter_empty: true
          text: edit
          entity_type: node
          plugin_id: entity_link_edit
        delete_node:
          id: delete_node
          table: node
          field: delete_node
          relationship: none
          group_type: group
          admin_label: ''
          label: 'Link to delete Content'
          exclude: false
          alter:
            alter_text: false
            text: ''
            make_link: false
            path: ''
            absolute: false
            external: false
            replace_spaces: false
            path_case: none
            trim_whitespace: false
            alt: ''
            rel: ''
            link_class: ''
            prefix: ''
            suffix: ''
            target: ''
            nl2br: false
            max_length: 0
            word_boundary: true
            ellipsis: true
            more_link: false
            more_link_text: ''
            more_link_path: ''
            strip_tags: false
            trim: false
            preserve_tags: ''
            html: false
          element_type: ''
          element_class: ''
          element_label_type: ''
          element_label_class: ''
          element_label_colon: true
          element_wrapper_type: ''
          element_wrapper_class: ''
          element_default_classes: true
          empty: ''
          hide_empty: false
          empty_zero: false
          hide_alter_empty: true
          text: delete
          entity_type: node
          plugin_id: entity_link_delete
      filters:
        status:
          value: '1'
          table: node_field_data
          field: status
          plugin_id: boolean
          entity_type: node
          entity_field: status
          id: status
          expose:
            operator: ''
          group: 1
        type:
          id: type
          table: node_field_data
          field: type
          value:
            article: article
          entity_type: node
          entity_field: type
          plugin_id: bundle
      sorts:
        created:
          id: created
          table: node_field_data
          field: created
          order: DESC
          entity_type: node
          entity_field: created
          plugin_id: date
          relationship: none
          group_type: group
          admin_label: ''
          exposed: false
          expose:
            label: ''
          granularity: second
      title: Articles
      header: {  }
      footer: {  }
      empty: {  }
      relationships: {  }
      arguments: {  }
      display_extenders: {  }
    cache_metadata:
      max-age: 0
      contexts:
        - 'languages:language_content'
        - 'languages:language_interface'
        - url.query_args
        - 'user.node_grants:view'
        - user.permissions
      tags: {  }
  page_1:
    display_plugin: page
    id: page_1
    display_title: Page
    position: 1
    display_options:
      display_extenders: {  }
      path: articles
    cache_metadata:
      max-age: 0
      contexts:
        - 'languages:language_content'
        - 'languages:language_interface'
        - url.query_args
        - 'user.node_grants:view'
        - user.permissions
      tags: {  }

Expected behaviour

When clicking on Edit on the Swedish Article exempel node I should be taken to the Edit form for that translation (Swedish)
When clicking on Delete on the Swedish Article exempel node I should be taken to the Delete form for that translation (Swedish)

Current behaviour

I am taken to the edit form for the english (original translation).
I am taken to delete form to delete both translations.

Proposed solution/idea

Use the EntityTranslationRenderTrait trait to properly render entity row links in the right language.
Add Kernel test for the fields to ensure they work as expected.

Proposed follow ups

Use Rendering language in the view configuration for untranslated entities
Fix translations for \Drupal\comment\Plugin\views\field\EntityLink if needed

Drop button widgets look odd on dark backgrounds

$
0
0

Problem/Motivation

The drop button widgets have a white background when displayed on a dark background.

This issue was discovered as part of #2949991: Add workspace UI in top dialog, but trying to keep that issue as focussed as possible.

Proposed resolution

Remove the white background.

Remaining tasks

User interface changes

The background of drop buttons to change to transparent.

API changes

Data model changes

views link to content in wrong language

$
0
0

I have standard taxonomy views and some custom blocks.
after click "link to content" field or imagefield linked to content page redirect always to node in source language, not to translation in current language.
how can I fix this?
Rendering language is set to 'Content language of view row', but I check other options

Ensure computed field definitions always have custom storage

$
0
0

Problem/Motivation

Currently when providing a definition for a computed field, manually marking it as having custom storage is required to avoid creating an unused field storage schema. This is bad DX since developers not familiar with all the details of the entity field storage can easily miss this point.

Proposed resolution

Make the Entity Manager automatically mark any field storage definition referring to a computed field as having custom storage.

Remaining tasks

  • Validate the proposed solution
  • Write a patch
  • Review it

User interface changes

None

API changes

None

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue categoryTask because the functionality is not broken, but DX can be definitely improved.
Issue priorityMajor because this affects any developer/site builder using a computed field. Not critical because an unused schema does not break the site.
Prioritized changesThe main goal of this issue is improving DX and reducing fragility.
DisruptionNo disruption foreseen, as if field storage definitions are changed after this patch, the new behavior is actually the correct one.

TranslatableMarkup for Invalid Argument Exception: $string (Array) must be a string.

$
0
0

After some modifications in my block settings and my custom menu which are all migrated from a drupal 6 site i got the following error on blocks layout page:

InvalidArgumentException: $string ("Array") must be a string. in Drupal\Core\StringTranslation\TranslatableMarkup->__construct() (line 140 of core\lib\Drupal\Core\StringTranslation\TranslatableMarkup.php).

Perhaps the issue is not related to the block modification but after uninstall blocks module the error disappeared.

This is a translated one lingual Hungarian site running on Drupal 8.1.0.

Please help! I am really stuck :(

Viewing all 293174 articles
Browse latest View live


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