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

Discuss whether to decouple from Symfony Validator

$
0
0

Problem/Motivation

We've had to deal with quite a lot of deprecations in Symfony validator, which has been the main barrier to updating Symfony minor releases.

The most recent of these is #3029540: [Symfony 4] Sub class \Symfony\Component\Validator\ConstraintViolation and use that in \Drupal\Core\TypedData\Validation\ExecutionContext::addViolation(). There was also #2721179: Replace deprecated Symfony ExecutionContextInterface between Symfony 2 and 3.

This is a much higher maintenance burden than if we'd written a validator component ourselves.

The main issue we have is that we're exposing Symfony interfaces directly to contrib and custom code (I have custom validators written on client projects), which means any change Symfony makes directly impacts implementations.

This is very different to most other Symfony components (YAML, the container etc.) where interaction is either non-existent/extremely superficial and unlikely to be affected, or extremely rare and low level.

Proposed resolution

Couple of ideas:
1. Can we write some kind of layer so that validators implement Drupal rather than Symfony interfaces, then make them work for the Symfony internals?
2. How much code is there in the component itself that's not the validators? What if we froze the API and forked the internals (just changing the Symfony interfaces to a Drupal one). Are there other components that depend on Validator we'd then be incompatible with and would we actually be affected by this?

Other ideas welcome of course.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Failure with media_library during core update from 8.6.15 to 8.7.0/1 failed

$
0
0

HI,

Sorry if I don't report the right way, I do this for the first time!

Since the 8.7 release, I tried to update my site from 8.6.15 to 8.7.0 and now to 8.7.1 : both failed with this error message:

module media_library
Mise à jour #8701

Échec : Drupal\Core\Entity\EntityStorageException : 'image_style' entity with ID 'media_library' already exists. dans Drupal\Core\Entity\EntityStorageBase->doPreSave() (ligne 481 de D:\Site\d8_sc\core\lib\Drupal\Core\Entity\EntityStorageBase.php).

And the report log has two update type error messages:

LogicException : Getting the base fields is not supported for entity type Style d'image. dans Drupal\Core\Entity\EntityFieldManager->buildBaseFieldDefinitions() (ligne 209 de D:\Site\d8_sc\core\lib\Drupal\Core\Entity\EntityFieldManager.php).
Importance Erreur

Drupal\Core\Entity\EntityStorageException : 'image_style' entity with ID 'media_library' already exists. dans Drupal\Core\Entity\EntityStorageBase->doPreSave() (ligne 481 de D:\Site\d8_sc\core\lib\Drupal\Core\Entity\EntityStorageBase.php).

Note that I do have an image style named media_library, but even if I rename its machine name as media_library_custom, when I run the update it doesn't work better.

My site is not broken and the core is marked as updated, but some features (as media widget) don't work as they should, and when I try to re-run …/update.php, it appears that 16 core module updates are waiting to be executed:

16 mises à jour en attente
system module

Initialize 'expand_all_items' values to system_menu_block.
Clear the menu cache. @see https:www.drupal.orgprojectdrupalissues3044364
Clear the library cache and ensure aggregate files are regenerated.

media_library module

8701 - Create the 'media_library' image style.
8702 - Updates the media library view widget display (contextual) filters.
Create and configure Media Library form and view displays for media types.
Add a table display to the media library view and link gridtable displays.

comment module

Add comment settings.

layout_discovery module

Recalculate dependencies for the entity_form_display entity.
Recalculate dependencies for the entity_view_display entity.

media module

Keep media items viewable at media{id}.

menu_link_content module

Update custom menu links to be revisionable.

taxonomy module

Update taxonomy terms to be revisionable.
Remove the 'hierarchy' property from vocabularies.

views module

Update exposed filter blocks label display to be disabled.
Rebuild cache to allow placeholder texts to be translatable.

My site is installed locally with Acquia Dev Desktop. I use drush but not Composer.
I'm no coder AT ALL, so I haven't a clue about what can be done to fix this, but it's been a while since I get repeatedly the first error message (LogicException : Getting the base fields is not supported for entity type) anytime I make a change on a field (changes are generally made despite the message though), so clearly something has been corrupted in the code (or the database?) but I was unable to determine where this was coming from since I don't mess with code and only use those community modules:

