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

[meta] Replace assertions with more appropriate ones

$
0
0

Problem/Motivation

For example: assertSame(*, count()) can be replaced by assertCount()

Issues open:

Pending backport to D8:

Done:

Issues to be opened:

  • Remove redundant $message from assertCount calls
  • >assert.*\(.*is_.*\(: possibly replaced by assertNull, assertIsObject, assertIsString, assertIsWritable etc.
  • >assert(?:True|False)\(.*(?:==|===): possibly replaced by assertEquals, assertSame

Proposed resolution

Add child issues for each case and replace them.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Views RSS display always outputs ‘submitted’ by and ‘authored on date’ inside the description tag

$
0
0

Hi, I have tried outputting rss feeds straight as RSS feed, RSS default and force as fields.

Still the feeds publish with ‘submitted by’ and ‘publishing date’ shown inside the description tag, don’t want that :)

Have made sure that each content type has ‘authored by’ deselected, still no joy.

Is it hardcoded somewhere? Would most appreciate any suggestions on how to remove the unneccesary text that appears in my feeds.

The description is build inside \Drupal\node\Plugin\views\row\Rss::render

This seems ok, but somehow this doesn't account for some of the settings on the node type:

$build_mode = $display_mode;

    $build = node_view($node, $build_mode);
    unset($build['#theme']);

Workaround is using fields instead of content, steps can be found in #17

Convert "Active forum topics" block to a View

$
0
0

Problem/Motivation

The title says it.

This is part of #1823450: [Meta] Convert core listings to Views

From xjm's comment in #1823450-5: [Meta] Convert core listings to Views:
Would probably need forum data integration for {forum_index} to avoid potential performance regressions

Proposed resolution

Convert "Active forum topics" block to a View

Remaining tasks

User interface changes

Should be none.

Before (from #42)

After (from #68)

Note also from @webchick in #26:
this also "... actually fixes a bug with the old block where it lies to you about the existence of more forum topics"

Accessibility Improvements

  • ?

API changes

None?

Allow image style to be selected in Text Editor's image dialog (necessary for structured content)

$
0
0

Updated: Comment #212

Problem/Motivation

Inserting an image in the text editor dialog today allows the user to fiddle with image dimensions. It doesn't even have aspect ratio locking.

It's not great for the authoring experience nor for structured content reasons that users are defining the specific dimensions of every single image they insert. It'd be much better to allow them to choose from image styles — just like we do for image fields.

Proposed resolution

Allow an image style to be selected in the image dialog, which gets stored in a data-image-style attribute, and is handled by a yet-to-be-added imagestyle filter.

Remaining tasks

  1. Initial patch: select image style in dialog, inserting that sets a data- attribute, and a filter transforms the end result.
  2. Get #1589176-4: Follow-up: Use data-* to store #states api informations— a blocker to this patch — committed.

User interface changes

  • The new ability to select an image style.
  • A new filter.

API changes

None.

Views. Add access check when using "Output this field as a link"

#states not applied with single on off checkbox widget

$
0
0

Problem/Motivation

#states not applied with single on off checkbox widget

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Remove 'overwrite' as documented example in scaffold options

$
0
0

Problem/Motivation

In README.md one example lists "overwrite": true under extra > drupal-scaffold.

If I interpret the code correctly, it is not possible to set a default 'overwrite' at scaffold level. \Drupal\Composer\Plugin\Scaffold\ScaffoldOptions::__construct does not define an 'overwrite' default. Overwriting is default, but adding it explicitly to an example at scaffold level gives a wrong signal as if other defaults are possible.

Proposed resolution

Update the documentation.

template_preprocess_file_link() does not allow adding attributes to link element

$
0
0

I've noticed that the documentation on template_preprocess_file_link() includes:

array $variables: An associative array containing:
(...)
attributes: An associative array of attributes to be placed in the a tag.

(See: https://api.drupal.org/api/drupal/core%21modules%21file%21file.module/fu...)

However, the function actually initializes $options as an empty array, then sets some $options['attributes'] and passes that into the functions that generate the link markup.

If passed, the attributes in $variables['attributes'] are actually intended for the <span> that contains the file link - as seen in the default template, file-link.html.twig.
See: https://api.drupal.org/api/drupal/core%21modules%21file%21templates%21fi...

I'm guessing this was probably small documentation mistake, rather than a bug. I marked this as a feature request though, as it would be helpful to allow preprocess functions for this theme hook to provide attributes for the link element itself.


New Argument User contextual filters: User Email from logged in user

$
0
0

It would be nice if a Views contextual filter were available for User Email. Currently there is only filtering available for User ID. Not sure if there would be security concerns with placing the user email in that location.

Views date sorting word "Second" requires a context

$
0
0

The word "Second" used in views sorting date plugin requires a translation context as now it is always translated in a single way (for example I see "second" translated for the meaning of "2nd", not as a time unit in views sorting area).

BulkForm should not show actions that the user has no permissions to do

$
0
0

Problem/Motivation

In this issue #2172017: Bulk operations does not respect entity access was added entity access check for when you apply the action. But still for the user should not see a action that he can not perform.
So we should add a way to check if the user is able to perform an action over an entity type and if so show the action in the bulk.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Add a #disable_inline_form_errors_summary property to disable the Inline Form Errors summary

$
0
0

Problem/Motivation

In certain cases we want to disable duplicate messages (on top - summary - and inline).
We currently have the #error_no_message property which allowed us to disable errors messages for individual elements.

There may be some field that does not display the inline error, so the message is only visible in the summary. As an example, the Captcha field.
We should then keep the messages in the summary - even when the new property to disable the summary is requested - for fields that contain errors but can't display them inline (Eg. invisible elements, missing elements, ...).

Proposed resolution

Add a form property which can be used to disable IFE summary$form['#disable_inline_form_errors_summary'] = TRUE.
Keep the message in the summary for fields which can't show inline-error (Eg. invisible elements, missing elements, ...).

Completed tasks

Remaining tasks

User interface changes

  • Developers will be able to remove the Summary message when IFE is enable.
  • The summary should still be visible for an element which can't show inline-error (invisible element, missing element, ...).

API changes

The form element will have an optional #disable_inline_form_errors_summary boolean, that if TRUE, disables the duplicate messages from summary & inline-error elements. If one or more elements with errors can't show inline-error (Eg. invisible elements, missing elements, ...) , the summary will remain visible with those messages only.

Introduce 'update' environment for DrupalKernel

Remove drupal:8.?.? and use specific drupal version

Replace assertions involving calls to is_readable() and is_writeable() on files and directories with PHPUnit assertions

$
0
0

Problem/Motivation

For example:

- $this->assertFalse(is_writable($site_directory));
+ $this->assertDirectoryNotIsWritable($site_directory);
- $this->assertTrue(is_readable($this->image->getSource()));
+ $this->assertFileIsReadable($this->image->getSource());

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Unique field constraint does not work with entity reference fields

$
0
0

Problem/Motivation

Adding a constraint of UniqueField to an entity reference field does not enforce that the field value is unique.

One was added by:

function hook_entity_bundle_field_info_alter(&$fields, EntityTypeInterface $entity_type, $bundle) {
  if (!empty($fields['field_some_reference'])) {
    $fields['field_some_reference']->addConstraint('UniqueField', [
      'message' => 'An entity reference %value already exists.'
    ]);
  }
}

Proposed resolution

The problem seems to stem from UniqueFieldValueValidator.php on line 30.

$value_taken = (bool) \Drupal::entityQuery($entity_type_id)
    // The id could be NULL, so we cast it to 0 in that case.
    ->condition($id_key, (int) $items->getEntity()->id(), '<>')
    ->condition($field_name, $item->value)
    ->range(0, 1)
    ->count()
    ->execute();

$item->value returns nothing for an entity reference field even if a value is present.

Being that it's not the only field type that behaves this way, I am not sure what the best approach is that will cover all field types.

Remaining tasks

Disable image resize handles when image style is set

$
0
0

Follow-up to #2061377: Allow image style to be selected in Text Editor's image dialog (necessary for structured content).

Problem/Motivation

In point 14 of #2061377-253: Allow image style to be selected in Text Editor's image dialog (necessary for structured content) it was suggested to disable the resize handles for inline images within the wysiwyg mode of ckeditor when an image style is set for the image.

Proposed resolution

Disable the resize handles for images that have an image style set.

User interface changes

  • Different user experience for manipulating inline images.

API changes

None.

Actually exclude user register, login, logout, and password pages from search results in robots.txt (current rules are broken)

$
0
0

Right now these pages are indexing by search engines.

These rules make no sense because of trailing slash.

  • Disallow: /user/register/
  • Disallow: /user/password/
  • Disallow: /user/login/

Remove redundant role from node articles

@see should not be used inside a @param description

$
0
0

See https://www.drupal.org/project/drupal/issues/2933424#comment-12399710 and subsequent comments for background.

There are various places in core that use @see inside the description of a function @param. This is not correct, and causes issues on https://api.drupal.org. The correct method is to just use "See ..." (i.e. write it as a sentence) if the thing you're linking to is closely related to the @param in question. (Or, if it's more relevant for the entire function instead, then it should remain a @see but be moved to its own line in the main function docblock.)

core/lib/Drupal/Component/Datetime/DateTimePlus.php is an example of a file in core that has a lot of these violations, but there are others. It may be necessary to come up with a grep expression to look through core for more of them.

Viewing all 297436 articles
Browse latest View live


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