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

FieldItemNormalizer to not flatten if one property and getMainPropertyName is NULL

$
0
0

Problem/Motivation

JSON:API has a nice feature in that it flattens a Drupal field value so we don't have pesky value sub-properties on things like string, boolean, email, etc fields. This is great, except when you want your field type to have a forced sub-property.

In the Commerce API module being developed we have a billing_information field that has at least an address property and may have more, such as a tax number or phone number.

Currently, the billing_information field just displays all of the address item values as root properties, causing a broken schema.

The relevant code is: https://git.drupalcode.org/project/drupal/blob/8.8.x/core/modules/jsonap...

      $field_properties = TypedDataInternalPropertiesHelper::getNonInternalProperties($field_item);
      // Flatten if there is only a single property to normalize.
      $values = static::rasterizeValueRecursive(count($field_properties) == 1 ? reset($values) : $values);

getNonInternalProperties will return properties that are not computed or marked internal.

I had to make this workaround for myself:

  /**
   * {@inheritdoc}
   */
  public function normalize($object, $format = NULL, array $context = []) {
    assert($object instanceof Address);
    // Work around for JSON:API's normalization of FieldItems. If there is only
    // one root property in the field item, it will flatten the values. We do
    // not want that for the OrderProfile field, as `address` should be present.
    // This only happens if there is one field on the profile.
    // @see \Drupal\jsonapi\Normalizer\FieldItemNormalizer::normalize
    // @todo open issue FieldItemNormalizer::normalize should ignore if mainPropertyName is NULL.
    $parent = $object->getParent();
    if ($parent instanceof OrderProfile) {
      $field_properties = TypedDataInternalPropertiesHelper::getNonInternalProperties($parent);
      if (count($field_properties) === 1) {
        // This ensures the value is always under an `address` property.
        return ['address' => array_filter($object->getValue())];
      }
    }
    return array_filter($object->getValue());
  }

Proposed resolution

If there is one property returned by TypedDataInternalPropertiesHelper::getNonInternalProperties, check if it matches the main property value. In most cases it will, or getMainPropertyName wil be NULL. If it doesn't match, then do not flatten the field values. Often times getMainPropertyName returns NULL If the field type has multiple properties for its value and there cannot be a single property used (ie: price field, you need the number and currency.)

Remaining tasks

User interface changes

None.

API changes

JSON:API will no longer flatten field types which return NULL or a main property name which does not match the single property returned.

Data model changes

None.

Release notes snippet


MySql driver throws a generic DatabaseExceptionWrapper for integrity violation at insertion when column has no default

$
0
0

Problem/Motivation

Coming from #2993663-23: Deprecate Schema::fieldSetDefault and Schema::fieldSetNoDefault, they're not used.

In case of attempted INSERT of a record with an undefined column and no default value indicated in schema, MySql returns a 1364 error code. This leads to a DatabaseExceptionWrapper being thrown instead of the more accurate IntegrityConstraintViolationException like the other drivers do.

Proposed resolution

Make so that MySql driver throws the same excpetion as the other core drivers.

Remaining tasks

User interface changes

API changes

Data model changes

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

$
0
0

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

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

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

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