D:\Site\d8_sc>drush pm-list
 Package              Name                                                         Type    Status         Version       
 Administration       Admin Toolbar (admin_toolbar)                                Module  Enabled        8.x-1.26      
 Administration       Admin Toolbar Extra Tools (admin_toolbar_tools)              Module  Not installed  8.x-1.26      
 Administration       Admin Toolbar Links Access Filter                            Module  Not installed  8.x-1.26      
                      (admin_toolbar_links_access_filter)                                                               
 Administration       Adminimal Admin Toolbar (adminimal_admin_toolbar)            Module  Enabled        8.x-1.9       
 Administration       Module Missing Message Fixer (module_missing_message_fixer)  Module  Not installed  8.x-1.0-alpha 
                                                                                                          3             
 Bootstrap            Bootstrap Library (bootstrap_library)                        Module  Enabled        8.x-1.11      
 Chaos tool suite     Chaos Tools (ctools)                                         Module  Enabled        8.x-3.2       
 Chaos tool suite     Chaos Tools Blocks (ctools_block)                            Module  Not installed  8.x-3.2       
 (Experimental)                                                                                                         
 Chaos tool suite     Chaos Tools Views (ctools_views)                             Module  Not installed  8.x-3.2       
 (Experimental)                                                                                                         
 CKEditor             CKEditor CodeMirror (ckeditor_codemirror)                    Module  Enabled        8.x-2.2       
 CKEditor             CKEditor InsertHTML (ckeditor_inserthtml)                    Module  Not installed  8.x-1.0       
 CKEditor             CKEditor Non-breaking space Plugin (nbsp)                    Module  Enabled        8.x-1.2       
 Content Type Clone   Content Type Clone (content_type_clone)                      Module  Enabled        8.x-1.x-dev   
 Core                 Actions (action)                                             Module  Not installed  8.7.1         
 Core                 Activity Tracker (tracker)                                   Module  Not installed  8.7.1         
 Core                 Aggregator (aggregator)                                      Module  Not installed  8.7.1         
 Core                 Automated Cron (automated_cron)                              Module  Enabled        8.7.1         
 Core                 Ban (ban)                                                    Module  Not installed  8.7.1         
 Core                 BigPipe (big_pipe)                                           Module  Enabled        8.7.1         
 Core                 Block (block)                                                Module  Enabled        8.7.1         
 Core                 Book (book)                                                  Module  Enabled        8.7.1         
 Core                 Breakpoint (breakpoint)                                      Module  Enabled        8.7.1         
 Core                 CKEditor (ckeditor)                                          Module  Enabled        8.7.1         
 Core                 Color (color)                                                Module  Enabled        8.7.1         
 Core                 Comment (comment)                                            Module  Enabled        8.7.1         
 Core                 Configuration Manager (config)                               Module  Enabled        8.7.1         
 Core                 Contact (contact)                                            Module  Enabled        8.7.1         
 Core                 Content Moderation (content_moderation)                      Module  Not installed  8.7.1         
 Core                 Contextual Links (contextual)                                Module  Enabled        8.7.1         
 Core                 Custom Block (block_content)                                 Module  Enabled        8.7.1         
 Core                 Custom Menu Links (menu_link_content)                        Module  Enabled        8.7.1         
 Core                 Database Logging (dblog)                                     Module  Enabled        8.7.1         
 Core                 Field (field)                                                Module  Enabled        8.7.1         
 Core                 Field UI (field_ui)                                          Module  Enabled        8.7.1         
 Core                 Filter (filter)                                              Module  Enabled        8.7.1         
 Core                 Forum (forum)                                                Module  Not installed  8.7.1         
 Core                 Help (help)                                                  Module  Enabled        8.7.1         
 Core                 History (history)                                            Module  Enabled        8.7.1         
 Core                 Inline Form Errors (inline_form_errors)                      Module  Not installed  8.7.1         
 Core                 Internal Dynamic Page Cache (dynamic_page_cache)             Module  Enabled        8.7.1         
 Core                 Internal Page Cache (page_cache)                             Module  Enabled        8.7.1         
 Core                 Layout Builder (layout_builder)                              Module  Not installed  8.7.1         
 Core                 Layout Discovery (layout_discovery)                          Module  Enabled        8.7.1         
 Core                 Media (media)                                                Module  Enabled        8.7.1         
 Core                 Menu UI (menu_ui)                                            Module  Enabled        8.7.1         
 Core                 Node (node)                                                  Module  Enabled        8.7.1         
 Core                 Path (path)                                                  Module  Enabled        8.7.1         
 Core                 Quick Edit (quickedit)                                       Module  Enabled        8.7.1         
 Core                 RDF (rdf)                                                    Module  Enabled        8.7.1         
 Core                 Responsive Image (responsive_image)                          Module  Enabled        8.7.1         
 Core                 Search (search)                                              Module  Enabled        8.7.1         
 Core                 Settings Tray (settings_tray)                                Module  Enabled        8.7.1         
 Core                 Shortcut (shortcut)                                          Module  Enabled        8.7.1         
 Core                 Statistics (statistics)                                      Module  Not installed  8.7.1         
 Core                 Syslog (syslog)                                              Module  Enabled        8.7.1         
 Core                 System (system)                                              Module  Enabled        8.7.1         
 Core                 Taxonomy (taxonomy)                                          Module  Enabled        8.7.1         
 Core                 Testing (simpletest)                                         Module  Not installed  8.7.1         
 Core                 Text Editor (editor)                                         Module  Enabled        8.7.1         
 Core                 Toolbar (toolbar)                                            Module  Enabled        8.7.1         
 Core                 Tour (tour)                                                  Module  Enabled        8.7.1         
 Core                 Update Manager (update)                                      Module  Enabled        8.7.1         
 Core                 User (user)                                                  Module  Enabled        8.7.1         
 Core                 Views (views)                                                Module  Enabled        8.7.1         
 Core                 Views UI (views_ui)                                          Module  Enabled        8.7.1         
 Core                 Workflows (workflows)                                        Module  Not installed  8.7.1         
 Core (Experimental)  Field Layout (field_layout)                                  Module  Not installed  8.7.1         
 Core (Experimental)  Media library (media_library)                                Module  Enabled        8.7.1         
 Core (Experimental)  Migrate Drupal Multilingual (migrate_drupal_multilingual)    Module  Not installed  8.7.1         
 Core (Experimental)  Workspaces (workspaces)                                      Module  Not installed  8.7.1         
 Custom               Linkit (linkit)                                              Module  Enabled        8.x-4.3       
 Date                 Year only (yearonly)                                         Module  Enabled        8.x-1.3       
 Date/Time            Calendar (calendar)                                          Module  Enabled        8.x-1.x-dev   
 Date/Time            Calendar Datetime (calendar_datetime)                        Module  Enabled        8.x-1.x-dev   
 Date/Time            Date range formatter (date_range_formatter)                  Module  Enabled        8.x-3.1       
 Development          Devel (devel)                                                Module  Enabled        8.x-2.1       
 Development          Devel Generate (devel_generate)                              Module  Enabled        8.x-2.1       
 Development          Devel Kint (kint)                                            Module  Enabled        8.x-2.1       
 Development          Web Profiler (webprofiler)                                   Module  Not installed  8.x-2.1       
 Display Suite        Display Suite (ds)                                           Module  Not installed  8.x-3.1       
 Display Suite        Display Suite Devel (ds_devel)                               Module  Not installed  8.x-3.1       
 Display Suite        Display Suite Extras (ds_extras)                             Module  Not installed  8.x-3.1       
 Display Suite        Display Suite Switch View Mode (ds_switch_view_mode)         Module  Not installed  8.x-3.1       
 Entity               Automatic Entity Labels (auto_entitylabel)                   Module  Enabled        8.x-2.1-beta1 
 Examples             Migrate Example (migrate_example)                            Module  Not installed  8.x-4.2       
 Examples             Migrate Example (Advanced) (migrate_example_advanced)        Module  Not installed  8.x-4.2       
 Examples             Migrate JSON Example (migrate_json_example)                  Module  Not installed  8.x-4.2       
 Examples             Views Bulk Operations example                                Module  Not installed  8.x-2.5       
                      (views_bulk_operations_example)                                                                   
 Feeds                Feeds (feeds)                                                Module  Enabled        8.x-3.0-alpha 
                                                                                                          5             
 Field Formatters     Field Formatter Class (field_formatter_class)                Module  Enabled        8.x-1.1       
 Field types          Date time day (date_time_day)                                Module  Not installed  8.x-1.4       
 Field types          Datetime (datetime)                                          Module  Enabled        8.7.1         
 Field types          Datetime Range (datetime_range)                              Module  Enabled        8.7.1         
 Field types          Entity Reference Display (entity_reference_display)          Module  Enabled        8.x-1.2       
 Field types          Entity Reference Revisions (entity_reference_revisions)      Module  Enabled        8.x-1.6       
 Field types          File (file)                                                  Module  Enabled        8.7.1         
 Field types          Image (image)                                                Module  Enabled        8.7.1         
 Field types          Link (link)                                                  Module  Enabled        8.7.1         
 Field types          Options (options)                                            Module  Enabled        8.7.1         
 Field types          Simple Google Maps (simple_gmap)                             Module  Enabled        8.x-1.4       
 Field types          Telephone (telephone)                                        Module  Enabled        8.7.1         
 Field types          Text (text)                                                  Module  Enabled        8.7.1         
 Field types          Time Field (time_field)                                      Module  Enabled        8.x-1.12      
 Field types          Time Range (time_range)                                      Module  Enabled        8.x-1.1       
 Fields               Element class formatter (element_class_formatter)            Module  Enabled        8.x-1.0       
 Fields               Field Group (field_group)                                    Module  Enabled        8.x-3.0-beta1 
 Fields               Heading (heading)                                            Module  Enabled        8.x-1.4       
 Fields               Inline Entity Form (inline_entity_form)                      Module  Enabled        8.x-1.0-rc1   
 Filters              Entity Embed (entity_embed)                                  Module  Enabled        8.x-1.0-beta3 
 Media                Crop API (crop)                                              Module  Enabled        8.x-1.5       
 Media                Entity Browser (entity_browser)                              Module  Enabled        8.x-2.1       
 Media                Entity Browser example (entity_browser_example)              Module  Not installed  8.x-2.1       
 Media                Entity Browser IEF (entity_browser_entity_form)              Module  Not installed  8.x-2.1       
 Media                ImageWidgetCrop (image_widget_crop)                          Module  Enabled        8.x-2.2       
 Media                ImageWidgetCrop examples (image_widget_crop_examples)        Module  Enabled        8.x-2.2       
 Migrate              Field Group Migrate (field_group_migrate)                    Module  Not installed  8.x-3.0-beta1 
 Migration            Migrate (migrate)                                            Module  Enabled        8.7.1         
 Migration            Migrate Drupal (migrate_drupal)                              Module  Not installed  8.7.1         
 Migration            Migrate Drupal UI (migrate_drupal_ui)                        Module  Not installed  8.7.1         
 Migration            Migrate Plus (migrate_plus)                                  Module  Enabled        8.x-4.2       
 Migration            Migrate Source CSV (migrate_source_csv)                      Module  Enabled        8.x-2.2       
 Migration            Migrate Tools (migrate_tools)                                Module  Enabled        8.x-4.1       
 Multilingual         Configuration Translation (config_translation)               Module  Not installed  8.7.1         
 Multilingual         Content Translation (content_translation)                    Module  Enabled        8.7.1         
 Multilingual         Interface Translation (locale)                               Module  Enabled        8.7.1         
 Multilingual         Language (language)                                          Module  Enabled        8.7.1         
 Other                Allowed Formats (allowed_formats)                            Module  Enabled        8.x-1.1       
 Other                Bootstrap DateTime Picker (bootstrap_datetime)               Module  Enabled        8.x-1.2       
 Other                Configuration Update Base (config_update)                    Module  Enabled        8.x-1.6       
 Other                Configuration Update Reports (config_update_ui)              Module  Enabled        8.x-1.6       
 Other                Content Import (contentimport)                               Module  Not installed  8.x-4.x-dev   
 Other                Embed (embed)                                                Module  Enabled        8.x-1.0       
 Other                Entity Mask (ctools_entity_mask)                             Module  Not installed  8.x-3.2       
 Other                Entity Type Clone (entity_type_clone)                        Module  Enabled        8.x-1.3       
 Other                Entity Usage (entity_usage)                                  Module  Enabled        8.x-2.0-alpha 
                                                                                                          8             
 Other                Libraries (libraries)                                        Module  Not installed  8.x-3.0-alpha 
                                                                                                          1             
 Other                Linked Field (linked_field)                                  Module  Enabled        8.x-1.1       
 Other                Menu Block (menu_block)                                      Module  Enabled        8.x-1.5       
 Other                Menu Trail By Path (menu_trail_by_path)                      Module  Enabled        8.x-1.1       
 Other                Meta position (meta_position)                                Module  Enabled        8.x-1.0       
 Other                Pathauto (pathauto)                                          Module  Enabled        8.x-1.4       
 Other                Publication Date (publication_date)                          Module  Enabled        8.x-2.0-beta1 
 Other                Simple timeline (simple_timeline)                            Module  Enabled        8.x-1.1       
 Other                Single Date Time Picker (single_datetime)                    Module  Not installed  8.x-1.6       
 Other                Taxonomy unique (taxonomy_unique)                            Module  Not installed  8.x-2.1       
 Other                Telephone Validation (telephone_validation)                  Module  Not installed  8.x-2.2       
 Other                Token (token)                                                Module  Enabled        8.x-1.5       
 Paragraphs           Bootstrap Paragraphs (bootstrap_paragraphs)                  Module  Enabled        8.x-2.0-beta6 
 Paragraphs           Bootstrap Paragraphs Contact Form (bp_contact)               Module  Not installed  8.x-2.0-beta6 
 Paragraphs           Bootstrap Paragraphs Webform (bp_webform)                    Module  Not installed  8.x-2.0-beta6 
 Paragraphs           Paragraphs (paragraphs)                                      Module  Enabled        8.x-1.8       
 Paragraphs           Paragraphs Demo (paragraphs_demo)                            Module  Not installed  8.x-1.8       
 Paragraphs           Paragraphs Library (paragraphs_library)                      Module  Enabled        8.x-1.8       
 Paragraphs           Paragraphs Type Permissions (paragraphs_type_permissions)    Module  Enabled        8.x-1.8       
 Search               Database Search (search_api_db)                              Module  Not installed  8.x-1.11      
 Search               Database Search Defaults (search_api_db_defaults)            Module  Not installed  8.x-1.11      
 Search               Search API (search_api)                                      Module  Not installed  8.x-1.11      
 User interface       Accordion Menus (accordion_menus)                            Module  Not installed  8.x-2.0       
 User interface       Superfish (superfish)                                        Module  Not installed  8.x-1.3       
 Views                Views Bootstrap (views_bootstrap)                            Module  Enabled        8.x-4.1       
 Views                Views Bulk Operations (views_bulk_operations)                Module  Enabled        8.x-2.5       
 Views                Views Reference Field (viewsreference)                       Module  Enabled        8.x-1.4       
 Views                Views Slideshow (views_slideshow)                            Module  Enabled        8.x-4.6       
 Views                Views Slideshow Cycle (views_slideshow_cycle)                Module  Enabled        8.x-4.6       
 Views                Views templates (views_templates)                            Module  Enabled        8.x-1.0-alpha 
                                                                                                          1             
 Views Bulk           Actions Permissions (actions_permissions)                    Module  Not installed  8.x-2.5       
 Operations                                                                                                             
 Views Bulk           Views Bulk Edit (views_bulk_edit)                            Module  Enabled        8.x-2.2       
 Operations                                                                                                             
 Web services         HAL (hal)                                                    Module  Not installed  8.7.1         
 Web services         HTTP Basic Authentication (basic_auth)                       Module  Not installed  8.7.1         
 Web services         JSON:API (jsonapi)                                           Module  Not installed  8.7.1         
 Web services         RESTful Web Services (rest)                                  Module  Enabled        8.7.1         
 Web services         Serialization (serialization)                                Module  Enabled        8.7.1         
 Webform              Webform (webform)                                            Module  Enabled        8.x-5.2       
 Webform              Webform Access (webform_access)                              Module  Not installed  8.x-5.2       
 Webform              Webform Attachment (webform_attachment)                      Module  Not installed  8.x-5.2       
 Webform              Webform Bootstrap (webform_bootstrap)                        Module  Not installed  8.x-5.2       
 Webform              Webform Devel (webform_devel)                                Module  Not installed  8.x-5.2       
 Webform              Webform Image Select (webform_image_select)                  Module  Not installed  8.x-5.2       
 Webform              Webform Node (webform_node)                                  Module  Not installed  8.x-5.2       
 Webform              Webform Scheduled Email Handler (webform_scheduled_email)    Module  Not installed  8.x-5.2       
 Webform              Webform Shortcuts (webform_shortcuts)                        Module  Not installed  8.x-5.2       
 Webform              Webform Submission Export/Import [EXPERIMENTAL]              Module  Not installed  8.x-5.2       
                      (webform_submission_export_import)                                                                
 Webform              Webform Submission Log (webform_submission_log)              Module  Not installed  8.x-5.2       
 Webform              Webform Templates (webform_templates)                        Module  Not installed  8.x-5.2       
 Webform              Webform UI (webform_ui)                                      Module  Enabled        8.x-5.2       
 Webform Demo         Webform Demo: Application/Evaluation System                  Module  Not installed  8.x-5.2       
                      (webform_demo_application_evaluation)                                                             
 Webform Demo         Webform Demo: Event Registration System                      Module  Not installed  8.x-5.2       
                      (webform_demo_event_registration)                                                                 
 Webform Demo         Webform Demo: Region Contact System                          Module  Not installed  8.x-5.2       
                      (webform_demo_region_contact)                                                                     
 Webform example      Webform Element Example (webform_example_element)            Module  Not installed  8.x-5.2       
 Webform example      Webform Example Composite (webform_example_composite)        Module  Not installed  8.x-5.2       
 Webform example      Webform Examples (webform_examples)                          Module  Not installed  8.x-5.2       
 Webform example      Webform Examples Accessibility                               Module  Not installed  8.x-5.2       
                      (webform_examples_accessibility)                                                                  
 Webform example      Webform Handler Example (webform_example_handler)            Module  Not installed  8.x-5.2       
 Webform example      Webform Remote Post Example (webform_example_remote_post)    Module  Not installed  8.x-5.2       
 Autre                Adminimal (adminimal_theme)                                  Theme   Enabled        8.x-1.4       
 Autre                Bootstrap Barrio (bootstrap_barrio)                          Theme   Enabled        8.x-4.17      
 Autre                Bootstrap Barrio SASS SC Subtheme (bootstrap_sass_sc)        Theme   Disabled       8.x-1.6       
 Autre                Bootstrap Barrio SC Custom Subtheme (barrio_sc)              Theme   Enabled        8.x-4.17      

