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

Restore widget of a disabled field

$
0
0

Problem/Motivation

When i disable a field its widget changes and it should change it back to the previous widget when i enable it.

Steps to reproduce

  • Go to the Manage Form Display tab of a Content type. (Article for example)
  • Change the "Authored by" field widget to "Select list" and save it
  • Move this field to the "Disabled" area and save it
  • Its widgets changed to "Check boxes/radio buttons"
  • Enable it again, the widget changes to "Autocomplete" instead of "Select list"

Proposed resolution

Either don't change the widget when disabling/enabling the field or at least, when enabling the field, change it to the previous widget.

Remaining tasks

Create a patch
Test it
Commit

User interface changes

API changes

Data model changes

Release notes snippet


Mark migration status from schemaorg and schemaorg_ui modules to rdf module as finished

$
0
0

Problem/Motivation

The D8/9 Core RDF module already migrates data from the D7 Core RDF module.

The D7 contrib Schema.org (schemaorg) module and it's Schema.org UI (schemaorg_ui) submodule extend D7 Core's RDF module by:

  1. Declaring the schema RDF namespace (i.e.: in the <html> tag)
  2. Adding the schema.org url to the entity content as RDF metadata
  3. Providing a way for Features to export RDF mappings
  4. Providing a UI to map Schema.org types to Drupal node types and fields