Please help! I am really stuck :(

Missing condition in d7_term_localized_translation source plugin causing invalid migration

$
0
0

Problem/Motivation

It looks like there is a missing condition on i18n_string.objectid in the d7_term_localized_translation source plugin.
As a result the first tid gets migrated correctly but all of the following tid (taxonomy terms) get the values from the first one.

Shouldn't we add: ->condition('i18n.objectid', $object_id);
in core/modules/taxonomy/src/Plugin/migrate/source/d7/TermLocalizedTranslation.php:73

Proposed resolution

The taxonomy term translation source plugin should use I18nQueryTrait properly. It is included but not actually used, as if it was intended to be used but was forgotten.

Remaining tasks

Patch
Review
Commit

Language specific term(i18n_taxonomy) should not rely on entity translation in d7 taxonomy term migration

$
0
0

Language specific term has been provided by i18n_taxonomy module which is completely independent of entity_translation module in D7. Now in Drupal 8 d7_taxonomy_term source plugin generating term language from entity_translation and reseting the language to site default language.

How to reproduce the issue.
You should have more than one language(D7)
In D7 install i18n_taxonomy module. Dont install entity_translation module.
Then edit the vocabulary and in MULTILINGUAL OPTIONS select "Translate. Different terms will be allowed for each language and they can be translated." and save.
Add term
Select any language other than site's default language
Test migrate taxonomy to D8
Check term language

Solution
We should check if taxonomy_term_data table already has language column(added by i18n_taxonomy) or not, if it has then we should avoid checking entity_translation table.

Please note: This is not related to translation of a taxonomy term. This is related to term that is added for a specific language in a multi language site.

Blocks do not appear to add to layout section and tray does not disappear

$
0
0

Problem/Motivation

When adding blocks to the page I receive an AJAX error in the console and an error in the logs. The block does not appear in the layout section and the tray does not disappear.

However, if I refresh the page, the block will be there and I can move it and save the layout.

This is happening specifically with a views block that has no results sometimes, but I have seen it with other custom blocks in the past as well.

The first time I saw this issue installing the layout_builder_admin_theme module fixed the issue ( it existed on both bartik and our custom theme, but not seven).

Ajax error:

message: "\nAn AJAX HTTP error occurred.\nHTTP Result Code: 200\nDebugging information follows.\nPath: /layout_builder/add/block/overrides/node.3/0/content/goal_check_in?_wrapper_format=drupal_dialog.off_canvas&ajax_form=1\nStatusText: OK\nResponseText: "​
name: "AjaxError"​
stack: "@http://site.lndo.site/sites/default/files/js/js_cYXgoEW1m59yF277COwNKRUOm2M5DVGlxiYVwUl7QSA.js:1309:32\n@http://site.lndo.site/sites/default/files/js/js_cYXgoEW1m59yF277COwNKRUOm2M5DVGlxiYVwUl7QSA.js:1903:3\n"

PHP Error

TypeError: Argument 1 passed to Drupal\Core\Cache\CacheableMetadata::createFromRenderArray() must be of the type array, null given, called in /app/web/core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php on line 110 in Drupal\Core\Cache\CacheableMetadata::createFromRenderArray() (line 149 of /app/web/core/lib/Drupal/Core/Cache/CacheableMetadata.php)

#0 /app/web/core/modules/layout_builder/src/EventSubscriber/BlockComponentRenderArray.php(110): Drupal\Core\Cache\CacheableMetadata::createFromRenderArray(NULL)
#1 [internal function]: Drupal\layout_builder\EventSubscriber\BlockComponentRenderArray->onBuildRender(Object(Drupal\layout_builder\Event\SectionComponentBuildRenderArrayEvent), 'section_compone...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#2 /app/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Drupal\layout_builder\Event\SectionComponentBuildRenderArrayEvent), 'section_compone...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#3 /app/web/core/modules/layout_builder/src/SectionComponent.php(90): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('section_compone...', Object(Drupal\layout_builder\Event\SectionComponentBuildRenderArrayEvent))
#4 /app/web/core/modules/layout_builder/src/Section.php(88): Drupal\layout_builder\SectionComponent->toRenderArray(Array, true)
#5 /app/web/core/modules/layout_builder/src/Element/LayoutBuilder.php(250): Drupal\layout_builder\Section->toRenderArray(Array, true)
#6 /app/web/core/modules/layout_builder/src/Element/LayoutBuilder.php(123): Drupal\layout_builder\Element\LayoutBuilder->buildAdministrativeSection(Object(Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage), 0)
#7 /app/web/core/modules/layout_builder/src/Element/LayoutBuilder.php(97): Drupal\layout_builder\Element\LayoutBuilder->layout(Object(Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage))
#8 [internal function]: Drupal\layout_builder\Element\LayoutBuilder->preRender(Array)
#9 /app/web/core/lib/Drupal/Core/Security/DoTrustedCallbackTrait.php(100): call_user_func_array(Array, Array)
#10 /app/web/core/lib/Drupal/Core/Render/Renderer.php(781): Drupal\Core\Render\Renderer->doTrustedCallback(Array, Array, 'Render #pre_ren...', 'silenced_deprec...', 'Drupal\\Core\\Ren...')
#11 /app/web/core/lib/Drupal/Core/Render/Renderer.php(372): Drupal\Core\Render\Renderer->doCallback('#pre_render', Array, Array)
#12 /app/web/core/lib/Drupal/Core/Render/Renderer.php(200): Drupal\Core\Render\Renderer->doRender(Array, true)
#13 /app/web/core/lib/Drupal/Core/Render/Renderer.php(144): Drupal\Core\Render\Renderer->render(Array, true)
#14 /app/web/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\Render\Renderer->Drupal\Core\Render\{closure}()
#15 /app/web/core/lib/Drupal/Core/Render/Renderer.php(145): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure))
#16 /app/web/core/lib/Drupal/Core/Ajax/CommandWithAttachedAssetsTrait.php(36): Drupal\Core\Render\Renderer->renderRoot(Array)
#17 /app/web/core/lib/Drupal/Core/Ajax/ReplaceCommand.php(31): Drupal\Core\Ajax\InsertCommand->getRenderedContent()
#18 /app/web/core/lib/Drupal/Core/Ajax/AjaxResponse.php(43): Drupal\Core\Ajax\ReplaceCommand->render()
#19 /app/web/core/modules/layout_builder/src/Controller/LayoutRebuildTrait.php(47): Drupal\Core\Ajax\AjaxResponse->addCommand(Object(Drupal\Core\Ajax\ReplaceCommand))
#20 /app/web/core/modules/layout_builder/src/Controller/LayoutRebuildTrait.php(26): Drupal\layout_builder\Form\ConfigureBlockFormBase->rebuildLayout(Object(Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage))
#21 /app/web/core/modules/layout_builder/src/Form/ConfigureBlockFormBase.php(242): Drupal\layout_builder\Form\ConfigureBlockFormBase->rebuildAndClose(Object(Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage))
#22 /app/web/core/lib/Drupal/Core/Ajax/AjaxFormHelperTrait.php(39): Drupal\layout_builder\Form\ConfigureBlockFormBase->successfulAjaxSubmit(Array, Object(Drupal\Core\Form\FormState))
#23 [internal function]: Drupal\layout_builder\Form\ConfigureBlockFormBase->ajaxSubmit(Array, Object(Drupal\Core\Form\FormState), Object(Symfony\Component\HttpFoundation\Request))
#24 /app/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php(69): call_user_func_array(Array, Array)
#25 /app/web/core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php(109): Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse(Object(Symfony\Component\HttpFoundation\Request), Array, Object(Drupal\Core\Form\FormState), Array)
#26 [internal function]: Drupal\Core\Form\EventSubscriber\FormAjaxSubscriber->onException(Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent), 'kernel.exceptio...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#27 /app/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent), 'kernel.exceptio...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#28 /app/vendor/symfony/http-kernel/HttpKernel.php(227): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.exceptio...', Object(Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent))
#29 /app/vendor/symfony/http-kernel/HttpKernel.php(79): Symfony\Component\HttpKernel\HttpKernel->handleException(Object(Drupal\Core\Form\FormAjaxException), Object(Symfony\Component\HttpFoundation\Request), 1)
#30 /app/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#31 /app/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#32 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#33 /app/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#34 /app/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#35 /app/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#36 /app/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#37 /app/web/core/lib/Drupal/Core/DrupalKernel.php(708): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#38 /app/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#39 {main}

Steps to reproduce

  • Enter layout section of a page
  • Click add block
  • Choose view block
  • Click add block

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Replace content revision table with a view

$
0
0

Updated by #80

Problem/Motivation

Convert content revision table to view.

Proposed resolution

Replace the content revision table with a view.

Remaining tasks

  • Mulitlangual support see #77
  • "Strip HTML" filter/rewrite doesn't work on the log messages.
  • If we want to retain the yellowish rowstyle for the default revision, and the striped rowstyle in bartik, this might be solved in Twig or we could add a rowstyle plugin to views.
  • The dropbutton misalignment error, see #1890266: dropbutton text fails to retain .dropbutton-widget width

User interface changes

Before


After

API changes

N/A

Data model changes

N/A

Release notes snippet

WIP

Orignial Report

This depends on #1863898: Add test coverage for Views revision link handlers and #1826604: Add a dropbutton field handler to Views

This is one of the only content listings without it's own custom hook_ENTITY_operations().

ResourceTestbase does not respect $uniqueFieldNames when duplicating the test entity

$
0
0

Problem/Motivation

The ResourceTestBase has a static property of $uniqueFieldNames for tracking unique field names on an entity. This is used to prevent errors when modifying and creating entities in tests.

These fields are not taken into account when the \Drupal\Tests\jsonapi\Functional\ResourceTestBase::getEntityDuplicate method is used.

I had to extend this method to fix the problem, where the sku field is unique.

  /**
   * {@inheritdoc}
   */
  protected function getEntityDuplicate(EntityInterface $original, $key) {
    $dupe = parent::getEntityDuplicate($original, $key);
    assert($dupe instanceof ProductVariationInterface);
    $dupe->setSku('XYZ789');
    return $dupe;
  }

Steps to reproduce

See #3128322: Filtering variations over JSON:API is always access false

Proposed resolution

Respect unique fields when making a duplicate. It is done there:

  protected function getModifiedEntityForPostTesting() {
    $document = $this->getPostDocument();

    // Ensure that all the unique fields of the entity type get a new random
    // value.
    foreach (static::$uniqueFieldNames as $field_name) {
      $field_definition = $this->entity->getFieldDefinition($field_name);
      $field_type_class = $field_definition->getItemDefinition()->getClass();
      $document['data']['attributes'][$field_name] = $field_type_class::generateSampleValue($field_definition);
    }

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Tagging a core release with Composer 2.0.0-alpha3 fails spectacularly

$
0
0

Problem/Motivation

Drupal 10, the Automatic Updates Initiative, etc. will require Composer 2. Composer 2.0.0-alpha1 was released awhile ago and 2.0.0-alpha3 has just been released this week.

Yesterday I accidentally tried to tag the core bugfix releases using the Composer 2.0.0 alpha. It failed dramatically.

Steps to reproduce

These manually follow the automated steps used when creating a core release.

  1. composer self-update 2.0.0-alpha3
  2. Fetch the latest 9.0.x HEAD.
  3. rm -rf vendor (to remove stale vendor created with Composer 1)
  4. composer install --no-progress --no-suggest -n -q
  5. Set the version constant in core/lib/Drupal.php
    diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php
    index 5f9890ed33..098925e936 100644
    --- a/core/lib/Drupal.php
    +++ b/core/lib/Drupal.php
    @@ -80,7 +80,7 @@ class Drupal {
       /**
        * The current system version.
        */
    -  const VERSION = '9.0.4-dev';
    +  const VERSION = '9.0.4';
    
    
  6. COMPOSER_ROOT_VERSION="9.0.4" composer update drupal/core*

Expected result: Composer updates the metapackages as appropriate for the 9.0.4 release.

Actual result: Composer outputs the following:

$ COMPOSER_ROOT_VERSION="9.0.4" composer update drupal/core*
> Drupal\Composer\Composer::ensureComposerVersion
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 3 updates, 0 removals
  - Downgrading drupal/core (9.0.x-dev => 9.0.4)
  - Downgrading drupal/core-project-message (9.0.x-dev => 9.0.4)
  - Downgrading drupal/core-vendor-hardening (9.0.x-dev => 9.0.4)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 3 updates, 0 removals
  - Downgrading drupal/core-project-message (9.0.x-dev => 9.0.4): Symlinking from composer/Plugin/ProjectMessage
  - Downgrading drupal/core-vendor-hardening (9.0.x-dev => 9.0.4): Symlinking from composer/Plugin/VendorHardening
  - Downgrading drupal/core (9.0.x-dev => 9.0.4): Source already present
Generating autoload files
Could not scan for classes inside "core/lib/Drupal.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Component/DependencyInjection/Container.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Component/DependencyInjection/PhpArrayContainer.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Component/FileCache/FileCacheFactory.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Component/Utility/Timer.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Component/Utility/Unicode.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Cache/Cache.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Cache/CacheBackendInterface.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Cache/CacheTagsChecksumInterface.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Cache/CacheTagsChecksumTrait.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Cache/CacheTagsInvalidatorInterface.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Cache/DatabaseBackend.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Database/Connection.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Database/Database.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Database/Driver/mysql/Connection.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Database/Statement.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Database/StatementInterface.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/DependencyInjection/Container.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/DrupalKernel.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/DrupalKernelInterface.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Installer/InstallerRedirectTrait.php" which does not appear to be a file nor a folder
Could not scan for classes inside "core/lib/Drupal/Core/Site/Settings.php" which does not appear to be a file nor a folder
Class Drupal\Core\Composer\Composer is not autoloadable, can not call pre-autoload-dump script

                                                                               
  [RuntimeException]                                                           
  Could not scan for classes inside "core/lib/Drupal.php" which does not appe  
  ar to be a file nor a folder                                                 
                                                                               

update [--with WITH] [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-autoloader] [--no-scripts] [--no-suggest] [--no-progress] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

... and also deletes the entire contents of the core directory.

There is no workaround that I could find.

Proposed resolution

?

Remaining tasks

?

User interface changes

N/A

API changes

?

Data model changes

?

Release notes snippet

TBD

Tables cause layout issues if wider than the viewport, especially on mobile devices

$
0
0

Extra space is there after header in mobile view , I have added screenshots for the reference.
You can go to /admin/content or /structure/types/manage/article/fields to reproduce this issue

Before patch:

After patch in #31:

Problematic hreflang links when using entity as front page.

$
0
0

Problem/Motivation

Default frontpage settings

Hreflang links were pointing to the actual node view page ("node/9") instead of just front ("/") when using that node as a front page (google sent a notification about the issue).

Hreflangs before

Proposed resolution

Don't create hreflang links from the entity route, just add the languages prefix to root path.

Hreflangs after

CKEditorPluginManager should resolve plugin dependencies recursively

$
0
0

Problem/Motivation

CKEditorPluginManager resolved only the first level of dependencies of a ckeditor plugin. The use-case A depends on B, and B depends on C does not work.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Bug Smash Initiative meetings - next: 2020-08-18

$
0
0

Introduction

The Bug Smash Initiative is a community effort to fix known bugs in Drupal core. See the Bug Smash Initiative handbook page for more information.

We meet fortnightly on Tuesday at 0400 UTC in the #bugsmash channel in Drupal Slack. Beware, this might be Monday evening for some people:

  • 2:00 pm Tuesday - Australian Eastern Standard Time (AEST)
  • 9:30 am Tuesday - India Standard Time (IST)
  • 6:00 am Tuesday - Central European Standard Time (CET)
  • 9:00 pm Monday - Pacific Daylight Time (PDT)
  • When in doubt, ask the oracle.

All meetings are posted as child issues.

Please do not comment on this issueexcept to add a new child issue for an upcoming meeting and change the title here. Thanks!

Next meeting

The next meeting is on Tuesday 2020-08-18:

#3163911: Meeting of the Bug Smash Initiative 2020-08-18

Past meetings

Please see the "Child issues" block in the right sidebar or at the bottom of this page for links to past meetings.

Meeting of the Bug Smash Initiative 2020-08-04

$
0
0

Agenda items

Standing items

  • Who is here
  • Any other suggested topics
  • Wins / Thanks / Frustrations
  • Statistics and functionality update. X new bugs created in last two weeks. Y closed by the initiative.
  • The bug I would most like to see fixed
  • Update on action items from last meeting
  • What should be the initiative focus for the next 2 weeks?

New items

  • @todo

0️⃣  Who is here today? Comment in the thread to introduce yourself. We’ll keep the meeting open for 24 hours to allow for all timezones.

pratik_kamblePratik Kamble, Pune India
Ridhima AbrolRidhima Abrol, India
jungleJungle, Chongqing, China
kimb0Kim Pepper, Australia
dwwDerek, US, Black Lives Matter
pameeelaPam, AU
Kristen Pol (she/her)Kristen, CA, USA
acbramleyAdam Bramley, Melbs
quietoneVicki, NZ
Griffyn HeelsGriff, Melbourne, Aus :mask:
larowlanLee au
simeSimon, AU
Michael (g-brodiei)Michael, Taiwan
lendudeLen, Amsterdam
samiullahsamiullah, India
partykaJason, Illinois, USA
jonathanjfshawJonathan, UK

1️⃣  Do you have suggested topics you are looking to discuss? Post in this thread and we’ll open threads for them as appropriate.

pameeelaPotential aim for the initiative: triage the RTBC queue to make sure what's there is actually RTBC. Committers are finding things there that aren't ready and this becomes very time consuming for them.
dwwAnyone want to improve our initiative page?  Flesh out more of the @todo sections?
samiullahLimit the automated tests based on version code is supported for
dwwSadly, now that the meeting is officially over, this thread is no longer going to result in new threads for the "meeting".  In the future, if you have ideas you want to discuss and you can't be there, please add them to the issue for the next meeting.  You can always find a link to the next meeting's issue at #3153713: Bug Smash Initiative meetings - next: 2020-08-18@samiullah: For now, you might as well just start your own (non-meeting) thread in the channel to discuss this. (edited)
samiullahsure @dww Thanks

2️⃣ .1️⃣  Wins - what wins have you had this fortnight - share your successes!

acbramleyRevision author for Media/Block Content is now available in views :slightly_smiling_face: #3131126: Can't show 'revision author' on Block content views
Kristen Pol (she/her)I think 6 issues I helped on were committed yesterday! Smash smash smash :)
quietoneMoved all issues out of simpletest.module component
samiullahTested lot of issues, some of them moved to RTBC, waiting for them to get moved to Fixed :slightly_smiling_face:
dwwOh right, I forgot these happened since the last meeting! Very happy about:https://www.drupal.org/node/1393226https://www.drupal.org/node/3161070
partyka#3074201: Drupal\Core\Routing\RouteCompiler::compile($route) assumes that the '$route' object is injected.

2️⃣ .:two: Thanks - a space for callouts to other contributors who’ve helped you this fortnight

pameeela@Kristen Pol (she/her) shoutout for absolutely smashing the queue!
Kristen Pol (she/her)Thanks! I was inspired by @pameeela :)
dwwThanks also to @Kristen Pol (she/her) for suggesting some good fixes to the issue queues and reviewing my patches for them:#3162889: Provide a magic '- Closed issues -' status for issue queue views
Kristen Pol (she/her)Big thanks to @dww for making patches so quickly!!!
partykaThanks to @longwave for reviews on 3074201

2️⃣ .3️⃣  Frustrations - what’s been a source of frustration this fortnight - a space to vent

dwwI'm happy to see this thread tends to be empty in our meetings. :heart:  I once heard a very wise perspective that "there's no such thing as 'venting', you're just rehearsing" -- rehashing your negative emotions about something and reliving the frustration.  Maybe we could remove this as a standard agenda item going forward?
pratik_kambleI sometime feel one thread should be there to listen to pain points of contributor. May be we can rephrase this these item. @larowlan any thoughts
larowlanBut the acronym
dwwWhat acronym?
larowlan2.1, 2.2, 2.3 wins, thanks, frustrations :joy:
larowlanalways thinking about these things when naming … see also drupal.org/project/field_union
larowlani’ll see myself out
larowlanbut yeah +1 to remove frustrations - jokes aside
samiullahfrom testers point of view, steps to replicate were missing in some issues. We shd make it a practice to add issue replication steps
dww@samiullah It should hopefully be getting a bit better now that https://www.drupal.org/node/1393226 and #2281761: Add "Steps to reproduce" section to "Bare issue summary template" for dreditor and default value for new issues are done/deployed.
samiullahthanks @dww looks good.
xjmWRT whether we should include a frustrations/blockers thread, maybe we could rephrase it to be something like "Barriers"?
dwwSo long as we don't call them "Obstacles" (for the acronym inclined). :wink:

3️⃣  Core bug statistics - current state of open bugs

Griffyn Heels67 resolved57 created10 tickets in the green!

4️⃣  Bug I’d most like to see fixed

quietone#2678510: Fix database settings form required fields
dwwThis one has been annoying recently: #3037436: [random test failure] Make QuickEditIntegrationTest more robust and fail proof
dwwI hope to have time to keep working on #1538118: Update status does not verify the identity or authenticity of the release history URL this week, too.  That's been open WAY too long. :(
larowlan#2906919: Allow users to create a block content entity with a specific UUID if it is a missing dependency of a config object
Kristen Pol (she/her)This issue has been dragging on for a long time and would be great to smash: #1521996: Password reset form reveals whether an email or username is in use

5️⃣  Highlights from the last meeting

Griffyn HeelsHere's the highlights from last meeting:
Griffyn HeelsFocuses for this fortnight - https://drupal.slack.com/archives/C014QES6HSQ/p1595304184384000No confirmed mentor for this fortnightTooltip text still TBCHow to get more feedback on my issues: https://drupal.slack.com/archives/C014QES6HSQ/p1595304762392200Establishing a policy for closing bug reports for updates to versions no longer supported?: https://drupal.slack.com/archives/C014QES6HSQ/p1595304860394800When to use the #bugsmash tag: https://drupal.slack.com/archives/C014QES6HSQ/p1595305019398800 (edited)

6️⃣  Suggest a focus for the next two weeks in this thread. Vote on the suggestions you like. We’ll pick the one with the most votes in 24 hours and use that as our focus until the next meeting

Kristen Pol (she/her)I'm curious how many people focus on the focus. TBH, I just look for any bug that needs review
dwwYeah, after a few weeks, I'm becoming less and less convinced that this is meaningful or worth spending time discussing.  Focusers gonna focus.  Everyone else gonna do whatever comes across their radar. :wink:
pameeelayeah, i find it's not that i don't agree with the focus or anything like that, but if it's not something i can help with i will just get on with the stuff i can do.
pameeelait is hard enough to find anything useful to do, without having to narrow the focus!
dwwYeah, I think the "focus" has been mostly "insiders" working on stuff we'd already be working on. ;)
quietoneOr, the focus isn't promoted or perhaps it needs someone to lead it.

7️⃣  Who is going to be the mentor for this coming fortnight?

Griffyn HeelsI think we retire this fortnightly question. It wasn't too popular last time either.
Griffyn HeelsAs a community we can help newbies/each other in the right direction.

8️⃣   From @pameeela "Potential aim for the initiative: triage the RTBC queue to make sure what's there is actually RTBC. Committers are finding things there that aren't ready and this becomes very time consuming for them."

dwwI sometimes feel crappy trolling the RTBC queue with pedantic reviews, but it's definitely a win.  Every time a committer opens and RTBC issue and has to move it back to NW is another RTBC issue they didn't have time to fix.
dww"We" should definitely give committers every possible reason to commit something if it's going to be sitting at RTBC.
pameeelai think there is a fair bit getting through that is even more obvious, like needs tests or doesn't incorporate previous maintainer/committer feedback.
pameeelapedantic reviews are OK too though, if you have the time and the feedback.
Kristen Pol (she/her)Maybe we can make it clear we're double checking the RTBC for bugsmash? To address tge issue that it may look to others like redundant work? (edited)
pameeelai didn't mean to check only for bugsmash, i just meant in general
pameeelabut if you check an issue and have no feedback, i'd say just leave it, if you have feedback then it's not redundant!
pratik_kambleProbably setting up some comment template for RTBC will help (edited)
pameeelahmm, i think by the time it's RTBC it needs a custom message if it's getting bumped
dwwYeah, I think we should always review issues as if we were core committers.  The more we get things in shape before a core committers spends time on it, the better.
jungleI have been doing so -- checking RTBC’d issues. looking for what could be improved before committers jumping in. CS violations, documentation improvements, micro optimizations etc.
dwwBut especially once they're at RTBC, we should make sure they belong there.
dwwAlso making sure the summary / title are accurate.
Kristen Pol (she/her)If we check it and it looks good but we don't leave a comment then someone else may double check it as well which duplicates work
pratik_kambleProbably we can add it as document for steps which @jungle follows. To avoid going back and forth of issue queue
Kristen Pol (she/her)It would be good to have a checklist
Kristen Pol (she/her)I have a mental checklist but not an easy reference
pameeelaIf we check it and it looks good but we don't leave a comment then someone else may double check it as well which duplicates worki'm not sure i agree, just because i didn't spot something doesn't mean someone else wouldn't? (edited)
jungleIf we check it and it looks good but we don’t leave a comment then someone else may double check it as well which duplicates workit’s fine, to me, everyone could find something to improve probably. but a generic checklist would help.
dwwhttps://www.drupal.org/community-initiatives/drupal-core/bug-smash#review links to some handbook pages about doing good reviews.
dwwThe patch review page is pretty good, but perhaps could use an explicit "Steps to check before something is RTBC" list.
junglehttp://xjmdrupal.org/review-guide#checklist
jungleSee xjm's patch review checklist.
dwwRight, but that's 3 clicks removed from the Bug Smash page. ;)  I think we could put some of the x j m list directly on the '/patch/review' page.
Kristen Pol (she/her)For me, bullets with as few words as possible is the best1. Title makes sense 2. Issue summary is complete and relevant3. Tests pass4. Patch for latest version5. Code reviewed6. New tests added if relevant7. Tagged appropriatelyEtc (edited)
dwwThat looks like a great start.  https://www.drupal.org/node/772/edit anyone? :wink:
dww(yes, that page really is a 3 digit nid!)
dwwFor now, I added a link to https://www.drupal.org/project/issues/search/drupal?status%5B%5D=14&cate... to the Needing triage (from developers) section. (edited)

9️⃣ from @dww "Anyone want to improve our initiative page? Flesh out more of the @todo sections?"

dwwThanks to @pameeela for giving it the nice artwork. ;)  But other than that, I've done like 90% of the revisions at https://www.drupal.org/node/3150111/revisions -- would love for some other folks to dive in.
Griffyn HeelsLove the artwork!
quietoneCan you provide specific examples of what needs to be done?
dwwA) the @todo comments ;)
dwwB) I think "How to help" section needs help.
Kristen Pol (she/her)Very meta
dwwAlthough looking again, it's definitely not as skeletal as I remember.  So it has been improving.  Thanks also @quietone!  I hadn't seen your edits.
quietoneHaha. I mean what do you envision that the 'todos' are replaced with. Links to more existing pages?
dwwYeah, generally I think linking to existing docs is better than writing new content directly in this page.
quietoneThat helps. I will make another attempt this fortnight.
dwwBut the d.o handbook universe is vast, an stuff can be spread out into multiple sections / areas.  So I think we can do a useful service by collecting links from disparate places and having a nice pile in one spot for easy finding.