Thanks for your help.

Drupal 7 Taxonomy Term Source produces MySQL errors for machine_name

$
0
0

The `d7_taxonomy_term` migration source at `core/modules/taxonomy/src/Plugin/migrate/source/d7/Term.php` produces a query with duplicate `machine_name` fields. This causes MySQL errors.

I have attempted to begin addressing this by aliasing the vocabulary machine name field.

I'll attach a patch once I get this issues #.

Ajax Error when uploading new assets using Media Library module

$
0
0

Problem/Motivation

When uploading a new file using the Media Library module, the "Add File" action fails to upload the file and silently throws a console error. This error occurs every time with every media type for our site.

Steps to reproduce:

  1. Choose a node that contains a media field for editing using the "Add media" button.
  2. In the resulting "Add or select media" lightbox, click the "Choose File" button in the "Add File" section.
  3. Choose a file of the appropriate media type.
  4. At this point, a progress spinner is shown then disappears. Nothing further occurs and the file is not added to the library.
  5. Check the console log to see the Ajax error:
    An AJAX HTTP error occurred.
    
    HTTP Result Code: 200
    
    Debugging information follows.
    
    Path: /media-library?media_library_opener_id=field%3Afield_documents_media_&media_library_allowed_types%5Bbasic_image%5D=basic_image&media_library_allowed_types%5Bdocuments%5D=documents&media_library_allowed_types%5Bicon%5D=icon&media_library_allowed_types%5Blocation_photos%5D=location_photos&media_library_allowed_types%5Bremote_video%5D=remote_video&media_library_selected_type=basic_image&media_library_remaining=1&hash=wFpjTCU6C4We9HKZWN4uK4B2cxaXeEhPCddqHR-vBKQ&media_library_content=1&_wrapper_format=drupal_ajax&ajax_form=1
    
    StatusText: parsererror
    
    ResponseText: Notice: Undefined index: #parents in /app/web/core/modules/media_library/src/Form/AddFormBase.php on line 250
    
    [...]

