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

Private default image is inaccessible


add configurable description to content type title field.

[meta] Symfony 4.0 compatibility

$
0
0

Problem/Motivation

The Symfony 3.4 LTS will be EOL in 2021: http://symfony.com/doc/current/contributing/community/releases.html#sche...

This means we need to be ready to move to Symfony 4 before then.

Proposed resolution

We should at least do the following:

1. Identify all the deprecated Symfony code that Drupal 8 relies on and update for it, opening issues for anything not straightforward #2959269: [meta] Core should not trigger deprecated code except in tests and during updates

2. Have an issue with a patch that updates to Symfony 4 so we can see if it passes or not.

3. Potentially, relax our composer.json requirements to allow Symfony 4 to be installed, once the above two are done, if it's feasible to do so.

Remaining tasks

We need to resolve https://github.com/symfony/symfony/issues/25786 upstream.

User interface changes

API changes

Data model changes

Migrate UI - allow modules to declare their migration status

$
0
0

Problem/Motivation

Modules need a way to declare their migration status and give a short description on the Migrate Upgrade review page, /upgrade. The short description can have a link to a documentation page for example for known issues.

The form lists all modules on the source site in either a 'will be upgraded' or 'will not be upgraded' list. If the module has migrations, it will be displayed in the 'will be upgraded' list, even if it only has one migration and needs more than one to be complete. We need a mechanism that can explain this situation in the UI.

Note: in #2914974: Migrate UI - handle sources that do not need an upgrade we defined a list of modules that do not need any migrations (e.g. Overlay, Help) or the contrib functionality has moved into core and there is not a D8 core module with the same name. These modules are listed in ReviewForm::$noUpgradePaths

In a migrate meeting, using a hook or an event was discussed. A possible solution, using hook_form_alter, was implemented in #2914974: Migrate UI - handle sources that do not need an upgrade and removed after a review #176. That review asked some questions, listed below, which should be resolved here.

  1. The CR is titled Provide a Method to Intentionally Mark Modules, Themes and Profiles as not Upgradable but we're not really providing a method.
  2. Did we give consideration to a dedicated API? E.g. we could put entries in .info.yml or we could put .migrate.info.yml files in modules.
  3. How likely is it that contrib modules will need to make this change?

Proposed resolution

In a migrate meeting option #2 was decided as the best option, reasons included that it is easy to add and there is no need to write code. See #7 and #8.
Add a version key to identify the source version. While working on this it became clear that the status needs to be declared by source version. See #10

Remaining tasks

  • Decide on the format of the new 'migrate' key and values in .info.yml. Suggested formats are in #11 and #15.
  • Decide on the allowed values for status. Suggestions are in #7, #9. Currently proposed values are 'complete', 'incomplete' and 'n/a'. The UI impact with a screenshot is in #28.
  • Decide if adding a key for source version is ok. As pointed out in #10, the status needs to be declared by source version.
  • Review
  • Update change record
  • Update handbook documentation
  • Commit

About the scope of this issue

The UI impact to Migrate Drupal UI is discussed in this same issue so that we have a holistic view on the design but the actual change to Migrate Drupal UI will be handled in a separate issue, see #2928147: Migrate UI - add 'incomplete' migration status.

HTTP autocomplete Ajax call from HTTPS pages

$
0
0

I am using https on my site without setting

$base_url = "https://example.com";

since we need to have the site to be accessible through different domains at the same time. Any autocomplete call uses http instead of https and causes an Ajax error because the browser prevents mixed content (http and https).

I tried patching misc/autocomplete.js with:

diff --git a/misc/autocomplete.js b/misc/autocomplete.js
index af09071..d6dbff7 100644
--- a/misc/autocomplete.js
+++ b/misc/autocomplete.js
@@ -7,7 +7,7 @@ Drupal.behaviors.autocomplete = {
   attach: function (context, settings) {
     var acdb = [];
     $('input.autocomplete', context).once('autocomplete', function () {
-      var uri = this.value;
+      var uri = this.value.replace("http://", "https://");
       if (!acdb[uri]) {
         acdb[uri] = new Drupal.ACDB(uri);
       }
--
2.7.4

and even though the jquery ajax call url value is https://example.com/index.php?q=ar/user/autocomplete it still tries to call http://example.com/user/autocomplete

Replace all calls to db_select, which is deprecated

PluginDependencyTrait::calculatePluginDependencies() does not handle theme provided plugins

$
0
0

Problem/Motivation

Layout Discovery allow themes to declare layouts and Field Layout allow display modes to use theme-defined layouts. The thing is that if you use a theme-defined layout then export the display mode configuration, the theme is going to be in the dependencies of the config object under the "module" key.

Steps to reproduce

  1. Install Drupal standard profile
  2. Enable Field Layout
  3. Copy core/modules/system/tests/modules/layout_test/layout_test.layouts.yml to core/themes/bartik/bartik.layouts.yml
  4. Copy core/modules/system/tests/modules/layout_test/templates to core/themes/bartik/templates
  5. Rebuild caches
  6. Go to admin/structure/types/manage/article/display and set the layout to one the those in the "Layout test" category
  7. Save and export configuration

Expected: the theme is in the dependencies.theme section of the core.entity_view_display.node.article.default.yml file
Current: the theme is in the dependencies.module section of the core.entity_view_display.node.article.default.yml file

Proposed resolution

TBD

Remaining tasks

Contributor tasks needed
TaskNovice task?Contributor instructionsComplete?
Create a patchInstructions
Add automated testsInstructions
Add steps to reproduce the issueNoviceInstructionsDone

User interface changes

None.

API changes

None.

Data model changes

None.

Exposed filter reset redirects user to 404 page on AJAX view when placed as a block

$
0
0

Steps to recreate:

- Create an AJAX enabled view with exposed filters (as drop down), enable the reset button
- Create a page and place the view as a block on the page.
- Load the view page - no reset button
- Click filter submit button
- Reset button appears
- Click Reset button

- The page is redirected to a system/404


Cannot use relationship for rendered entity on Views

$
0
0

Problem/Motivation

You cannot create a view and try to list rendered entities using relationship.

Steps to reproduce (based on Standard profile):

  1. Add an entity reference field named "field_content" to the "page" content type. Allow content > article references.
  2. Create and edit a content view.
  3. Add a relationship for "Content using field_content." or "Content referenced from field_content."
  4. The row style plugin is "Content" by default.
  5. Click on "Teaser" in order to change the view mode, nothing happens.
  6. You can't choose a view mode even if you don't want to actually use a relationship, just having one on your view triggers this.

The problem is a fatal AJAX error triggered when RowPluginBase::buildOptionsForm() calls RelationshipPluginBase::init() while providing a wrong argument type (Array instead of DisplayPluginBase).

Argument 2 passed to Drupal\views\Plugin\views\relationship\RelationshipPluginBase::init() must be an instance of Drupal\views\Plugin\views\display\DisplayPluginBase, array given, called in /app/web/core/modules/views/src/Plugin/views/row/RowPluginBase.php on line 93

Proposed resolution

Fix it, by passing along the relationship as needed and using it.

Remaining tasks

None.

User interface changes

None

API changes

None

 

Contributor tasks needed
TaskNovice task?Contributor instructionsComplete?
Create a patchInstructionsExtract the test code + yml file out of the patch in #26

JS: Polyfills support

$
0
0

Problem/Motivation

Right now we don't have a solid plan for how we can handle polyfill support.

Proposed resolution

For now, I see a few options:

1. Include the appropriate polyfills manually:

We can provide one file (e.g misc/polyfills.es6.js) which includes needed polyfills (most probably used from https://github.com/zloirock/core-js).

This file will be loaded as the first one before any other JS files.

The similar approach was done by CRA.

2. Add https://polyfill.io/

What we need is just add one js file before any others:
<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>

But it seems polyfill.io is a good service with bad polyfills (different authors/projects which doesn't well play together).

3. Configure https://babeljs.io/docs/en/babel-polyfill

It's quite heave. But will include all needed polyfills. Need more investigation.

4. Configure https://babeljs.io/docs/en/babel-plugin-transform-runtime

This solution will add polyfills automatically only when needed (based on target browsers from babel-present-env).

But, that's something which depends on require or import - we don't support it ¯\_(ツ)_/¯

5. Any others?

Remaining tasks

1. discuss with community
2. write solution
3. review
4. 🎉

Make the one-time login time-to-live (TTL) value configurable in the UI

$
0
0

It'd be convenient to change the hard-coded value for the one-time login to a variable that can be set in the database. Specifically, on sites that require admin approval, 24 hours might not be enough time for that link depending on the site's audience (such as business users away from their email for a weekend). 24 hours makes a lot of sense for forgotten passwords, but for approved users it could be a little short.

Views creates invalid revision id twig token variable

$
0
0

I created a View of content revisions. We added a field to the view (a taxonomy reference in this case) and selected the "historical data" value (to show the revision value vs the current node value). We also added an Edit link for the node.

When displaying the view we get the following warning:

Warning: assert(): Tokens need to be valid Twig variables. failed in Drupal\views\Plugin\views\PluginBase->viewsTokenReplace() (line 371 of core/modules/views/src/Plugin/views/PluginBase.php).

When debugging this, we discovered the token it is complaining about is "field_category-revision_id". This is not a valid Twig variable because of the "-". In [#2548291] core changed usage of "-" to "__". However, Views still uses a "-" when adding "revision_id" to a field.

Tracked this down to core/modules/views/views.views.inc in views_field_default_views_data() (using 8.5.x core here):

    if ($type == EntityStorageInterface::FIELD_LOAD_CURRENT) {
      $group = $group_name;
      $field_alias = $field_name;
    }
    else {
      $group = t('@group (historical data)', ['@group' => $group_name]);
      $field_alias = $field_name . '-revision_id';
    }

This needs to be changed to "__revision_id" but not sure what else in core or contrib relies on this.

MigrationLookup::skipOnEmpty docblock and typehint mismatch

$
0
0

The Docblock for this function lists $value as mixed, but the typehint says array. This parameter is passed to array_filter, which expects an array, and is always called with an array, so the php typehint is correct. Update the docblock to match.

Add Block types link at admin/structure

$
0
0

Problem/Motivation

When the comment, node and media modules are enabled, the following admin links are easily accessible at /admin/structure:

  • Comment types (/admin/structure/comment)
  • Content types (/admin/structure/types)
  • Media types (/admin/structure/media)

However, for the new user, it is not immediately obvious that in order to add/edit a Block type you have to:

  • Click on Block layout (/admin/structure/block)
  • Click the Custom block library tab (/admin/structure/block/block-content)
  • Click the Block types link (/admin/structure/block/block-content/types)

Proposed resolution

Add a default "Block types" menu link to the administration menu at /admin/structure that links to /admin/structure/block/block-content/types as seen below:

Block types

Remaining tasks

TBD

User interface changes

New default Administration menu link

API changes

None

Data model changes

None

Uploaded files are impossible to replace

$
0
0

Problem/Motivation

(/admin/content/files allows only to browse the files.

There seems to be no way in Drupal to overwrite a file, and keeping the same filename.

Deleting the file and replacing it with a new version while retaining the same filename does not work, as the new version would automatically get a prefix ("_0") attached to it each time a new version is uploaded (for example: "filename_0.pdf"; "filename_1.pdf", etc.).

"/admin/content/file/fiiename.pdf" seems to allow the file to be replaced when it is saved, but it still does not automatically replace it with the new version.

Proposed resolution

It should be possible to overwrite a file and keeping the same filename.

Original report by [dupal.user]

(There seems to be no way in Drupal 8 to to manually delete a file, other than waiting for some automatic cleanup of orphaned files.

Primitive solution: /admin/content/files may allow deleting files just as /admin/content allows deleting content.

Better solution: It should be possible to choose between deleting or unlinking previously uploaded file field attachments when editing a node.

Deleting is required in order to replace a file with a new version.)


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

Links with no path get active class on front page

$
0
0

<nolink> and <none> are two routes provided by core that can be used to create empty links, without urls. This can be done through the menu system by creating a menu item with a link route:<nolink>.

However, because these urls are empty, Drupal currently considers these link to be going to the front page.
This means two things:

  1. The links are generated with "data-drupal-link-system-path=<front>"
  2. The links are generated with class="is-active" when on the homepage.

What is the expected behaviour? Nolinks should not contain either data-drupal-link-system-path or is-active on any page.

Setting up menu link

Incorrect attributes shown

Drupal\system\Tests\Ajax\CommandsTest break in unit and FunctionalJavascriptTests

$
0
0

I am splitting off an issue - to prevent to parent issue from blowing up into a unreviewable mess.

The original plan was to make the minimal changes as part of the parent issue.

but I agree with this comment.

https://www.drupal.org/node/2862510#comment-12053691

So I think these assertions should be converted to both Unit tests and Javascript tests to cover it completely.

Summarising CommandsTest::testAjaxCommands()

There are 14 assertions all of a common form

AddCssCommand - needs only a straight conversion to units test as other functional test cover the more AJAX-ey functionality
Each command should be reviewed on a case by case basis.

Add a new article to Umami demo - Kids eating healthily

$
0
0

An article proposed to be added to the Umami demo articles section. This one's about encouraging children to eat healthily. This content needs review, checking against the standards that we're following for recipes (https://www.drupal.org/project/drupal/issues/2940146) and working in as a patch.

Custom image to follow shortly.

Suggested content so far for the CSV file:
(title,body,author,slug,image,alt,tags):

"Encourage your kids to choose healthy foods",
encourage-your-kids-to-choose-healthy-foods.html,
"Umami",
articles/encourage-your-kids-to-choose-healthy-foods,
image-to-be-supplied.jpg,
"Alt text to be supplied",
"Children,Healthy"

Can't delete the translation of a media

$
0
0

With the 'Media' module enabled and made translatable, when I try to delete the translation of a media there is this error. Note that the translation is in fact removed as it doesn't appear anymore in the translation list.

To reproduce:

  1. Install drupal 8.5.5 in english
  2. Enable these modules:
  3. Core: Media
  4. Multilingual: Content Translation
  5. Add a language ( /admin/config/regional/language ) and add the language switcher to one region ( /admin/structure/block )
  6. Check the 'Media' custom language settings in /admin/config/regional/content-language and make at least one media type translatable (image for instance).
  7. Add an image (/media/add/image) and translate it (/media/1/translations)
  8. Delete the translation (for french translation it would be /fr/media/1/delete), once you click the "Delete * translation" the error appear. "The website encountered an unexpected error. Please try again later."
  9. If you go back to the translation list the translation was in fact removed (/media/1/translations)
Auf der Website ist ein unvorhergesehener Fehler aufgetreten. Bitte versuchen Sie es später nochmal.</br></br><em class="placeholder">InvalidArgumentException</em>: The entity object refers to a removed translation (de) and cannot be manipulated. in <em class="placeholder">Drupal\Core\Entity\ContentEntityBase-&gt;getTranslatedField()</em> (line <em class="placeholder">573</em> of <em class="placeholder">core/lib/Drupal/Core/Entity/ContentEntityBase.php</em>). <pre class="backtrace">Drupal\Core\Entity\ContentEntityBase-&gt;get(&#039;name&#039;) (Line: 92)
Drupal\media\Entity\Media-&gt;getName() (Line: 107)
Drupal\media\Entity\Media-&gt;label() (Line: 99)
Drupal\Core\Entity\ContentEntityDeleteForm-&gt;getDeletionMessage() (Line: 76)
Drupal\Core\Entity\ContentEntityDeleteForm-&gt;submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter-&gt;executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter-&gt;doSubmitForm(Array, Object) (Line: 589)
Drupal\Core\Form\FormBuilder-&gt;processForm(&#039;media_image_delete_form&#039;, Array, Object) (Line: 318)
Drupal\Core\Form\FormBuilder-&gt;buildForm(&#039;media_image_delete_form&#039;, Object) (Line: 74)
Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 38)
Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware-&gt;handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 666)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
Viewing all 291765 articles
Browse latest View live


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