1️⃣ 0️⃣  Okay team, Bugsmash meeting 5 is over. Thanks all for coming! Please feel free to keep chatting in the threads.

Kristen Pol (she/her)Thanks for leading
Griffyn HeelsThanks @pratik_kamble for coordinating!
larowlanYou rock :rockcat:
quietone@pratik_kamble thank you!
kimb0:boom:
samiullahThanks @pratik_kamble

Participants:

pratik_kamble, Ridhima Abrol, jungle, kimb0, dww, pameeela, Kristen Pol (she/her), acbramley, quietone, Griffyn Heels, larowlan, sime, Michael (g-brodiei), lendude, samiullah, partyka, jonathanjfshaw, xjm

Meeting of the Bug Smash Initiative 2020-08-18

$
0
0

Agenda items

Standing items

  • Who is here
  • Any other suggested topics
  • Wins / Thanks / Barriers
  • Statistics and functionality update. X new bugs created in last two weeks. Y closed by the initiative.
  • The bug I would most like to see fixed
  • Update on action items from last meeting
  • What should be the initiative focus for the next 2 weeks?

New items

  • @todo

Release notes snippet


Provide a proper API for updating translations

$
0
0

Problem/Motivation

Currently how we check for updated translations and then actually update the translations is baked into controllers and forms in the Interface translation module. This makes it hard to provide the functionality through non-HTML means, for example Drush. See https://github.com/drush-ops/drush/pull/1818