There is only one major version of the schemaorg project (7.x-1.x). As of the latest release (7.x-1.0-rc1), neither schemaorg nor schemaorg_ui declare their own database tables nor store their own data (they both use D7 Core's RDF module to load and store any data they handle). However, they do write variables; which \Drupal\migrate_drupal\MigrationState's plugins discover; so when the Drupal migration wizard gets to the "What will be upgraded?" step, it incorrectly lists both schemaorg and schemaorg_ui as "Modules that will not be upgraded".

Steps to reproduce

  1. Download and Install Drupal 7.84 with the Standard install profile
  2. Download the Schema.org module version 7.x-1.0-rc1 and install both the Schema.org (schemaorg) and Schema.org UI (schemaorg_ui) modules.
  3. Go to /admin/structure/types/manage/page and in the Schema.org settings vertical tab, set Type = WebPage. Click Save content type
  4. On the database, run SELECT * FROM variable WHERE name LIKE '%schemaorg%';. Note you see results like...
    +---------------------------------+----------------------+
    | name                            | value                |
    +---------------------------------+----------------------+
    | schemaorg_ui_type_article       | s:0:"";              |
    | schemaorg_ui_type_page          | s:7:"WebPage";       |
    +---------------------------------+----------------------+
    
  5. Download and install drupal-9.4.x with the Minimal install profile. Enable the RDF (rdf) and the Migrate Drupal UI (migrate_drupal_ui) modules.
  6. Go to /upgrade. Follow the installation process. Note that in the "What will be upgraded?" step, both the D7 "Schema.org" (schemaorg) and "Schema.org UI" (schemaorg_ui) modules are listed as "Modules that will not be upgraded".
  7. Perform the upgrade.
  8. Export config. Note rdf.mapping.node.page.yml shows that the schema:WebPage type was successfully mapped here (note, however, this was achieved by D8 core's \Drupal\rdf\Plugin\migrate\source\d7\RdfMapping migrate plugin looking at D7's rdf_mapping table.

Proposed resolution

Update core/modules/rdf/migrations/state/rdf.migrate_drupal.yml to declare that Core's rdf module migration from the schemaorg and schemaorg_ui modules is finished.

Remaining tasks

  1. Write a patch
  2. Review and feedback
  3. RTBC and feedback
  4. Commit

User interface changes

None

API changes

None.

Data model changes

None.

Release notes snippet

Mark migration status from schemaorg and schemaorg_ui modules to rdf module as finished

[Ignore] In space (and/or this issue), no one can hear patches scream

$
0
0

Problem/Motivation

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Backbone manual tree-shake

$
0
0

Problem/Motivation

Backbone is on the way out #3145958: [META] Re-evaluate use of Backbone.js in core, we should figure out exactly what we rely on backbone for while reducing the size of the asset used by core.

Proposed resolution

Keep exclusively the code from backbone that is used by core, the tour, contextual and toolbar module.
Quickedit and Ckeditor will be remove before D10 so no need to look into them.

The smaller version has no code changes beside the deletion of unused code. Which means that loading both this version and the "regular" backbone file will keep the code working as expected. (as long as the backbone file is loaded after this smaller version).

Refactor HTMLRestrictionsUtilities to a HtmlRestrictions value object

$
0
0

Problem/Motivation

See #3222852-17: <dl> <dt> <dd> by introducing "Manually editable HTML tags" configuration on Source Editing.

There's currently a lack of clarity in the half a dozen methods on HTMLRestrictionsUtilities. \Drupal\ckeditor5\Plugin\CKEditor5PluginManager::getReadableElements() and \Drupal\ckeditor5\Plugin\CKEditor5PluginManager::getBlockElementList() should also be refactored out of there.

IMHO by far the clearest solution here is to stop treating this specially structured as an array. We already started doing that by introducing that utility class in the first place in #3216015: Generate CKEditor 5 configuration based on pre-existing text format configuration, where we added \Drupal\ckeditor5\HTMLRestrictionsUtilities::diffAllowedElements(). #3222852: <dl> <dt> <dd> by introducing "Manually editable HTML tags" configuration on Source Editing made it grow a lot, and just made it clear we really need better developer ergonomics around this — the risk of bugs is otherwise very high.

Therefore I think introducing a HTMLRestrictions value object would make this a lot less brittle, and far simpler to test:

final class HTMLRestrictions {

  public static function create(string $string): HTMLRestrictions;

  public function diff(HTMLRestrictions $other): HTMLRestrictions;

  public function intersect(HTMLRestrictions $other): HTMLRestrictions;

  public function toCKEditor5ElementsArray(): string[];

  public function toFilterHtmlAllowedTagsArray(): string[];

  public function toGeneralHtmlSupportConfig(): string[];

}

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Double exposed filter field when trying to use "q" as identifier

$
0
0

Problem/Motivation

While creating a View, you can expose filters to your users. For each of these filters, you can choose the identifier it's going to use to pass the data in the URL. When you use the identifier "q", the filter field is duplicated and doesn't work anymore. As "q" used to be reserved by Drupal to manage it's own URL, it can be understood. The thing is that the identifier field allows to use that letter and gives absolutely no clue on what's going wrong when you do it.

Steps to reproduce

  1. Install Drupal standard
  2. Go to Views UI (admin/structure/views)
  3. Edit any View
  4. Add any filter
  5. Make it exposed
  6. Change it's identifier to "q"
  7. Look at the preview

Expected: the exposed filter appears and work properly
Current: a duplicated field appears before the exposed filter and the filter doesn't work at all

Proposed resolution

Add a message in the identifier field description to indicate that "q" is a reserved word and cannot be used.
Validate the identifier field to ensure the entered value is not "q".

Remaining tasks

Patch
Test
Review
Commit

User interface changes

The filter identifier field has a new description.

API changes

None.

Data model changes

None.

Existing menu links show validation issues on migration (and ALL menu links pointing to node translations are invalid)

$
0
0

Problem/Motivation

The d7_menu_links migration complains about failed path validation for many links.

The reason: it points to content entities that have not yet been migrated. Its migration dependencies are:

migration_dependencies:
  required:
    - d7_menu

While this guarantees the existence of the menu in which a migrated menu link lives, it does not guarantee that the location the menu link points to exists. This is the problem.

Proposed resolution

  1. Add dependencies.
  2. Add deriver, to allow migrating subsets of menu links (to be able to migrate only menu links targeting only content entities that have already been migrated).

Remaining tasks

  1. Add tests for the deriver.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

TBD

Anonymous search not working (Bootstrap)

$
0
0

Problem/Motivation

Authenticated search works on my site, but anonymous search fails. I've searched for this kind of problem, and found a few leads, but nothing has worked for me. I use Bootstrap (which may or may not matter). I'm technical, but not in this area.

Steps to reproduce

Visit my website, https://ReadingMA.us, anonymously. Use the Search button on the RHS to search for anything. I doesn't work.

Now login as TestOne, password = 4zLWMVjL",=jD`6P

Try searching again. It works.


Document ModuleHandler pre-conditions

$
0
0

ModuleHandler::addModule() and ModuleHandler::addProfile() require that the module and path point to a valid module and if they are invalid weird things could happen. Sun said these should use the @internal annotations(#340723-185: Make modules and installation profiles only require .info.yml files) and these methods are for special cases like the installer. Even so, since they are public we should clarify. This clarification will also help regardless of accepting use of the @internal tag.

Olivero: tour module popup close button size issue

$
0
0

Tour module popup close button size is too small, In Umami the size of close button is quite large.

Olivero:

Umami:

window.once name conflict with other third party script

$
0
0

Problem/Motivation

Drupal uses a new standalone library to provide the once functionality. This library is published on npmjs as the @drupal/once package. The package exposes a js module and a version compatible with browsers that don't support js modules (the "iife" version). This iife version exposes a global variable named "once", making window.once the entrypoint of the functionality, this is the version drupal core uses since IE11 support is necessary.

Some third party scripts/libraries can already declare a window.once that Drupal core ends up using instead of the intended @drupal/once script, causing errors in almost all behaviors since most of them use once.

Steps to reproduce

Add one of the following in some library definition that gets loaded on the page:

https://unpkg.com/alpinejs@3.x.x/dist/module.cjs.js: { attributes: { defer: true }, type: external, process: false }
https://cdn.flowplayer.com/releases/native/stable/plugins/chromecast.min.js: { attributes: { defer: true }, type: external, process: false }

Here the defer means those files will be loaded right before the behaviors are executed and after the once library has been loaded (so window.once will never point to the @drupal/once script).

Proposed resolution

None yet.

Remaining tasks

Find a good solution
Write tests

Original report by mrweiner

Problem/Motivation

Upon upgrading to 9.3, we are seeing a number of console errors for Uncaught TypeError: once(...).forEach is not a function from various modules including tour, toolbar, big_pipe, views, and contextual. One such example is ajax_view.js.

9.3.x, line 70: https://git.drupalcode.org/project/drupal/-/blob/9.3.x/core/modules/view...

once('exposed-form', this.$exposed_form).forEach($.proxy(this.attachExposedFormAjax, this));

Doing some logging, it looks like the calls are not always broken. When they work, once(...) appears to be an array. When they are broken, however, once(...) looks to be the Window, which is not iterable. I verified this in both ajax.js and big_pipe.js.

It seems that the culprit is that jquery.once.bc.js sets once() as a global via window.once, and if another script is loaded on the page that also sets this global then subsequent invocations of once() by core fire off this replaced version of the function, causing things to break.

Steps to reproduce

Two scripts identified so far to cause the issue are https://unpkg.com/alpinejs@3.x.x/dist/module.cjs.js and https://cdn.flowplayer.com/releases/native/stable/plugins/chromecast.min.js, although there are likely others as well.

To reproduce, create a new project using the "standard" profile and add a script which modifies window.once to core/once in core.libraries.yml (or, realistically, probably to any library) as in:

once:
  remote: https://git.drupalcode.org/project/once
  version: "1.0.1"
  license:
    name: GNU-GPL-2.0-or-later
    url: https://git.drupalcode.org/project/once/-/raw/v1.0.1/LICENSE.md
    gpl-compatible: true
  js:
    assets/vendor/once/once.min.js: { weight: -19, minified: true }
    https://cdn.flowplayer.com/releases/native/stable/plugins/chromecast.min.js: { attributes: { defer: true }, type: external, process: false }
    #or
    https://unpkg.com/alpinejs@3.x.x/dist/module.cjs.js: { attributes: { defer: true }, type: external, process: false }
  dependencies:
    - core/drupal.element.matches

and then navigate to the homepage. Errors will be thrown by ajax.js and others.

Proposed resolution

Instead of setting window.once and calling to as a global, attach it to the Drupal global as Drupal.once or remove it from the global namespace by other means so as to avoid conflicts with third-party libraries.

[META] Designs for dark background layers and its color palette

$
0
0

Problem/Motivation

Claro has designs for white layers and have the basic colors like color for links set. But we still don't have any design or accessibility work done for dark layers/regions like Tour, Settings Tray or even a future dark mode. As a result, we currently have important accessibility issues on that regions:

Steps to reproduce

@todo

Proposed resolution

Design a new set of color palette/s and layer definitions for Claro that work with dark regions. Some explorations done so far can be found in Claro's working Figma file, and a few screensohts:

Remaining tasks

Other related issues:

  • Create issues for each component/region
  • User interface changes

    All dark regions will need to be updated.

    API changes

    Release notes snippet

    options_allowed_values() cache pollution

    $
    0
    0

    Problem/Motivation

    Under certain circumstances, it is relatively easy to cause cache polution for options_allowed_values's drupal_static.

    Steps to reproduce

    In custom entity:

      public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
        $fields = parent::baseFieldDefinitions($entity_type);
    
        $fields['options_list'] = BaseFieldDefinition::create('list_string')
          ->setLabel(t('Options'))
          ->setSettings([
            'allowed_values' => ['foo' => t('Foo'), 'bar' => t('Bar')],
          ]);
    
      }
    
      public static function bundleFieldDefinitions(EntityTypeInterface $entity_type, $bundle, array $base_field_definitions) {
        if ($bundle === 'baz') {
          $fields['options_list'] = clone $base_field_definitions['options_list'];
          $fields['options_list']->setSettings([
            'allowed_values' => ['baz' => t('Baz')],
          ]);
          return $fields;
        }
    
        return [];
      }
    

    Then bulk insert a bunch of entities where some have a bundle of baz and the rest are foobar. Once the foobar bundled entities are validated/saved, any attempts to perform entity validation on baz bundle entities will fail because they are passing an option value of 'baz' and the previous list of ['foo', 'bar'] was already statically cached by drupal_static().

    Proposed resolution

    Add the target bundle to the cache keys.

    Remaining tasks

    Tests

    User interface changes

    API changes

    Data model changes

    Release notes snippet

    Use sniff DrupalPractice.CodeAnalysis.VariableAnalysis on */tests/*

    $
    0
    0

    Problem/Motivation

    In #3106216: Remove unused variables from core we introduced the sniff DrupalPractice.CodeAnalysis.VariableAnalysis to detect unused variables in Drupal Core.
    To narrow the scope the decision was made to exclude all the test-classes.

    This issue is created to make that sniff run without errors on all test-classes.

    Steps to reproduce

    Proposed resolution

    - Remove the line <exclude-pattern>*/tests/*</exclude-pattern> from sniff DrupalPractice.CodeAnalysis.VariableAnalysis in core/phpcs.xml.dist
    - Fix all and any errors

    Remaining tasks

    User interface changes

    API changes

    Data model changes

    Release notes snippet

    Drupal Custom page views getting 404 error with phpUnit Functional test

    $
    0
    0

    Problem/Motivation

    After upating to Drupal core 9.3.2 getting issues with phpunit functional testing for Custom views

    Steps to reproduce

    Create a page view with latest Drupal core and export this view with custom and created a functional tests for this custom views
    end with error 404 the view pages not found

    Proposed resolution

    Not sure about this issues

    Remaining tasks

    NIl

    User interface changes

    Nil

    API changes

    Nil

    Data model changes

    Nil

    Release notes snippet


    Allow process plugins to flag a row to be skipped

    $
    0
    0

    Problem/Motivation

    Currently a process plugin can declare a row to be skipped by throwing a MigrateSkipRowException. Using exceptions as signals in this manner is not ideal. The process plugins have access to the $row. They should simply be able to set a flag on the row and return rather than trying to pass an exception up through the executable.

    Steps to reproduce

    Proposed resolution

    Remaining tasks

    User interface changes

    API changes

    Data model changes

    Release notes snippet

    Autoload classes of database drivers modules' dependencies

    $
    0
    0

    Problem/Motivation

    Database drivers that extend another database driver have to add the line with something like: include_once dirname(__DIR__, 8) . '/mysql/src/Driver/Database/mysql/Connection.php';. When this line is not added, the database driver will fail the installation proces. The extending database driver is then using a class that is not autoloaded and therefor does not exist.
    The include_once only works when the module with the extending database driver is in the same level in the directory structure. This is not very practical for sitebuilders. It is also not to the standard Drupal Core would like its code to be.
    Example database drivers that extend another database driver are: https://www.drupal.org/project/mysql56 and https://www.drupal.org/project/pgsql_fallback.

    Proposed resolution

    Improve the autoloading for the parent database driver during installation.

    Remaining tasks

    TBD

    User interface changes

    None

    API changes

    Extending database driver do not have to add include_once statement with every driver class they extend.

    Data model changes

    None

    Release notes snippet

    TBD

    [D7 PHP 8.1] system_modules(): Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

    $
    0
    0

    Problem/Motivation

    Follow-up from #3224299-40: [META] Make Drupal 7 core compatible with PHP 8.1

    Deprecated function: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in system_modules() (line 842 of /var/www/html/web/modules/system/system.admin.inc).

    Steps to reproduce

    Go to /admin/modules after a fresh install of drupal standard profile. Download a dev copy of probably any module (I used feeds) and version is null

    Proposed resolution

    Remaining tasks

    Write tests

    User interface changes

    API changes

    Data model changes

    Release notes snippet

    Error when I use the getTitle function of TitleResolver for the view

    $
    0
    0

    RuntimeException: Controller "Drupal\views\Routing\ViewPageController::getTitle()" requires that you provide a value for the "$view_id" argument. Either the argument is nullable and no null value has been provided, no default value has been provided or because there is a non optional argument after this one. in Symfony\Component\HttpKernel\Controller\ArgumentResolver->getArguments() (line 80 of /var/www/vendor/symfony/http-kernel/Controller/ArgumentResolver.php).

    Aggregated entity fields cause SchemaIncompleteException

    $
    0
    0

    Problem/Motivation

    While working on #2976147: Create a sales report supporting daily, weekly, monthly, and yearly breakdowns., my tests failed due to configuration schema validation.

    Schema errors for views.view.sales_report with the following errors: views.view.sales_report:display.default.display_options.fields.report_id.set_precision missing schema
    

    The report_id is the entity identifier base field. The View has aggregation enabled, and the report_id is set to COUNT.

    In Views, the handler is swapped to numeric as an override when the display is built. This is causing a SchemaIncompleteException exception to be thrown.

    This following code is what changes the handler and causes the schema error

    \Drupal\views\Plugin\views\display\DisplayPluginBase::getHandlers

            // If aggregation is on, the group type might override the actual
            // handler that is in use. This piece of code checks that and,
            // if necessary, sets the override handler.
            $override = NULL;
            if ($this->useGroupBy() && !empty($info['group_type'])) {
              if (empty($this->view->query)) {
                $this->view->initQuery();
              }
              $aggregate = $this->view->query->getAggregationInfo();
              if (!empty($aggregate[$info['group_type']]['handler'][$type])) {
                $override = $aggregate[$info['group_type']]['handler'][$type];
              }
            }
    

    Proposed resolution

    No idea.

    Remaining tasks

    • Write test which aggregates an entity ID
    • ???

    User interface changes

    API changes

    Data model changes

    Viewing all 296253 articles
    Browse latest View live


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