OS: nginx/1.14.2
Database: 5.5.5-10.1.38-MariaDB
PHP 7.2.15
Drupal 8.7.0

Proposed resolution

Adding a null check to AddFormBase.php:buildEntityFormElement():250 allowed me to successfully upload files (patch file to follow in comments).

-    $parents = $form['#parents'];
+    if (array_key_exists("#parents", $form)) {
+      $parents = $form['#parents'];
+    }
+    else {
+      $parents = [];
+    }

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.

Add more granular block permissions

$
0
0

Problem/Motivation

The block system has but one permission: "Administer blocks", creating an all-or-none situation where granting a user any permission to the subsystem entails giving them god powers there. Especially now that we have custom blocks, I expect people will want more of the flexibility they currently have with nodes to restrict access to different operations by bundle. I know I have for a long time!

Proposed resolution

I propose adding more granular permissions. Update block's permissions as compared to node's:

NodeBlock
Bypass content access controlx
Administer content typesAdminister block types
Administer contentAdminister blocks
Access the Content overview pageAccess the Custom block library page
View published contentx
View own unpublished contentx
View all revisionsx
Revert all revisionsx
Delete all revisionsx
Per type: Create new contentPer type: Create new blocks
Per type: Edit own contentx
Per type: Edit any contentPer type: Edit any blocks
Per type: Delete own contentx
Per type: Delete any contentPer type: Delete any blocks
Per type: View revisionsx
Per type: Revert revisionsx
Per type: Delete revisionsx