Proposed resolution

Provide a service for high-level translation update functions.

Remaining tasks

  • Agree on the scope.
  • Write tests.
  • Write and check code.
  • Write change record.

User interface changes

None.

API changes

A new service that wraps existing procedural code.

Data model changes

None.

[Backport] The media library should perform access checks against the revision of the entity being edited

$
0
0

Problem/Motivation

Currently when the media library does access checking on the entity that opened the media library, it does so by loading the entity using a simple \Drupal\Core\Entity\EntityStorageInterface::load. When editing inline blocks and layout builder both of these things are true:

  • You aren't guaranteed to be modifying the latest or default revision of an inline block.
  • The revision ID of an inline block is very important to it's access control.

Steps to reproduce:

  • Enable media_library, layout_builder.
  • Add a media field + media library to a custom block type.
  • Enable layout builder + per entity overrides on a content type.
  • Embed a block with the media library field into a per entity override.
  • Create two revisions, modify the inline block in both.
  • Go to the "Revisions" tab and revert to the first revision.
  • Go back to the layout tab and try to edit and save a new image in the media library.
  • AJAX request will come back a 403.

What is happening under the hood:

  • The media library has an block content entity ID.
  • It loads that entity and checks access against it.
  • The inline block's access is based on it's host entity, so it loads the host and confirms the revision ID of the block is used on the layout (\Drupal\layout_builder\EventSubscriber\SetInlineBlockDependency::isBlockRevisionUsedInEntity).
  • The media libraries ::load call doesn't match the actual revision ID in the layout and the access chain is broken, resulting in an access denied.

