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

Convert web tests to browser tests for contextual module


Log message if menu_link_parent plugin skip the row

$
0
0

Problem/Motivation

Continuing from https://www.drupal.org/project/drupal/issues/2951715#comment-12559059

core/modules/migrate/src/Plugin/migrate/process/MenuLinkParent.php:100:    
throw new MigrateSkipRowException()

Proposed resolution

Log a message to MigrateSkipRowException to clearly explain why the row is skipped.

Remaining tasks

Patch

User interface changes

NA

API changes

NA

Data model changes

NA

Don't try to include Media CSS library if Media Entity 1.x is being used

$
0
0

Problem/Motivation

The seven theme tries to include some CSS inside a form alter that affects all media forms:

/**
 * Implements hook_form_BASE_FORM_ID_alter() for \Drupal\media\MediaForm.
 */
function seven_form_media_form_alter(&$form, FormStateInterface $form_state) {
  // @todo Revisit after https://www.drupal.org/node/2892304 is in. It
  // introduces a footer region to these forms which will allow for us to
  // display a top border over the published checkbox by defining a
  // media-edit-form.html.twig template the same way node does.
  $form['#attached']['library'][] = 'seven/media-form';
}

However, it is possible that a site is using Media Entity 1.x instead of core Media, so this library won't be available in that case.

Proposed resolution

Only include the core CSS library if we are using core Media, not contrib.

Unable to remove default image from image field/instance

$
0
0

Updated: Comment #1

Problem/Motivation

Image field allows site administrator to define default image on field and/or instance level. file_managed Form API element is used to provide this functionality. Form element includes "Remove" button which is used to remove default image form the configuration.

It is easy to reproduce this:
- install Drupal with "Standard" profile
- log in as admin
- navigate to admin/structure/types/manage/article/fields/node.article.field_image
- upload default image
- save configuration
- navigate back to admin/structure/types/manage/article/fields/node.article.field_image
- try to remove default image by clicking "Remove" button
- image stays there

This might be more general problem of file_managed form element. It definitely needs test coverage.

Proposed resolution

No solution found yet.

Remaining tasks

- fix bug

User interface changes

N/A

API changes

N/A

- Bug found in #1205822-23: File(s) silently deleted when #access=false

Layout template suggestions are not loaded properly

$
0
0

Problem/Motivation

Layout discovery doesn't load layout suggestions unless the layout definition is prefixed with layout__ and the template with layout--.

This break any existing site using the (deprecated) Layouts contrib module, where the prefixing wasn't necessary.

Additionally site-builders and developers get confused as twig debug comments suggest wrong [as in: not-prefixed] template suggestions names, i.e. (from: #2905197: Template override is not working):

layouts definitions file: naurodvolleys.layouts.yml

naurodvolleys_1x1:
  label: "naurodvolleys 1x1"
  category: "naurodvolleys"
  template: "templates/content-layout/naurodvolleys_1x1"
  regions:
    main:
      label: "Main"

Template suggestions:

Target suggestion: naurodvolleys-1x1--node-result-1x1.html.twig

Suggestion is not loaded.

For further investigation you can read #2862683: 'base hook' key prevents template suggestions from working comments from #25 on going.

Proposed resolution

The first task should be to understand if prefixing layouts with layout__/layout-- as core does is the right way.
- If it is then we need to update the documentation pages How to register layouts and How to upgrade from Layout Plugin, together with updating the twig debug comment suggestions.
- if it is NOT, then we need to fix the issue in order for layout suggestions to be loaded correctly.

@tim.plunkett on #9 confirmed this is actually a bug, themes and modules layout templates suggestions needs to be loaded in accordance with their definitions.

Remaining tasks

  1. Define what is the right way to name layout bundles and their templates, if the layout__/layout-- prefixes are mandatory. (#9
  2. Update the issue summary with the right proposed resolution when task 1) is complete #11
  3. Code a solution
  4. Update the documentation if necessary

User interface changes

This is a pure code change, so no UI changes expected.

API changes

There may be Layout API changes, depending what the result of task 1) will be.

Convert \Drupal\field\Tests\NestedFormTest to BrowserTestBase

Convert AJAX part of \Drupal\field\Tests\Number\NumberFieldTest to JavascriptTestBase

$
0
0

Problem/Motivation

drupalPostAjaxForm() is simulating the behaviour of ajax.js, so using it, doesn't really provide fundamental guarantees.
#2809161: Convert Javascript/AJAX testing to use JavascriptTestBase suggests to convert them to JavascriptTestBase

Proposed resolution

  1. Figure out which part of the test is testing PHP code and which part ajax behaviour
  2. Extract the ajax behaviour into a test that extends JavascriptTestBase

Remaining tasks

User interface changes

API changes

Data model changes

SystemListingCompatibleTest isn't testing what it says anymore

$
0
0

Follow up to #2982740: Convert \Drupal\drupal_system_listing_compatible_test\Tests\SystemListingCompatibleTest to KernelTestBase

\Drupal\Tests\drupal_system_listing_compatible_test\Kernel\SystemListingCompatibleTest says:

/**
   * Attempt to enable a module from the Testing profile.
   *
   * This test uses the Minimal profile, but enables a module from the Testing
   * profile to confirm that a different profile can be used for running tests.
   *
   * @var array
   */
  public static $modules = ['drupal_system_listing_compatible_test'];

It turns out, this test no longer really tests that we can install a module outside the installed profile in the test, since there is a copy of the drupal_system_listing_compatible_test module in the system module. So if it can't find the version in the profile, it just installs the one in the system module.