Marking the above items as 'x' (or deferred to separate issue) because:

Remaining tasks

  • Decide if and what permissions to add.
  • Write a patch.
  • Add tests.
  • Review and commit.
  • Write a change notice.

User interface changes

TBD.

API changes

TBD.

Abstract RenderCache into a separate service that is capable of cache redirects in a non-render array-specific way

$
0
0

Problem/Motivation

The render system has \Drupal\Core\Render\RenderCache(Interface). This is capable of doing cache redirects, based on bubbled cache contexts. I.e. compare the originally known cache contexts with those that the final-to-be-cached data depends upon, and if that set is different, cache it as a cache redirect. (See RenderCache's docs for details.)

This is useful outside of the render system too.

Proposed resolution

Abstract RenderCache into a service (name TBD, initial quick thought: RedirectingCache) that RenderCache can use, so that RenderCache is just one of many things able to use this generic concept.

Remaining tasks

TBD

User interface changes

None.

API changes

None, pure API addition.

Data model changes

None.

Update after upgrade from 8.5.6 to 8.6.1 gives problem

$
0
0

After upgrading from 8.5.6 to drupal 8.6.1 I am not able to finish update.php (the drush version gives the same error).

The error (note: I have translated the ):

"drush updb" gives:

The following updates are pending:

system module :
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
Cache rebuild complete. [ok]
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "external_entity" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 133 of[error]
/data/www/MYDOMAIN/public_html/core/lib/Drupal/Core/Entity/EntityTypeManager.php).
Werkt system bij (English: updates the system) [ok]
Failed: Drupal\Component\Plugin\Exception\PluginNotFoundException: The "external_entity" entity type does not exist. in [error]
Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 133 of /data/www/MYDOMAIN/public_html/core/lib/Drupal/Core/Entity/EntityTypeManager.php).
Cache rebuild complete. [ok]
Finished performing updates.

The last version of Module "external_entity" is installed.
The website is working properly by the way. However, I need to do more updates and would like to solve this problem first.

Anyone any idea what the problem can be?


Activating Layout Builder changes the menu form order

$
0
0

Hello,

I have installed a plain vanilla 8.7.1 with the standard profile, no other contrib modules. When going to the main menu add link page (/admin/structure/menu/manage/main/add) the fields order is like this: Menu Link Title, Link, Enabled, Description, etc.

After enabling the Layout Builder, Layout Discovery and Field Layout modules, when visiting the same page the order of the form is different: Link, Enabled, Description, Show as Expanded, Menu Link Title, etc.

Is this a normal / expected behavior or a bug?

Update from 8.6.15 to 8.7 fails in layout_discovery_post_update_recalculate_entity_form_display_dependencies()

$
0
0

I get this error when i try to run the database update:

Modul layout_discovery
recalculate_entity_form_display_dependencies aktualisieren

Fehlgeschlagen: Drupal\Component\Plugin\Exception\PluginNotFoundException: The "insert_image" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\WidgetPluginManager are: comment_default, datetime_datelist, datetime_default, file_generic, image_image, link_default, panelizer, path, simplenews_subscription_select, text_textarea_with_summary, text_textarea, text_textfield, string_textfield, language_select, options_select, options_buttons, uri, boolean_checkbox, entity_reference_autocomplete, email_default, entity_reference_autocomplete_tags, string_textarea, number, datetime_timestamp in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (Zeile 53 in /home/alastune/public_html/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Entity breadcrumb doesn't update when entity title changes (stale cache)

$
0
0

Check attached image where I marked red. It looks like the title in the breadcrumb for Diff module always stays with first title saved.

7.67 Upgrade breaks on PHP Fatal error: Class 'TYPO3\\PharStreamWrapper\\Resolver\\PharInvocationCollection' not found

$
0
0

PHP Fatal error: Class 'TYPO3\\PharStreamWrapper\\Resolver\\PharInvocationCollection' not found in [webroot]/misc/typo3/phar-stream-wrapper/src/Manager.php on line 98

Changes in includes/file.phar.inc don't seem to be working for PHP 5.3.3

We are stuck at this PHP version for a bit longer, so would be good to understand how to resolve so we can upgrade to 7.67

Core Mail class prints non-overridable errors on the page

$
0
0

Problem/Motivation

1) User interface

While working on issue #2348119 , it was noticed that the core MailManager->mail() , when encountering a problem with passing the mail on to the mail server, logs the error and then uses drupal_set_message() to tell the visitor about it.

It already returns an array that contains the outcome of the attempt, which can be then handled by the caller.

This causes problems for modules that want to provide better errors to the user ( e.g. in the case of the contact module, which mail failed instead of all of them individually ).

The first idea was to extend the class when wanting to override this behavior, but that leads to duplicating the entire function minus a line.

2) Running from cron