Proposed resolution

Pass the host entity's revision ID around, instead of it's ID and load that instead for the purposes of access control.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support language of parts for file description

$
0
0

Problem/Motivation

If the description field on a file field is in a different language from the page, there is no way to mark the description as being in that other language. This is a violation of WCAG 2.0 3.1.2 Language of Parts.

Steps to reproduce

1. Go to /admin/structure/types/add
2. Add content type File Container
3. Go to /admin/structure/types/manage/file_container/fields
4. Add field of type File named File
5. Go to /admin/structure/types/manage/file_container/fields/add-field Field Settings tab
6. Set File field to allow Unlimited values (I also enabled Display and Default to Display and I believe this would not affect the behavior relevant to this issue.)
7. Go to Edit tab
8. Check Enable Description field
9. Go to /admin/modules
10. Enable Content Translation and Language
11. Go to /admin/config/regional/content-language
12. Check Content, File, URL Alias
13. Check the Translatable checkbox for all content types

Expected result: File Description field has a checkbox that enables translation, and this checkbox is checked
Actual result: File Description field does not have a checkbox that enables translation.

14. Ensure that all fields are checked for translation
15. Click Save Configuration

Expected result: File remains checked
Actual result: File loses check

16. Go to /admin/config/regional/language
17. Add Spanish
18. /node/add/file_container
19. Provide a page title in English
20. Page language should be English
21. In the File field, click Choose Files
22. Navigate to and select an English-language file
23. Click Choose (or whatever button your interface provides)
24. Enter an English-language description in the description field
25. In the File field, click Choose Files
26. Navigate to and select a Spanish-language file
27. Click Choose (or whatever button your interface provides)
28. Enter an Spanish-language description in the description field

