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

No link template "canonical" found for the "file" entity type

$
0
0

Problem/Motivation

If a file entity is loaded, a call to link() function ($entity->link()), results in following exception:

Drupal\Core\Entity\Exception\UndefinedLinkTemplateException: No link template "canonical" found for the "file" entity type in Drupal\Core\Entity\Entity->urlInfo() (line 188 of /var/www/html/drupal8/core/lib/Drupal/Core/Entity/Entity.php).

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes


Typing error in the Media module description

$
0
0

Problem/Motivation

The module description has a typing error, saying "configuration of display of media items" instead of "configuration, and display".

Proposed resolution

Replace "of" with "and". That way the module description will also mirror the one of the Node module once #2570985: Update the module descriptions on the Extend page is committed

Remaining tasks

None

User interface changes

This is a UI text change.

API changes

None.

Data model changes

None.

Media module in core: add poster image to HTML5 videos

$
0
0

Hi All,

Drupal 8.5.0 with the media_module in core is bundled with four media types: audio, file, image and video.

Let's create a content type with two fields:

  1. the field_local_video_file field which is using the media video type
  2. the field_local_image_file field which is using the media image type

The node rendering an HTML5 video is handled by the file-video.html.twig file (which is a file_module core file located at core/modules/file/templates/file-video.html.twig):

