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

Add a way to get the dedicated revision table of a field from TableMappingInterface

$
0
0

Problem/Motivation

The purpose of TableMappingInterface is to be the only API you need to interact with if you want to get database-specific information about an entity type stored in SQL storage. However, there is no way of getting the table which stores individual revisions, if the SQL storage chooses to use separate tables for default / all revisions.

The consequence is that all places that need this information are forced to use core's table mapping implementation (DefaultTableMapping), which makes the interface kind of useless and prevents alternative SQL storage / table mapping implementations.

Proposed resolution

Add a getFieldRevisionTableName() method to TableMappingInterface and implement it in DefaultTableMapping

Remaining tasks

Discuss / review.

User interface changes

Nope.

API changes

API addition: a new method is added to TableMappingInterface. This change is allowed by our BC policy since we have a base class for it: DefaultTableMapping

Data model changes

Nope.


Allow Attachments on Embed Displays

$
0
0

Attachments currently are not able to be added to Embed displays. It seems like this should be allowed.

Add new "Check for updates" option - NEVER

$
0
0

Hi

There are two available options for "Check for updates" frequency currently: Daily and Weekly.

admin/reports/updates/settings

It would be nice to have option "Never" - which would put core update module on some kind of "sleep" so that it does not have big impact on performance although it is installed.

Currently, there is no such option, so if we want update module not to check for updates we have to uninstall it - and install it again later when we want to check for updates again.

The idea of new "Check for updates" frequency radio option "Never" would be to make this switching the module on/off much easier.

Provide a script to install a Drupal testsite

$
0
0

Problem/Motivation

As part of #2869825: Leverage JS for JS testing (using nightwatch) we need to allow nightwatch to install Drupal, so we can test a site in isolation.

Proposed resolution

  • Add a command to install Drupal
  • This command allows to specify the installation profile and a file to setup additional configuration
  • Nightwatch then can run this command from node.

Test instructions

After applying the patch there will be new commands to install a test site and tear it down. To install a test site run:

php core/scripts/test-site.php install --json

This will output information about the test site in a JSON format if successful. For example:

{"db_prefix":"test22029735","user_agent":"simpletest22029735:1518188974:5a7db9aee752c4.29037117:Vvw9BjAc-58eRlb95RphcXV4Xeb72-eWTba4XYtc4pY"}

To tear down the site:

php core/scripts/test-site.php tear-down test22029735

Other features:

// Get general help.
php core/scripts/test-site.php

// Get specific help.
php core/scripts/test-site.php  install --help
php core/scripts/test-site.php  tear-down --help

Remaining tasks

User interface changes

API changes

Data model changes

[META] Multilingual migrations / i18n meta issue

$
0
0

Problem/Motivation

Migrate multilingual data from D6 and D7.

Proposed resolution

D6 migration and much of D7 is working so use those migrations, and their plugins as models for these migrations. It is preferred to improve the existing destination plugins instead of creating new ones.

Remaining tasks

Because D6 is nearing end of life, the D6 multilingual migrations are the highest priority as shown in the list below.

Top Priority

Drupal 6 nodes and configuration settings to support nodes.

Medium Priority

Low Priority

Add config validation for machine names

$
0
0

Problem/Motivation

Config entities require validation for REST support. Add a generic "machine_name" type and validate the value.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

[PHP 7.2] DrupalKernel.php: ini_set(): Headers already sent

$
0
0

I'm using PHP 7.2.0alpha2 where below command doesn't work, but it works in PHP 7.0.20.

And I've the following warnings when installing Drupal from scratch by drush quick-drupal, e.g.

$ drush qd
Project drupal (8.3.6) downloaded to drupal8/quick-drupal-20170812152339/drupal.     [success]
Project drupal contains:                                                                                 [success]
 - 1 profile: standard
 - 14 themes: stark, stable, seven, twig, classy, bartik, testing_multilingual_with_english,
testing_multilingual, testing_missing_dependencies, testing_config_overrides, testing_config_import,
drupal_system_listing_compatible_test, testing, minimal
 - 73 modules: workflows, views_ui, views, user, update, tracker, tour, toolbar, text, telephone,