Expected result: I have a way to mark this text as being in Spanish, for instance, in a drop-down beside or below the field.
Actual result: I have no way to mark this text as being in Spanish.

29. Save and publish page.
30. Navigate to the new page.
31. Right-click the Spanish file description.
32. Inspect element

Expected result: Spanish file description is wrapped in a tag with the attribute lang="ES"
Actual result: Spanish file description is not wrapped in a tag with the attribute lang="ES"

Proposed resolution

Minimum requirement:
On /admin/config/regional/content-language, allow File Description to be marked as translatable.
If File Description has been marked as translatable, then on /node/add/[content type] for content types which have a file field that has a file description, beside each file description, show a drop-down which default's to the page's language and which can be set to any permitted language.

Optional support:
Allow adding additional concatenated file descriptions to a file, each with a language drop-down to allow for a file description in more than one language. For example,

Use of the Subjunctive in Spanish "Es posible/probable que" constructions

Note: The words "Es posible/probable que" would correctly be wrapped in a rendered description with a span tag with a lang attribute with the value "ES".

Additional notes:

For consistency, this might be best solved the same way as #784672: Allow text field to enforce a specific text format by allowing the description to provide a single-field file format which only allows the span tag, and then only with a language attribute.

Remaining tasks

Reporter requests that this be filled in by someone who knows how to fill this in.