A common setup is to use crontab to schedule drush cron via drush. If drush detects any error messages from messenger()->addError, prints them and returns an error to the shell. Depending on the exact config, this might trigger cron to send an emergency mail. So a single email failing to send is being given the same level of urgency as a major problem such as the overnight backup failing.

Simplenews module sends emails in bulk to newsletter subscribers using cron. There appears to be no way for the module to avoid this unwarranted highly-visible false alarm without a change to core.

Further context

For the default PHP mailer, a successful result means "nothing more than the message being accepted at php-level, which still doesn't guarantee it to be delivered". Hence an error result typically indicates a fairly serious general problem.

Alternative mail-sending plug-in implementations can return an error much more easily. In particular Swiftmailer sending over SMTP does so for a bad email address. On a busy site with lots of subscribers, such errors are likely to occur daily.

Proposed resolution

Specify that a parameter with key '_error_message' has the special meaning to specify translatable markup to use as an error message if needed.

Remaining tasks

Write a CR

  • calling code can supply an error message
  • MailManager implementations should follow the new param

User interface changes

User will see less (and hopefully more targeted and specific to the action at hand) messages.

API changes

Specify that a parameter with key '_error_message' has the special meaning to specify translatable markup to use as an error message if needed.

Views do not add the "active" class anymore

$
0
0

In Drupal 7, thanks to the implementation of l(), an "active" class was automatically added when generating node listing with views, and when the linked entity's URI was the same as the one listed.

With #1979468: ".active" from linkGenerator(), l() and theme_links() forces an upper limit of per-page caching for all content containing links, this is not the case anymore and it seem's not easily alterable (I can't my way through).

Is there a way to change this behaviour. Are we missing something in core to let us alter that ?

Add field ui to workspaces

$
0
0

Problem/Motivation

It is quite common for the workspaces to require additional metadata. Workspaces are content entities, so they support fields but there's no ui for managing them.

Proposed resolution

Add the field_ui tabs on /admin/config/workflow/workspaces.

User interface changes

Field UI tabs showing up on the workspace listing page.

API changes

None.

Data model changes

None.

Release notes snippet

Workspaces now have the field ui tabs on the listing page.


Add ContainerFactoryPluginInterface to Drupal\Core\Field\WidgetBase and Drupal\Core\Field\FormatterBase

$
0
0

Problem/Motivation

After visiting @alexpott's session "Drupal 9 is coming: Getting your code ready
" (https://events.drupal.org/seattle2019/sessions/drupal-9-coming-getting-y...) in Seattle, I wanted to make the contrib select2 module more BC stable by preventing constructor overwrites.