taxonomy, system, syslog, statistics, simpletest, shortcut, serialization, search, rest,
responsive_image, rdf, quickedit, path, page_cache, outside_in, options, node, migrate_drupal_ui,
migrate_drupal, migrate, menu_ui, menu_link_content, locale, link, layout_discovery, language,
inline_form_errors, image, history, help, hal, forum, filter, file, field_ui, field_layout, field,
entity_reference, editor, dynamic_page_cache, dblog, datetime_range, datetime, contextual,
content_translation, content_moderation, contact, config_translation, config, comment, color, ckeditor,
breakpoint, book, block_place, block_content, block, big_pipe, basic_auth, ban, automated_cron,
aggregator, action

You are about to create a drupal8/quick-drupal-20170812152339/drupal/sites/default/settings.php file and CREATE the 'sites/default/files/quick-drupal-20170812152339.sqlite' database. Do you want to continue? (y/n): y
ini_set(): Headers already sent. You cannot change the session module's ini settings at this time        [warning]
DrupalKernel.php:971
ini_set(): Headers already sent. You cannot change the session module's ini settings at this time        [warning]
DrupalKernel.php:972
ini_set(): Headers already sent. You cannot change the session module's ini settings at this time        [warning]
DrupalKernel.php:973
ini_set(): Headers already sent. You cannot change the session module's ini settings at this time        [warning]
DrupalKernel.php:976
ini_set(): Headers already sent. You cannot change the session module's ini settings at this time        [warning]
DrupalKernel.php:978
PHP Deprecated:  assert(): Calling assert() with a string argument is deprecated in drupal8/quick-drupal-20170812152339/drupal/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php on line 151

Code:

    // Use session cookies, not transparent sessions that puts the session id in
    // the query string.
    ini_set('session.use_cookies', '1');
    ini_set('session.use_only_cookies', '1');
    ini_set('session.use_trans_sid', '0');
    // Don't send HTTP headers using PHP's session handler.
    // Send an empty string to disable the cache limiter.
    ini_set('session.cache_limiter', '');
    // Use httponly session cookies.
    ini_set('session.cookie_httponly', '1');

Slow query > 30 seconds in quickedit module

$
0
0

Problem/Motivation

Just found the following query taking 30 seconds on a production site:

SELECT base_table.vid AS vid, base_table.nid AS nid
FROM
node_revision base_table
LEFT OUTER JOIN node_revision base_table_2 ON base_table.nid = base_table_2.nid AND base_table.vid < base_table_2.vid
INNER JOIN node_field_data node_field_data ON node_field_data.nid = base_table.nid
WHERE (base_table_2.nid IS NULL) AND (node_field_data.nid = '159550')

This is from _quickedit_entity_is_latest_revision() but we should check the API queries added by #2926483: Add API methods for determining whether an entity object is the latest (translation-affecting) revision like getLatestRevisionId() too.

The EXPLAIN is fairly clean:

EXPLAIN SELECT base_table.vid AS vid, base_table.nid AS nid FROM node_revision base_table LEFT OUTER JOIN node_revision base_table_2 ON base_table.nid = base_table_2.nid AND base_table.vid < base_table_2.vid INNER JOIN node_field_data node_field_data ON node_field_data.nid = base_table.nid WHERE (base_table_2.nid IS NULL) AND (node_field_data.nid = '159550');

It could be the NOT EXISTS maybe? Otherwise there's not really a clue in the EXPLAIN.

+------+-------------+-----------------+------+----------------------------------------------+-----------+---------+---------------------------------+------+--------------------------------------+
| id   | select_type | table           | type | possible_keys                                | key       | key_len | ref                             | rows | Extra                                |
+------+-------------+-----------------+------+----------------------------------------------+-----------+---------+---------------------------------+------+--------------------------------------+
|    1 | SIMPLE      | node_field_data | ref  | PRIMARY,node__id__default_langcode__langcode | PRIMARY   | 4       | const                           |    1 | Using index                          |
|    1 | SIMPLE      | base_table      | ref  | node__nid                                    | node__nid | 4       | tag1updates.node_field_data.nid |    1 | Using index                          |
|    1 | SIMPLE      | base_table_2    | ref  | PRIMARY,node__nid                            | node__nid | 4       | tag1updates.node_field_data.nid |    1 | Using where; Using index; Not exists |
+------+-------------+-----------------+------+----------------------------------------------+-----------+---------+---------------------------------+------+--------------------------------------+
3 rows in set (0.00 sec)

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes


Allow contributed modules to alter the format_date() function result.

$
0
0

Drupal doesn't support other calendars, Solar Calendar(Gregorian calendar)
here is some works for supporting it using a module. However, it needs a custom hook to be added, which means editing common.inc

Drupal did a great job supporting RTL languages and include many translations. Now we need to step it up in 8.x
I basically added the custom hoon into common.inc
If you have a better way please do inform me.
PS: this hook can be used for all kinds of Calendar systems, more info http://drupal.org/project/calendar_systems

Fix simultaneous file uploads re-posting data

$
0
0

Problem/Motivation

In Drupal, all uploads posting via Ajax ($.ajaxSubmit). $.ajaxSubmit is posting FULL FORM DATA all time. Therefore when you uploading files simultaneously, the seconds and later uploads always re-upload previous file data.

In my testing, I trying to upload 2 files (20MB & 30MB). Here's the Content-Length for each posting:

FIRST INPUT:
Content-Length: 31647757

SECOND INPUT:
Content-Length: 53387537

Steps to reproduce:

1. Find a slow server / Or throttling via Proxy or Chrome Console / Or find a timer
2. Setup 2 file uploads
3. Starting to upload a large file to INPUT 1
4. During INPUT 1 is uploading, starting to upload another large file to INPUT 2
5. Check posting data length / upload time

(Noted that: You shouldn't trust Chrome Console throttling all time, in some cases won't work well.)

Proposed resolution

There is code to make an upload button disable file fields for other upload buttons, but it checks to see if the upload button use the Drupal AJAX API, even though the file upload buttons do not use that API. It is fixed by removing this check.

Make TestServiceProvider more readable (cleanup)

Updating from 8.4.5 8.5.0

$
0
0

Tried upgrading to 8.4.5 to 8.5.0

To reproduce is pretty easy leave all folders apart from sites themes mod
and upload 8.5.0

To fix i am unsure maybe try a different theme or upgrading path first

Can't reset cache either gave the log bellow

Going to downgrade to 8.4.5 see if that fixes the problem for now