The system version is used by \Drupal\Tests\system\Kernel\Common\SystemListingTest::testDirectoryPrecedence to check that modules placed in a profile override other versions of the same module. So we can't just remove the system version.


Reuse option in FileCopy migrate process plugin not work with remote files

$
0
0

Problem/Motivation

I have tested that code:

process:
    uri:
      plugin: file_copy
      reuse: true
      source:
        - source_file_path_remote
        - destination_file_path

In the transform method of file_copy process plugin the download process plugin is called when a source file is remote. So the file is downloaded ignoring the reuse option.

Proposed resolution

Add a new configuration key 'file_exists' that holds a value declaring what action to take when the destination file exists. The options are
replace - Replace the existing destination file
rename - Make the destination filename unique by adding '_N'
use existing - Take no action

Remaining tasks

Review
Add change record

Convert AJAX part of \Drupal\system\Tests\Ajax\AjaxFormCacheTest to WebDriverTestBase

$
0
0

Problem/Motivation

drupalPostAjaxForm() is simulating the behaviour of ajax.js, so using it, doesn't really provide fundamental guarantees.
#2809161: Convert Javascript/AJAX testing to use JavascriptTestBase suggests to convert them to JavascriptTestBase

Proposed resolution

  1. Figure out which part of the test is testing PHP code and which part ajax behaviour
  2. Extract the ajax behaviour into a test that extends WebDriverTestBase

Remaining tasks

User interface changes

API changes

Data model changes

System: Convert ErrorHandlerTest to phpunit

$
0
0

Convert system functional tests to phpunit.

Scope:
./System/ErrorHandlerTest.php

getUuid() in class MenuLinkContent not returning any value

$
0
0

In core/modules/menu_link_content/src/Plugin/Menu/MenuLinkContent.php line 201

The documentation says that it should return the menu link ID but it was not returning anything.

  /**
   * Returns the unique ID representing the menu link.
   *
   * @return string
   *   The menu link ID.
   */
  protected function getUuid() {
    $this->getDerivativeId();
  }

Fix Drupal.Commenting.FunctionComment.IncorrectTypeHint and Drupal.Commenting.FunctionComment.InvalidTypeHint

Local tasks are not shown after enabling module

$
0
0

Problem/Motivation

When you currently enable a module, you'll notice that new local tasks are not visible. They only appear after clearing cache.
The problem was noticed in the field group module (#2848314: Add group button is not available at manage form display). But i notice that this is also the case for Field UI.

Steps to Reproduce:

  1. Go to the admin/modules
  2. Uninstall field ui
  3. Tasks are now gone on the 'Edit article content type' screen
  4. Install the module and refresh 'Edit article content type'. You'll notice that the tasks are not shown yet.
  5. Clear cache and refresh screen. The tabs are now correctly appearing.

Proposed resolution

Make sure that local tasks are also correctly rebuild when enabling modules.

Submenus not loaded (item.below is always empty)

$
0
0

I can't get submenus to work with Drupal 8.4 and PostgreSQL.

The following two attached screenshots (dropdown1 and dropdown2) show that I've set up the "enabled", "show as expanded" and parent
links correctly:


Here is the value of $data at line 272 of \Drupal\Core\Menu\MenuLinkTree#build_items():
It shows that the subtree is missing, even though 'hasChildren' is true. Thus $element['below'] is
not set -- this is used in the templates to generate the submenus. See the menu.png file.


The default view mode for entities should be 'teaser' and 'full' should be customized by default

$
0
0

Currently we are always running into problems that for the 80% of use cases, when you are outputting nodes, you are doing so in lists or teasers. Viewing a node at node/[node:nid] with the 'full' view mode is often the special case. We are getting more used to creating different view modes as we need them for listings, and when you configure your view modes in the 'Manage display' tab, when you are changing the 'Default', this really only affects the full view mode. I think the 'Default' should instead affect the teaser view modes and *not* the 'Full' view mode. Not sure if this makes sense.

drupal_tempnam doesn't respect subdirectories for stream wrappers

$
0
0

I was trying to do this:

// Create a file in '/tmp/some-path'.
$file = drupal_tempnam('temporary://some-path', 'prefix');

But the returned filename will always reside in the base directory of the 'temporary' wrapper, because the implementation of drupal_tempnam uses the wrappers getDirectoryPath method, which basically returns the root of the filesystem represented by the wrapper.

Is this on purpose? Or a bug that needs fixing?
If the former, the docs need changing.

Edit form for past revisions

$
0
0

You need to be able to see the actual edit version of a past revision in order to properly retrieve content.

Eg:

1. User A puts some complex formatted HTML in the node body
2. User B removes it while making other edits
3. User A wants it back.

You need to see the body text in an actual edit form for this to work. See Wikipedia, for example.

Change order of parameters in Entity constructors

$
0
0

It's a follow-up from #1796604: Make constructor parameters consistent

Problem/Motivation

There's a inconsistensy in parameters order for:
- entity_create($entity_type, array $values)
- EntityInterface::__construct(array $values, $entity_type)
Also all derived interfaces & implementations are using
ContentEntityInterface::__construct(array $values = array(), $entity_type) with defaults

Proposed resolution

Make $entity_type the first and required parameter and optional $values array line entity_create() does

Remove ability to load all content entities at once from Entity::loadMultiple()

Viewing all 293902 articles
Browse latest View live