User interface changes

See proposed resolution.

API changes

Reporter requests that this be filled in by someone who knows how to fill this in.

Data model changes

Reporter requests that this be filled in by someone who knows how to fill this in.

Release notes snippet

Reporter requests that this be filled in by someone who knows how to fill this in.

[meta] Conform to WCAG Success Criterion 3.1.2: Language of Parts

$
0
0

This is a meta-issue for the integration of the concept of 'language of parts' in Drupal core. Language of parts is an accessibility requirement in WCAG and is meant to make language changes in texts detectable.

"3.1.2 Language of Parts: The human language of each passage or phrase in the content can be programmatically determined except for proper names, technical terms, words of indeterminate language, and words or phrases that have become part of the vernacular of the immediately surrounding text. (Level AA)"http://www.w3.org/TR/WCAG20/#meaning-other-lang-id

The recommended solution is to use the lang-attribute, for example:
<span lang="de">Ich bin ein Berliner</span> is a quotation from a speech by President John F. Kennedy.

This year in the Netherlands 45% of governmental websites fails on WCAG tests for this issue. Example: A governmental web page that should have language tags.

We discussed this in the last meeting in the accessibility group. As texts are provided in a lot of places, we suggested to break this issue into separate issues for the different levels and uses. First test and if needed file issues for the most common places like text fields.