I found out that I am not able to prevent constructor overwriting for the Select2EntityReferenceWidget (https://git.drupalcode.org/project/select2/blob/8.x-1.x/src/Plugin/Field...) because none of it's base classes is implementing the ContainerFactoryPluginInterface.
The base class chain of this class is Select2EntityReferenceWidget -> Select2Widget -> OptionsSelectWidget -> OptionsWidgetBase -> WidgetBase. That means if one of this base classes changes it's constructor, I will have a breakage in Select2EntityReferenceWidget.

Proposed resolution

Add ContainerFactoryPluginInterface to Drupal\Core\Field\WidgetBase and Drupal\Core\Field\FormatterBase and implement the ::create() method in them. The big advantage is that all child classes will be more BC stable.

Remaining tasks

Discuss
Implement
Test
Commit

User interface changes

n.a.

API changes

Add ContainerFactoryPluginInterface to Drupal\Core\Field\WidgetBase

Data model changes

n.a.

Release notes snippet

n.a.

media_library_update_8701() fails during update from 8.6.15 to 8.7.0

$
0
0

I'm still looking into this, but wanted to create an issue so others can help out if they are seeing the same problem.

When I run drush updb it fails with this error:

The display context is not a valid context.

I traced that error to Drupal\Component\Plugin\ContextAwarePluginBase->getContextDefinition(), and left a debug_print_backtrace() before the Exception gets thrown, producing:

#0  Drupal\Component\Plugin\ContextAwarePluginBase->getContextDefinition() called at [/app/web/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php:115]
#1  Drupal\Core\Plugin\ContextAwarePluginBase->getContextDefinition() called at [/app/web/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php:53]
#2  Drupal\Core\Plugin\ContextAwarePluginBase->getContext() called at [/app/web/core/lib/Drupal/Component/Plugin/ContextAwarePluginBase.php:140]
#3  Drupal\Component\Plugin\ContextAwarePluginBase->getContextValue() called at [/app/web/core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php:94]
#4  Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage->getSectionList() called at [/app/web/core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php:104]
#5  Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage->getDisplay() called at [/app/web/core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php:371]
#6  Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage->isLayoutBuilderEnabled() called at [/app/web/core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php:432]
#7  Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage->isApplicable() called at [/app/web/core/modules/layout_builder/src/SectionStorage/SectionStorageManager.php:100]
#8  Drupal\layout_builder\SectionStorage\SectionStorageManager->findByContext() called at [/app/web/core/modules/layout_builder/src/LayoutEntityHelperTrait.php:124]
#9  Drupal\layout_builder\InlineBlockEntityOperations->getSectionStorageForEntity() called at [/app/web/core/modules/layout_builder/src/LayoutEntityHelperTrait.php:38]
#10 Drupal\layout_builder\InlineBlockEntityOperations->isLayoutCompatibleEntity() called at [/app/web/core/modules/layout_builder/src/InlineBlockEntityOperations.php:169]
#11 Drupal\layout_builder\InlineBlockEntityOperations->handlePreSave() called at [/app/web/core/modules/layout_builder/layout_builder.module:206]
#12 layout_builder_entity_presave()
#13 call_user_func_array() called at [/app/web/core/lib/Drupal/Core/Extension/ModuleHandler.php:403]
#14 Drupal\Core\Extension\ModuleHandler->invokeAll() called at [/app/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php:349]
#15 Drupal\Core\Config\Entity\ConfigEntityStorage->invokeHook() called at [/app/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php:491]
#16 Drupal\Core\Entity\EntityStorageBase->doPreSave() called at [/app/web/core/lib/Drupal/Core/Entity/EntityStorageBase.php:445]
#17 Drupal\Core\Entity\EntityStorageBase->save() called at [/app/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php:263]
#18 Drupal\Core\Config\Entity\ConfigEntityStorage->save() called at [/app/web/core/lib/Drupal/Core/Entity/EntityBase.php:394]
#19 Drupal\Core\Entity\EntityBase->save() called at [/app/web/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php:613]
#20 Drupal\Core\Config\Entity\ConfigEntityBase->save() called at [/app/web/core/modules/media_library/media_library.install:77]
#21 media_library_update_8701() called at [/app/vendor/drush/drush/commands/core/drupal/update.inc:65]
#22 drush_update_do_one() called at [/app/vendor/drush/drush/commands/core/drupal/batch.inc:163]
#23 _drush_batch_worker() called at [/app/vendor/drush/drush/commands/core/drupal/batch.inc:111]
#24 _drush_batch_command() called at [/app/vendor/drush/drush/includes/batch.inc:98]
#25 drush_batch_command() called at [/app/vendor/drush/drush/commands/core/drupal/update.inc:235]
#26 _update_batch_command() called at [/app/vendor/drush/drush/commands/core/core.drush.inc:1231]
#27 drush_core_updatedb_batch_process() called at [/app/vendor/drush/drush/includes/command.inc:422]
#28 _drush_invoke_hooks() called at [/app/vendor/drush/drush/includes/command.inc:231]
#29 drush_command() called at [/app/vendor/drush/drush/includes/command.inc:199]
#30 drush_dispatch() called at [/app/vendor/drush/drush/lib/Drush/Boot/BaseBoot.php:67]
#31 Drush\Boot\BaseBoot->bootstrap_and_dispatch() called at [/app/vendor/drush/drush/includes/preflight.inc:67]
#32 drush_main() called at [/app/vendor/drush/drush/drush.php:12]

I don't have much ContextAwarePlugin experience but it appears that its looking for a "display" context on the image style that media_library_update_8701 is creating. But I do not know why or what exactly that means.

Error: Unsupported operand types in Drupal\views\Plugin\views\field\FieldPluginBase->getElements() line 317

$
0
0

Fresh Drupal 8.5 install with `minimal` profile.

I enable Views UI then I create a new entity_reference View listing User (see attached YML).

Drupal raises the following PHP exception when trying to edit the Fields in that View:

Error: Unsupported operand types in Drupal\views\Plugin\views\field\FieldPluginBase->getElements() (line 317 of /app/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php)
#0 /app/web/core/modules/views/src/Plugin/views/field/FieldPluginBase.php(575): Drupal\views\Plugin\views\field\FieldPluginBase->getElements()
#1 /app/web/core/modules/views/src/Plugin/views/field/EntityField.php(428): Drupal\views\Plugin\views\field\FieldPluginBase->buildOptionsForm(Array, Object(Drupal\Core\Form\FormState))
#2 /app/web/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php(167): Drupal\views\Plugin\views\field\EntityField->buildOptionsForm(Array, Object(Drupal\Core\Form\FormState))
#3 [internal function]: Drupal\views_ui\Form\Ajax\ConfigHandler->buildForm(Array, Object(Drupal\Core\Form\FormState))
#4 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(514): call_user_func_array(Array, Array)
#5 /app/web/core/lib/Drupal/Core/Form/FormBuilder.php(271): Drupal\Core\Form\FormBuilder->retrieveForm('views_ui_config...', Object(Drupal\Core\Form\FormState))
#6 /app/web/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php(214): Drupal\Core\Form\FormBuilder->buildForm('views_ui_config...', Object(Drupal\Core\Form\FormState))
#7 /app/web/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\views_ui\Form\Ajax\ViewsFormBase->Drupal\views_ui\Form\Ajax\{closure}()
#8 /app/web/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php(216): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#9 /app/web/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php(125): Drupal\views_ui\Form\Ajax\ViewsFormBase->ajaxFormWrapper('Drupal\\views_ui...', Object(Drupal\Core\Form\FormState))
#10 /app/web/core/modules/views_ui/src/Form/Ajax/ConfigHandler.php(39): Drupal\views_ui\Form\Ajax\ViewsFormBase->getForm(Object(Drupal\views_ui\ViewUI), 'entity_referenc...', 'ajax')
#11 [internal function]: Drupal\views_ui\Form\Ajax\ConfigHandler->getForm(Object(Drupal\views_ui\ViewUI), 'entity_referenc...', 'ajax', 'field', 'name')
#12 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array)
#13 /app/web/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#14 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#15 /app/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array)
#16 /app/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
#17 /app/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1)
#18 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#19 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#20 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(99): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) 
#21 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(78): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 /app/vendor/asm89/stack-cors/src/Asm89/Stack/Cors.php(49): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#23 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Asm89\Stack\Cors->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#24 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(50): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#25 /app/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#26 /app/web/core/lib/Drupal/Core/DrupalKernel.php(657): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#27 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #28 {main}.

Here's a patch to fix this error:
https://www.drupal.org/files/issues/2018-03-25/0001-2955877-Fix-unsupported-operand-types.patch

protected methods in LocalAwareRedirectResponseTrait are missing docs

$
0
0

API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Routing%2...

The protected methods in this trait all say 'inheritdoc' for their docs. But for a trait, that doesn't make sense. (Public methods on a trait at a push, because they often will be there to implement an interface that the consuming class implements.)

So these need to be documented here.

Furthermore, I can't find any method of the same name anywhere else in core.

[meta] Make multilingual views work

$
0
0

If you create a multi-lingual site, and try to use Views on it, you'll run into various problems.

This meta-issue exists to collect all of the various problems in one place.

Overall Plan

  • In the presence of multiple languages, each row in an entity view should represent one translation of one entity item. So each row has an entity ID and a language associated with it, for the base table.
  • Any filters/sorts/arguments related to fields on an entity should filter/sort based on the translated field values associated with that language on that entity. In other words, the field tables need to be joined based on language, for translated fields.
  • You need to be able to filter the entities in the views rows by language of the translation (should also be a field, sort, and argument). Choices:
    - Specific languages (enabled languages on the site, plus "undefined" and "all languages")
    - Current language (the language chosen by URL, language switcher, and other negotiation)
  • Entities should also have a field/filter/sort/argument for Original Language.
  • If there are relationships/joins in the view to other entities, their language can be filtered independently. However, they need another language choice, which will filter so that their language matches the language of the base entity table (only applies if the base table is an entity).
  • When making Views output for a given entity, the user should be given a choice of languages:
    - Specific languages (enabled languages on the site, plus "undefined" and "all languages")
    - Current language (the language chosen by URL, language switcher, and other negotiation)
    - - Row language (the fields/entities/etc. from each entity will be displayed in the language associated with the translation of that entity in the row)
    This choice should be a setting on the Display. Whether the output is fields (Field module fields and entity properties like title), entities, links, or whatever, they should all obey the Display language setting.

Individual issues

Here is a table of the individual issues that need to be resolved in order to realize the overall plan.

ProblemIssue(s)Discussion/explanationFollow-up
[1] Some entities lack data tables[DONE!]In order for each row in a view to represent a translation, every fieldable, translatable entity needs to have a table with the language field in it, which is the data table. Two Core entities lack this table currently: User and Custom Block.
[2] Join field tables to entity data table[DONE!]#2218065: Need to join fields to the entity field data tables, not entity tables, or filtering increases number of resultsCurrently, the Field module's Views integration is joining field data tables to the entity base table. It needs to join to the entity field data table instead, so that the languages on the fields are connected to the language of the views row. For (rare) entities without data table, join as we are now.
[3] Add entity-level language filters [DONE! Some followups may be needed...]If view rows are entity translations, you need to have some way to filter views by language of the translation. Views should also be filterable by original/source language. Need sort, field, and argument for both of these as well. Note that the default Views entity data class proposed in #1740492: Implement a default entity views data handler would take care of this for most entities in a reasonable way.Views provided by Core need to use these filters:

Also: #2162051: Decide if views should default to having a language filter.

[4] Deal with missing translationsNote: Depends on [3] If you have filtered a view by entity translation language, and a given entity item doesn't have a translation in that language, should there be a fallback so the entity still appears in the view?

Note: you can accomplish this with a view by Filtering to default language only (to eliminate duplicates) and then change "Rendering Language" to "Interface text language selected for page" to have the nodes show the selected language IF it's available. Found solution in comments of this: https://drupal.stackexchange.com/questions/192782/how-do-i-get-views-con...
[5] Remove field-level language filters [DONE]#2218025: Field language filter/sort/etc. for Views do not work and are not neededField-level language filters exist now but don't make sense if rows are translations and fields are connected correctly to the rows (picking out translations)
[6] Translate the display properly Remaining main issue: #2393339: [META] Make sure Views base fields are using Field API for formatting, and do not lose functionality and related/sub issues (see right column).

This will make sure that all fields can be translated (currently base fields cannot be). The solution is to make the Entity field plugins support base fields, which means that the base fields will be using regular Entity formatters instead of Views-specific formatters, and change the base fields in their Views data classes to use Entity field handlers instead of Views-specific handlers.

Past/closed/duplicate issues on this subject:
- #2006606: Views rendering ignores entity language, eg: Identical nodes rendered in views when nodes have translations
- #2149649: Entity rendering/theming does not use the active entity language to render links
- #2394041: Row language settings from entity views should be on display level for all views
- #2217569: Fields row plugin: Translation is non-uniform for base fields, Field UI fields, links; no way to choose "this row's language"
- #2407801: Views generic field handler does not work with base fields
- #2394883: Language setup for entity and field based rendering in views is independent, confusing UI, lacking test coverage
- #2429447: Use data table as views base table, if available.

When this issue was originally filed, if your Views display used entity view modes, they were displayed using your choice of the row's language, the original language of the entity, or the page language, and this setting was on the Row plugin. Field-based views had a setting for Field Language, which was hidden in the "Advanced" setting on the Display plugin, with options only for static languages (English, French, etc.). And only Field UI fields, not base fields like Title, obeyed the Field Language setting. So... The plan:
(a) Unify the language settings and their options for Field and Entity views [this is done]
(b) Put the settings on the Display (not the Row plugin) [this is done]
(c) Make translation work for Base fields as well as Field UI fields [still to do].
Once this issue is done, we need to do a few final manual tests (and file issues/add test coverage if problems are located):
  • Make sure that the display is actually working right for both Entity and Field based views: base fields, Field API fields, entity view modes.
  • Test using static language choices, plus "original language of entity" (or whatever that is called in the UI, "row language" (or whatever that is called) and "page language" (negotiated/selected language)
  • Test field-based views with relationships, such as Entity Reference fields, Taxonomy fields, and node author, and make sure these are working right with respect to number of rows in the result and display language. All fields from all entities should be displayed in the same language.
  • Test links: should be going to the entity consistent with the data display (so if this row is in Spanish the link should go to es/node/1 or whatever). Types of links to test: stand-alone (like the Edit link and View link pseudo-fields), automatic (if you have an entity and you check the box that says "include links" or something like that), on fields like Node title that have their own specific plugins and a "link this back to the node" option, and on short string generic entity fields with "link this back" box checked.

(I did part of this testing on 7 Oct 2015 on #2450195: Original language of entities not accessible in views anymore comments 17 and onwards that day).

Additional related issues, child issues, and follow-ups:
- #2582535: Duplicated rows on admin/content if author is translated
- #2582499: User views - user links are not localized
- #2450195: Original language of entities not accessible in views anymore
- #2450205: Translation settings don't appear for node in standard.
- #2420737: Differences in dynamic language names are confusing in views, content, etc.
- #2508892: "Content language of view row" rendering option does not always ensure row language is present

[7] UI: Language choice labels DONE!#2037979: "Current user's language" views filter label is named very misleadingThe language choice called "Current user's language" really means "The negotiated language". This label is confusing and needs an update.
[8] Update help and documentationThe help and documentation needs to explain this stuff
[9] Field-based multilingual views with relationships do not work Fixed as part of a different issue.#2446681: [PP-1] Error "Column 'langcode' in field list is ambiguous" thrown due to TranslationLanguageRenderer not rendering a field from a relationshipIf you create a field-based multilngual view with relationships, and try to display Field UI fields in the view, you get an SQL exception.
[10] Views with non-translatable fields seem to be somewhat broken#2451657: Views should not condition joins on the langcode of fields that are not translatableIf you have a translatable entity with a non-translatable field on it, and use that field in a view, it will try to use a nonexistent langcode database field.
[11] Views with bulk operations (admin views) are confusing Done!Since views show translations and entity bulk operations operate on the entities as a whole, it could lead to confusion and loss of data
[12] Glossary Ajax doesn't work with multilingual#2600804: AJAXified glossary view arguments fail when Language URL detection enabled
Viewing all 295812 articles
Browse latest View live


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