[11-Mar-2018 23:13:55 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:14:09 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:14:46 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:15:28 Europe/London] Uncaught PHP Exception Twig_Error_Loader: "Template "core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig" is not defined (Drupal\Core\Template\Loader\ThemeRegistryLoader: Unable to find template "core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig" in the Drupal theme registry.)." at /home/kbos2wd/public_html/core/themes/classy/templates/layout/html.html.twig line 51
[11-Mar-2018 23:15:39 Europe/London] Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginNotFoundException: "The "file_uri" plugin does not exist." at /home/kbos2wd/public_html/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php line 52
[11-Mar-2018 23:17:03 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:17:20 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:18:25 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:19:12 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:19:18 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:19:52 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:19:59 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:20:05 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:20:50 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:20:53 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:22:29 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:22:42 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:22:51 Europe/London] Twig_Error_Loader: Template "core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig" is not defined (Drupal\Core\Template\Loader\ThemeRegistryLoader: Unable to find template "core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig" in the Drupal theme registry.). in /home/kbos2wd/public_html/core/themes/classy/templates/layout/html.html.twig on line 51 #0 /home/kbos2wd/public_html/core/lib/Drupal/Core/Template/TwigEnvironment.php(113): Twig_Loader_Chain->getCacheKey('core/modules/se...')
#1 /home/kbos2wd/public_html/vendor/twig/twig/lib/Twig/Environment.php(424): Drupal\Core\Template\TwigEnvironment->getTemplateClass('core/modules/se...')
#2 /home/kbos2wd/public_html/core/themes/engines/twig/twig.engine(64): Twig_Environment->loadTemplate('core/modules/se...')
#3 /home/kbos2wd/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('core/modules/se...', Array)
#4 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(493): Drupal\Core\Theme\ThemeManager->render('settings_tray_p...', Array)
#5 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#6 /home/kbos2wd/public_html/core/lib/Drupal/Core/Template/TwigExtension.php(490): Drupal\Core\Render\Renderer->render(Array)
#7 /home/kbos2wd/public_html/sites/default/files/php/twig/5aa5b23a74215_html.html.twig_gQv-GORxUVif_Pag4s-5z2NkO/ij0iO2FU1eARqVkdJh7l7PZCaH6AT5SPePgzVB4bWQ0.php(90): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#8 /home/kbos2wd/public_html/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_be8c7bbb9c824f2826368d7c8da984c6279779db72a67fd8056a00bb23b816f2->doDisplay(Array, Array)
#9 /home/kbos2wd/public_html/vendor/twig/twig/lib/Twig/Template.php(403): Twig_Template->displayWithErrorHandling(Array, Array)
#10 /home/kbos2wd/public_html/vendor/twig/twig/lib/Twig/Template.php(411): Twig_Template->display(Array)
#11 /home/kbos2wd/public_html/core/themes/engines/twig/twig.engine(64): Twig_Template->render(Array)
#12 /home/kbos2wd/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('core/themes/cla...', Array)
#13 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(437): Drupal\Core\Theme\ThemeManager->render('html', Array)
#14 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, true)
#15 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(139): Drupal\Core\Render\Renderer->render(Array, true)
#16 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#17 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(140): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#18 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/BareHtmlPageRenderer.php(66): Drupal\Core\Render\Renderer->renderRoot(Array)
#19 /home/kbos2wd/public_html/core/lib/Drupal/Core/ProxyClass/Render/BareHtmlPageRenderer.php(76): Drupal\Core\Render\BareHtmlPageRenderer->renderBarePage(Array, Object(Drupal\Core\StringTranslation\TranslatableMarkup), 'maintenance_pag...', Array)
#20 /home/kbos2wd/public_html/core/modules/system/src/Controller/DbUpdateController.php(196): Drupal\Core\ProxyClass\Render\BareHtmlPageRenderer->renderBarePage(Array, Object(Drupal\Core\StringTranslation\TranslatableMarkup), 'maintenance_pag...', Array)
#21 [internal function]: Drupal\system\Controller\DbUpdateController->handle('info', Object(Symfony\Component\HttpFoundation\Request))
#22 /home/kbos2wd/public_html/core/lib/Drupal/Core/Update/UpdateKernel.php(110): call_user_func_array(Array, Array)
#23 /home/kbos2wd/public_html/core/lib/Drupal/Core/Update/UpdateKernel.php(73): Drupal\Core\Update\UpdateKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request))
#24 /home/kbos2wd/public_html/update.php(28): Drupal\Core\Update\UpdateKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#25 {main}
[11-Mar-2018 23:22:59 Europe/London] Twig_Error_Loader: Template "core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig" is not defined (Drupal\Core\Template\Loader\ThemeRegistryLoader: Unable to find template "core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig" in the Drupal theme registry.). in /home/kbos2wd/public_html/core/themes/classy/templates/layout/html.html.twig on line 51 #0 /home/kbos2wd/public_html/core/lib/Drupal/Core/Template/TwigEnvironment.php(113): Twig_Loader_Chain->getCacheKey('core/modules/se...')
#1 /home/kbos2wd/public_html/vendor/twig/twig/lib/Twig/Environment.php(424): Drupal\Core\Template\TwigEnvironment->getTemplateClass('core/modules/se...')
#2 /home/kbos2wd/public_html/core/themes/engines/twig/twig.engine(64): Twig_Environment->loadTemplate('core/modules/se...')
#3 /home/kbos2wd/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('core/modules/se...', Array)
#4 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(493): Drupal\Core\Theme\ThemeManager->render('settings_tray_p...', Array)
#5 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#6 /home/kbos2wd/public_html/core/lib/Drupal/Core/Template/TwigExtension.php(490): Drupal\Core\Render\Renderer->render(Array)
#7 /home/kbos2wd/public_html/sites/default/files/php/twig/5aa5b23a74215_html.html.twig_gQv-GORxUVif_Pag4s-5z2NkO/ij0iO2FU1eARqVkdJh7l7PZCaH6AT5SPePgzVB4bWQ0.php(90): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#8 /home/kbos2wd/public_html/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_be8c7bbb9c824f2826368d7c8da984c6279779db72a67fd8056a00bb23b816f2->doDisplay(Array, Array)
#9 /home/kbos2wd/public_html/vendor/twig/twig/lib/Twig/Template.php(403): Twig_Template->displayWithErrorHandling(Array, Array)
#10 /home/kbos2wd/public_html/vendor/twig/twig/lib/Twig/Template.php(411): Twig_Template->display(Array)
#11 /home/kbos2wd/public_html/core/themes/engines/twig/twig.engine(64): Twig_Template->render(Array)
#12 /home/kbos2wd/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('core/themes/cla...', Array)
#13 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(437): Drupal\Core\Theme\ThemeManager->render('html', Array)
#14 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, true)
#15 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(139): Drupal\Core\Render\Renderer->render(Array, true)
#16 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#17 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(140): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#18 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/BareHtmlPageRenderer.php(66): Drupal\Core\Render\Renderer->renderRoot(Array)
#19 /home/kbos2wd/public_html/core/lib/Drupal/Core/ProxyClass/Render/BareHtmlPageRenderer.php(76): Drupal\Core\Render\BareHtmlPageRenderer->renderBarePage(Array, Object(Drupal\Core\StringTranslation\TranslatableMarkup), 'maintenance_pag...', Array)
#20 /home/kbos2wd/public_html/core/modules/system/src/Controller/DbUpdateController.php(196): Drupal\Core\ProxyClass\Render\BareHtmlPageRenderer->renderBarePage(Array, Object(Drupal\Core\StringTranslation\TranslatableMarkup), 'maintenance_pag...', Array)
#21 [internal function]: Drupal\system\Controller\DbUpdateController->handle('info', Object(Symfony\Component\HttpFoundation\Request))
#22 /home/kbos2wd/public_html/core/lib/Drupal/Core/Update/UpdateKernel.php(110): call_user_func_array(Array, Array)
#23 /home/kbos2wd/public_html/core/lib/Drupal/Core/Update/UpdateKernel.php(73): Drupal\Core\Update\UpdateKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request))
#24 /home/kbos2wd/public_html/update.php(28): Drupal\Core\Update\UpdateKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#25 {main}
[11-Mar-2018 23:23:22 Europe/London] Uncaught PHP Exception Twig_Error_Loader: "Template "core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig" is not defined (Drupal\Core\Template\Loader\ThemeRegistryLoader: Unable to find template "core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig" in the Drupal theme registry.)." at /home/kbos2wd/public_html/core/themes/classy/templates/layout/html.html.twig line 51
[11-Mar-2018 23:25:31 Europe/London] Twig_Error_Loader: Template "core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig" is not defined (Drupal\Core\Template\Loader\ThemeRegistryLoader: Unable to find template "core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig" in the Drupal theme registry.). in /home/kbos2wd/public_html/core/themes/classy/templates/layout/html.html.twig on line 51 #0 /home/kbos2wd/public_html/core/lib/Drupal/Core/Template/TwigEnvironment.php(113): Twig_Loader_Chain->getCacheKey('core/modules/se...')
#1 /home/kbos2wd/public_html/vendor/twig/twig/lib/Twig/Environment.php(424): Drupal\Core\Template\TwigEnvironment->getTemplateClass('core/modules/se...')
#2 /home/kbos2wd/public_html/core/themes/engines/twig/twig.engine(64): Twig_Environment->loadTemplate('core/modules/se...')
#3 /home/kbos2wd/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('core/modules/se...', Array)
#4 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(493): Drupal\Core\Theme\ThemeManager->render('settings_tray_p...', Array)
#5 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, false)
#6 /home/kbos2wd/public_html/core/lib/Drupal/Core/Template/TwigExtension.php(490): Drupal\Core\Render\Renderer->render(Array)
#7 /home/kbos2wd/public_html/sites/default/files/php/twig/5aa5b23a74215_html.html.twig_gQv-GORxUVif_Pag4s-5z2NkO/ij0iO2FU1eARqVkdJh7l7PZCaH6AT5SPePgzVB4bWQ0.php(90): Drupal\Core\Template\TwigExtension->escapeFilter(Object(Drupal\Core\Template\TwigEnvironment), Array, 'html', NULL, true)
#8 /home/kbos2wd/public_html/vendor/twig/twig/lib/Twig/Template.php(432): __TwigTemplate_be8c7bbb9c824f2826368d7c8da984c6279779db72a67fd8056a00bb23b816f2->doDisplay(Array, Array)
#9 /home/kbos2wd/public_html/vendor/twig/twig/lib/Twig/Template.php(403): Twig_Template->displayWithErrorHandling(Array, Array)
#10 /home/kbos2wd/public_html/vendor/twig/twig/lib/Twig/Template.php(411): Twig_Template->display(Array)
#11 /home/kbos2wd/public_html/core/themes/engines/twig/twig.engine(64): Twig_Template->render(Array)
#12 /home/kbos2wd/public_html/core/lib/Drupal/Core/Theme/ThemeManager.php(384): twig_render_template('core/themes/cla...', Array)
#13 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(437): Drupal\Core\Theme\ThemeManager->render('html', Array)
#14 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(195): Drupal\Core\Render\Renderer->doRender(Array, true)
#15 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(139): Drupal\Core\Render\Renderer->render(Array, true)
#16 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(582): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#17 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/Renderer.php(140): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#18 /home/kbos2wd/public_html/core/lib/Drupal/Core/Render/BareHtmlPageRenderer.php(66): Drupal\Core\Render\Renderer->renderRoot(Array)
#19 /home/kbos2wd/public_html/core/lib/Drupal/Core/ProxyClass/Render/BareHtmlPageRenderer.php(76): Drupal\Core\Render\BareHtmlPageRenderer->renderBarePage(Array, Object(Drupal\Core\StringTranslation\TranslatableMarkup), 'maintenance_pag...', Array)
#20 /home/kbos2wd/public_html/core/modules/system/src/Controller/DbUpdateController.php(196): Drupal\Core\ProxyClass\Render\BareHtmlPageRenderer->renderBarePage(Array, Object(Drupal\Core\StringTranslation\TranslatableMarkup), 'maintenance_pag...', Array)
#21 [internal function]: Drupal\system\Controller\DbUpdateController->handle('info', Object(Symfony\Component\HttpFoundation\Request))
#22 /home/kbos2wd/public_html/core/lib/Drupal/Core/Update/UpdateKernel.php(110): call_user_func_array(Array, Array)
#23 /home/kbos2wd/public_html/core/lib/Drupal/Core/Update/UpdateKernel.php(73): Drupal\Core\Update\UpdateKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request))
#24 /home/kbos2wd/public_html/update.php(28): Drupal\Core\Update\UpdateKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#25 {main}
[11-Mar-2018 23:25:45 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:27:05 Europe/London] Uncaught PHP Exception InvalidArgumentException: "Field is unknown." at /home/kbos2wd/public_html/core/lib/Drupal/Core/Entity/ContentEntityBase.php line 580
[11-Mar-2018 23:27:23 Europe/London] Uncaught PHP Exception Twig_Error_Loader: "Template "core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig" is not defined (Drupal\Core\Template\Loader\ThemeRegistryLoader: Unable to find template "core/modules/settings_tray/templates/settings-tray-page-wrapper.html.twig" in the Drupal theme registry.)." at /home/kbos2wd/public_html/core/themes/classy/templates/layout/html.html.twig line 51