General UI:
#1164682: links with a known language need language identifier
#1165476: if t() string has no translation or fallback language, text should have lang attribute

body field
The default filtered html format outputs the language attribute correctly and even transforms it to both xml:lang and lang. However, by default it is not possible to include span, p and div tags. That means that there is at the moment no option to include languages without additional visual markup (as cite, em, strong, blockquote etc).
#1322906: Allow span tag by default for language changes?
#1328768: attributes 'xml:lang' and 'xml:id' transform to 'lang' and 'id' in filter_xss
#1993928: Language of parts: Introduce a language toolbar button

text field
For text fields the default plain text format is not sufficient, an html filter should be included to output the language attribute.
#784672: Allow text field to enforce a specific text format

file field
Support language of parts for file description
#3163915: Support language of parts for file description

title field
Titles accept only plain text. There is no easy solution for this. Fix would be to have titles as text fields.
#1188394: Make title behave as a configurable, translatable field (again)

nodes/entities
#1164926: Nodes need to have languages specified separately for accessibility
#2036277: Language attribute is not attached node title on a full page

comments
#1368410: When viewing a node in another language as interface language, comment form should have correct language

views
#2496223: Views containing content not in the page's language need to add tags which mark the language of parts

See also:
#1165466: Language of parts, accessibility and multilanguage: language button
#724128: Impossible to add "xml:lang" in a translatable field
discussion http://groups.drupal.org/node/145894

MachineName migrate process plugin should make allowed characters regular expression configurable

$
0
0

Problem/Motivation

The machine_name migrate process plugins replaces all non alphanumeric characters with underscores. It would be great if that would be a bit more flexible. Concretely, for some machine names it makes sense to allow a period as part of the name which currently gets replaced.

The code that currently handles this is the following:

    $new_value = preg_replace('/[^a-z0-9_]+/', '_', $new_value);

Concretely, when importing files from an external source, you may want to transliterate the filename and remove any "special" characters from the filename. However, periods in the filename need to be retained, so that the file still has a proper file extension. In this case the pattern may be changed to allow a period ("."). And you may also want to allow a dash ("-") as that is a common character in filenames. That means you need to run:

    $new_value = preg_replace('/[^a-z0-9_\-.]+/', '-', $new_value);

Also. some entity types allow periods in their IDs so when importing those from external systems, you may have to change the replace pattern accordingly.

Proposed resolution

Add a replace_pattern configuration value to the plugin to make the pattern configurable.

Viewing all 291180 articles
Browse latest View live


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