{#
/**
* @file
* Default theme implementation to display the file entity as a video tag.
*
* Available variables:
* - attributes: An array of HTML attributes, intended to be added to the
*   video tag.
* - files: And array of files to be added as sources for the video tag. Each
*   element is an array with the following elements:
*   - file: The full file object.
*   - source_attributes: An array of HTML attributes for to be added to the
*     source tag.
*
* @ingroup themeable
*/
#}
<video {{ attributes }}>
  {% for file in files %}
    <source {{ file.source_attributes }} />
  {% endfor %}
</video>

Now, the idea is to offer the possibility to display a poster image using content from the field_local_image_file for the HTML5 video.

It would be nice if this feature could be managed by {{ attributes }} but I cannot figure how to implement this.

Thank you!

Gilles

use backticks for table aliases

$
0
0

This code fails against MySQL (10.1.33-MariaDB):

    db_select('sslcerts', 'ssl')->fields('ssl')->execute()->fetchAllAssoc('id');

The SQL statement it creates is approximately SELECT ssl.* FROM sslcerts ssl;. MySQL is not happy with this, and says:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ssl.* from users ssl' at line 1

I suspect that SSL is a reserved keyword in MySQL, or something? If I use any other table alias, things are working fine. It also accepts my query when I put backticks around the offending word, like so: SELECT `ssl`.* FROM sslcerts `ssl`;. However, this isn't how Drupal core builds the query, which is what I would suggest as a fix.

Not sure if this is a bug report or feature request, to be honest. Maybe it's just MySQL being :poop:

Render view in specific language (programmatically)

$
0
0

I am trying to render a view (view config translation + content) in a specific language during cron.

The view gets loaded via Views::getView() and after setting some arguments and a display it gets rendered through $view->render() and the renderRoot() method of the renderer service.

The view only gets rendered in the site's default language. I tried many things like setting the view's language in storage:

$view->storage->set('langcode', $this->langCode);

or setting the display language:

$view->getDisplay()->setOption('rendering_language', $this->langCode);

and some other unholy stuff.

The views display is a block.

Anybody any idea how to do this?

Action plugins have the wrong comments for contructors

$
0
0

Description

GotoAction plugin in actions module and CancelUser in user module have the same comment for the constructor "Constructs a new DeleteNode object.". Probably the result of copy/paste.
In fact they don't create DeleteNode object

Add GROUP_CONCAT aggregate function to views

$
0
0

It would be very useful for to have a GROUP_CONCAT available as an aggregate function. like what we have now e.g. SUM, MIN, ...

Add README.txt to Umami theme

$
0
0

Problem/Motivation
The Umami theme lacks of a README.txt file.

Proposed resolution
Add README.txt file to Umami theme.
The goals are:

  • Report the info provided in the info.yml file.
  • Explain the origin of the theme's name.
  • Provide a link to the theme documentation page.
  • Provide a link to documentation about Drupal theming.

Remaining tasks
User interface changes
API changes


Media title is overridden with metadata on translation save

$
0
0

A media title is overridden with filename after saving of media translation with different image for target language

To reproduce:

  • Install Drupal 8.6.0 in English
  • Enable these modules: Core: Media, Multilingual: Content Translation
  • Add a language ( /admin/config/regional/language )
  • Check the 'Media' custom language settings in /admin/config/regional/content-language and make image media type translatable (translation for Image field should be enabled too).
  • Add an image (/media/add/image) and translate it: upload different image and change title

Actual result: media title is overridden with file name in translation.

I guess there is mistake in Media::prepareSave() method:

        foreach ($translation->bundle->entity->getFieldMap() as $metadata_attribute_name => $entity_field_name) {
          // Only save value in entity field if empty. Do not overwrite existing
          // data.
          if ($translation->hasField($entity_field_name) && ($translation->get($entity_field_name)->isEmpty() || $translation->hasSourceFieldChanged())) {
            $translation->set($entity_field_name, $media_source->getMetadata($translation, $metadata_attribute_name));
          }
        }

Looks like current condtition is not OK, and OR condition should be replaced with AND condition:

if ($translation->hasField($entity_field_name) && ($translation->get($entity_field_name)->isEmpty() && $translation->hasSourceFieldChanged())) {

In this way title will be overridden only in case when it is empty.

Array to string conversion in ModalRenderer.php

$
0
0

When installing the new Media Library experimental module I ran into a notice error:

Notice: Array to string conversion in /var/www/docroot/core/lib/Drupal/Component/Render/PlainTextOutput.php on line 22

Which prohibits the Media Library expanding when hitting the "Browse media" button due to an issue of improperly formatted return data in the AJAX system.

The "OpenModalDialogCommand" function call is expecting a string. So we need to detect a string or rely on the titleResolver more.

Views exposed form Ajax selector doesn't work on buttons

$
0
0

When Ajax is enabled to a Views block display with exposed form filter, submitting the filter causes the page the reload. This happens when using themes that use buttons as opposed to input types of submit or image (e.g. Bootstrap). The problem doesn't exist in any of the base themes, but since ajax_view.js only attaches the ajax functionality on those two input types, it fails on other cases (e.g. Bootstrap-related themes).

One part of the fix is to apply the correct dom_id class on views-view.html.twig, but the other part relies on actually recognizing button[type=submit] as one of the elements where the ajax exposed filter should work.

This issue is related to https://www.drupal.org/project/bootstrap/issues/2651008, but I can't find any core patches to ajax_view.js so far.

Responsive remote videos via the Media module

$
0
0

I was just trying out the remote video media type and i'm struggling to see how I can make this responsive for different device widths.

So when you add a remote video and then display it as the rendered entities it looks to be adding an iframe with a src of:
/media/oembed?url=https%3A//www.youtube.com/watch?v=XXXXXXX&max_width=AAA&max_height=BBB

With AAA being the max width defined in the display and BBB being the max height. This results in another iframe inside with a source of:
https://www.youtube.com/embed/XXXXXXX?feature=oembed and the same height and widths set on the iframe attributes

My problem is the size set in the display e.g. 842px width is fine for desktop but on mobile it results in either an iframe thats wider than the container or with css if I set a "max-width: 100%" on the first iframe it chops the video iframe at the boundary.

It's not possible to target the inner youtube iframe with CSS so it can also have a max width of 100%. I have been able to apply styles with javascript but it's not a very clean way of doing it and possible not that reliable.

Any ideas of what can be done? Am I right not alot without getting rid of this 2 iframe approach?

Ideally what Id like is to have the video full width of the container and then I can change the height at different breakpoints. Which I could do easily with css if this was just 1 iframe but as its an iframe its not easy

Undefined property option when reducing exposed filter set

$
0
0

Hi,

I encountered the following error when exposing Translation Language in a views exposed filter and reducing the options set to just English and Spanish:

Notice: Undefined property: Drupal\Core\StringTranslation\TranslatableMarkup::$option in Drupal\views\Plugin\views\filter\InOperator->reduceValueOptions() (line 275 of ..core/modules/views/src/Plugin/views/filter/InOperator.php).

Steps to reproduce this error:

  1. Create a custom view
  2. Add an exposed filter for Translation Language
    • Select single filter
    • Check only English and Spanish as options under the Language heading
    • Select "Limit list to selected items"

I could not find an open issue for this. If there is one already, please feel free to close this issue out. I'll be attaching a patch below.

Replace all calls to db_like(), which is deprecated

Update the module descriptions on the Extend page

$
0
0

Problem/Motivation

The description of a module on the Extend page, describes what the module does.
Not all module descriptions on the Extend page follow the common format, as described in the Help text standard.

Proposed resolution

Change the descriptions in the modules .info.yml files for the stable modules so that they are correct, consistent, and follow the same format.
Experimental modules should have their own issues assigned because their functionality is still changing too much to hold up this issue in general.

Remaining tasks

None.
Several modules were added to core in later versions since this issue was started (see #101 Media, Settings tray, Workflow, Datetime range, Migrate, Field layout, Layout builder, Media library and Workspace). If necessary these are fixed in separate issues to avoid further issue creep.

User interface changes

This is a UI text change.

API changes

None.

Data model changes

None.


Use Prettier for formatting YAML

$
0
0

Problem/Motivation

Formatting YAML files by hand is error-prone. We can introduce easily whitespace that breaks the file

Proposed resolution

Use Prettier to format YAML
We have Prettier now in Drupal core, see #2978964: Use Prettier for formatting core JavaScript and Change record [#2986680].
Let's take advantage of it, and use it also for formatting YAML files

The inconvenient is that we are introducing a npm dependency to be able to contribute changes to YAML files.

Remaining tasks

Explore the solution, and see if Prettier-ified YAML is compatible with Drupal coding standards
Tests
Documentation

User interface changes

No changes

API changes

No changes

deprecate magic ServiceProvider file discovery; declare in services.yml

$
0
0

In the docs at https://www.drupal.org/docs/8/api/services-and-dependency-injection/alte...

> Note that if you want this service alteration to be recognized automatically, the name of this class is required to be a CamelCase version of your module's machine name followed by ServiceProvider, it is required to be in your module's top-level namespace Drupal\your_module_name, and it must implement \Drupal\Core\DependencyInjection\ServiceModifierInterface (which ServiceProviderBase does).

The relevant code is in discoverServiceProviders().

It seems a bit backwards to be doing magic discovery on a class name, when all other things of this sort are done by explicitly declaring the class -- eg dynamic routes, dynamic permissions.

In line with that pattern, we should declare a dynamic service provider in the module's services.yml file.

Add @internal to automated tests classes

$
0
0

Follow-up to #2873395: [meta] Add @internal to core classes, methods, properties

Problem/Motivation

https://www.drupal.org/node/2562903#tests
Specific automated test classes inside Drupal core should not be considered part of the public API.

Proposed resolution

Add @internal tag to automated test classes inside the core

How to fix this issue

  1. Read the description for a category in its issue
  2. Identify and confirm an example. Ask in IRC if unclear.
  3. Search core for the relevant category.
  4. Add @internal per the backwards compatibility policy.
  5. Reviewers should confirm that each @internal mention is appropriate for that category according to the policy.

Remaining tasks

Make the Patch and post it

User interface changes

None.

API changes

There should be no implicit API changes.

Create an Out Of The Box strategic initiative landing page

$
0
0

There is a page listing the current core strategic initiatives: https://www.drupal.org/about/strategic-initiatives

The Out Of The Box Initiative is listed there and the title is hyperlinked to this page: https://www.drupal.org/about/strategic-initiatives/out-of-the-box

But there is no content on that page.

The current main content about Umami is here: https://www.drupal.org/project/ideas/issues/2847582

I have discussed this with @eli-t and he's suggested this plan:
1) He's finding out who has edit rights to the blank page, starting by asking Gabor in the next weekly meeting
2) I will do a review of the other initiative pages to understand the format and usage, and how that relates to their issue page in the Drupal Core Ideas project
3) I will start a Google Doc to draft some content for the currently blank Out of the Box page

Remove config-editing parts from demo_umami_install() in favor of exported configuration

Viewing all 294956 articles
Browse latest View live


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