"file_uri" plugin does not exist

$
0
0

Updating from 8.4.5 to 8.5 i get following error message on database update via update.php:

views-Modul
Update #8500
Failed: Drupal\Component\Plugin\Exception\PluginNotFoundException: The "file_uri" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (Zeile 52 in /core/lib/

Cannot use relationship for rendered entity on Views

$
0
0

Problem/Motivation

You cannot create a view and try to list rendered entities using relationship.

Steps to reproduce (based on Standard profile):

  1. Add an entity reference field named "field_content" to the "page" content type. Allow content > article references.
  2. Create and edit a content view.
  3. Add a relationship for "Content using field_content." or "Content referenced from field_content."
  4. The row style plugin is "Content" by default.
  5. Click on "Teaser" in order to change the view mode, nothing happens.
  6. You can't choose a view mode even if you don't want to actually use a relationship, just having one on your view triggers this.

The problem is a fatal AJAX error triggered when RowPluginBase::buildOptionsForm() calls RelationshipPluginBase::init() while providing a wrong argument type (Array instead of DisplayPluginBase).

Argument 2 passed to Drupal\views\Plugin\views\relationship\RelationshipPluginBase::init() must be an instance of Drupal\views\Plugin\views\display\DisplayPluginBase, array given, called in /app/web/core/modules/views/src/Plugin/views/row/RowPluginBase.php on line 93

Proposed resolution

Fix it, by passing along the relationship as needed and using it.

Remaining tasks

None.

User interface changes

None

API changes

None

 

Contributor tasks needed
TaskNovice task?Contributor instructionsComplete?
Create a patchInstructionsExtract the test code + yml file out of the patch in #26

Entity::uriRelationships() throws exceptions if an URL cannot be generated because of missing mandatory parameters

$
0
0

Problem/Motivation

If there is a link template with mandatory parameters the url cannot be generated without providing those parameters. If we try to build the url without the mandatory parameters the exception Symfony\Component\Routing\Exception\MissingMandatoryParametersException will be thrown.

The entity predelete hook menu_link_content_entity_predelete introduced in #2350797: Orphaned menu links when nodes are deleted if menu_link_ui is not enabled is the one that introduced the problem by calling \Drupal\Core\Entity\EntityInterface::uriRelationships().

This might occur if the diff module is used and a link template like this is added:
"revisions-diff" = "/custom_entity/{custom_entity}/revision/{left_revision}/{right_revision}/{filter}"

This is a major as it prevents deleting entities having such link templates and there is no workaround for this.

Proposed resolution

\Drupal\Core\Entity\EntityInterface::uriRelationships() should catch exceptions of the type MissingMandatoryParametersException.

Remaining tasks

User interface changes

API changes

Data model changes


Moderation state field cannot be updated via REST, because special handling in ModerationStateFieldItemList

$
0
0

Problem/Motivation

50-50 chance of this being a problem with Rest module or with Content Moderation, tagged against the former for now.

Updating the moderation_state field of an entity that is moderated by Content Moderation via Rest does not work.

Doing so yields:

Unprocessable Entity: validation failed.
moderation_state: Moderation state: this field cannot hold more than 1 values.

Note that I tried this with JSON, not with HAL, but I think denormalization should be the same for both.

The reason is that FieldableEntityNormalizerTrait::denormalizeFieldData() first removes any existing items via $field_item_list->setValue([]) and then \Drupal\serialization\Normalizer\FieldNormalizer::denormalize() adds a new item with the incoming data via $items->appendItem().

But because ModerationStateFieldItemList goes out of its way to never be empty the setValue() call does not actually lead to the item being removed. Then appendItem() will find the already existing item and gladly add another one.

Proposed resolution

?

Toolbar Height calculation to accommodate hidden tabs

$
0
0

Problem/Motivation

As seen in the attached screenshot, the Toolbar is overlapping the heading of the page.

The admin toolbar applies a padding to the top of the body element that should be equal to its height to ensure content is lost underneath it.

However in the following scenario the height calculation is incorrect:

The Settings Tray module adds a tab to the toolbar with a class of hidden. It's the first element inside #toolbar-bar.

Bootstrap css defines .hidden as display: none !important;

In ToolbarVisualView.js the updateToolbarHeight method sets toolbarTabOuterHeight by getting the outerHeight of the first.toolbar-tab.

var toolbarTabOuterHeight = $('#toolbar-bar').find('.toolbar-tab').outerHeight() || 0;

Because the first tab is hidden (and crucially, because of bootstrap it has !important), the outerHeight is 0px and thus the body receives a top padding of 0px.

Here is an example of calculating the height on an element that is display: none!important.
https://jsfiddle.net/marmite/d9oma2e3/7/

The jQuery documentation for outerHeight says:
The value reported by .outerHeight() is not guaranteed to be accurate when the element or its parent is hidden. To get an accurate value, ensure the element is visible before using .outerHeight(). jQuery will attempt to temporarily show and then re-hide an element in order to measure its dimensions, but this is unreliable and (even when accurate) can significantly impact page performance. This show-and-rehide measurement feature may be removed in a future version of jQuery.

Proposed resolution

Perhaps just ensure the tab it selects to get the height isn't hidden.

var toolbarTabOuterHeight = $('#toolbar-bar').find('.toolbar-tab').filter(':visible').outerHeight() || 0;

Simplify \Drupal\Core\Entity\Query\Sql\Tables::addField() a little

$
0
0

Problem/Motivation

\Drupal\Core\Entity\Query\Sql\Tables::addField() needlessly repeats some code in an if/else branch.

Proposed resolution

Move the repeated code out of the condition.

Remaining tasks

Review.

User interface changes

Nope.

API changes

Nope.

Data model changes

Nope.

Views pagers include ajax metadata

$
0
0

When on a view with an ajax pager, and after at least one ajax load, the links to the next pages will include a bunch of extra metadata related to ajax requests. Specifically ajax_page_state and _wrapper_format are included as query parameters. If you try to load this link, Drupal will return a bunch of JSON instead of rendering the page.

Steps to reproduce:

  1. Install latest Drupal 8.2.x
  2. Create 10 dummy articles
  3. Create a view of content with a page display at /test-ajax-pager
  4. Add a full pager, limit to 2 items shown per page
  5. Under advanced, set Use AJAX to Yes
  6. Go to /test-ajax-pager and click the link for page 2
  7. Copy the link for page 3, and open in a new browser window

Here's an example of what the link looks like /test-ajax-pager?ajax_page_state%5Btheme%5D=bartik&ajax_page_state%5Btheme_token%5D=&ajax_page_state%5Blibraries%5D=bartik%2Fglobal-styling%2Cclassy%2Fbase%2Cclassy%2Fmessages%2Ccontextual%2Fdrupal.contextual-links%2Ccontextual%2Fdrupal.contextual-toolbar%2Ccore%2Fdrupal.active-link%2Ccore%2Fhtml5shiv%2Ccore%2Fnormalize%2Cquickedit%2Fquickedit%2Cshortcut%2Fdrupal.shortcut%2Csystem%2Fbase%2Ctoolbar%2Ftoolbar%2Ctoolbar%2Ftoolbar.escapeAdmin%2Ctour%2Ftour%2Cuser%2Fdrupal.user.icons%2Cviews%2Fviews.ajax%2Cviews%2Fviews.module&_wrapper_format=drupal_ajax&page=2 and here's what it should look like /test-ajax-pager?page=2

NegotiationMiddleware calls $request->setRequestFormat('html') when there is no _format request parameter, but shouldn't

$
0
0

Problem/Motivation

This core bug blocks this JSON API contrib module issue: #2831137: Remove the need for ?_format=api_json: assume the use of the 'api_json' format for routes managed by JSON API.

Observation 1

Currently, the fallback for \Drupal\Core\StackMiddleware\NegotiationMiddleware::getContentType() (i.e. if no ?_format= querystring is specified) is this:

    // Do HTML last so that it always wins.
    return 'html';

And \Drupal\Core\StackMiddleware\NegotiationMiddleware::handle() does this:

    // Determine the request format using the negotiator.
    if ($requested_format = $this->getContentType($request)) {
      $request->setRequestFormat($requested_format);
    }

The end result is that $requested_format is never empty. It always is set to 'html'.

Observation 2

Now let's look at \Symfony\Component\HttpFoundation\Request::getRequestFormat(), which is what the router (and controllers) use to determine the request format

    /**
     * Gets the request format.
     *
     * Here is the process to determine the format:
     *
     *  * format defined by the user (with setRequestFormat())
     *  * _format request parameter
     *  * $default
     *
     * @param string $default The default format
     *
     * @return string The request format
     */
    public function getRequestFormat($default = 'html')
    {
        if (null === $this->format) {
            $this->format = $this->get('_format', $default);
        }

        return $this->format;
    }

Result

The result is that Request::getRequestFormat()'s $default parameter is broken in Drupal, because NegotiationMiddlewarealways sets it to 'html'. Even when there is no _format request parameter.

In other words: NegotiationMiddleware breaks the Symfony Request API.

Proposed resolution

Only let NegotiationMiddleware call Request::setFormat() when there actually is a _format request parameter.

Remaining tasks

TBD

User interface changes

None.

API changes

None.

Data model changes

None.

Viewing all 293211 articles
Browse latest View live


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