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

/filter/tips page is listed by search engines

$
0
0

Drupal generates a page at /filter/tips, and that page is indexed by search engines, offering it up to the public as a destination on your website.

Currently, robots.txt is configured only to block sub-pages of /filter/tips/, but in order to block the tips page itself from indexing engines, the trailing slash must be removed. Patch #28, posted by Tor Arne Thune, addresses this issue by removing the trailing slash.

Consideration should be given to re-scoping and/or rolling this issue in with similar issues related to robots.txt.


Add a core/CODE_OF_CONDUCT.txt to conform to Github recommendations

$
0
0

Problem/Motivation

Github recently added new community tools which lints projects for their own open-source community recommendations, one of which is to "add a CODE_OF_CONDUCT file in your repository".

Proposed resolution

Add a core/CODE_OF_CONDUCT.txt to Drupal's repository, with the contents of Drupal's code of conduct.

I suggest putting it in whichever folder holds MAINTAINERS.txt (i.e.: another piece of documentation you'd probably want to read if you wanted to interact with the Drupal community). In Drupal 8, MAINTAINERS.txt is in the core sub-directory; in Drupal 7 MAINTAINERS.txt is in the root folder.

I suggest we make it a .txt (as opposed to a markdown document / .md) to be consistent with other documentation in that directory.

I suggest we use the text from https://www.drupal.org/dcoc (as opposed to the DrupalCon Code of Conduct) because someone contributing would have to do so through drupal.org anyway (i.e.: not necessarily DrupalCon).

Remaining tasks

  1. Write a patch
  2. Review and feedback
  3. RTBC and feedback
  4. Commit
  5. Discuss how to backport to 7.x

User interface changes

None.

API changes

None.

Data model changes

None.

WSOD after successful upgrade

$
0
0

This is a strange issue. And you might be wondering why I am posting as a bug, let me explain.

I have a local test system with four installs of Drupal, three are 8.5.
The three were clean installs of 8.45.

First is a test install that I just did a clean install of 8.4.5. Installed fine and works.

Second is mirror of actual web site, I did an update from 8.45 to 8.5. upgrade went well and works.

Third is pending site, I did the update from 8.45 to 8.5 and upgrade went well and was working.
Next day started work and I get WSOD. apache log only shows 500.
Did normal troubleshooting,
rename modules folder, still same 500 error.
Rename theme folder, still same 500 error.
Rename files folder, still same 500 error.
Renamed them all back to normal.

Renamed settings.php file and drupal 8.50 ready to install.
settings.php is normal, no issues I can see.

any idea how to fix without erasing database? (it's going to mess db up if I do install with existing tables right?)

local
php 5.6.30
mysql 5.7.19

all sites have bootstrap and adminimal themes

Private files with subdirectories broken on multilingual sites

$
0
0

Hello,

the controller for /system/files/{scheme} seems not to be called when a private file is located beyond the root of private directory (ie privates//). For instance it is ok for "system/files/pdf.pdf" but not for "system/files/2017-04/pdf.pdf" (404)

Can't translate a content into a language different than that of the administration pages language setting

$
0
0

I've found a problem translating contents into another language in a particular scenario. Those are the steps to reproduce the problem (tested on simplytest.me):

1.- New Drupal 8.2.5 installation in Spanish with the standard profile.
2.- Enable Content Translation module.
3.- Set a content type to be translatable, for example, the page content type.
4.- Add the English language.
5.- Go to language detection and selection settings (admin/config/regional/language/detection) and enable "Account administration pages", "URL" and "Browser" detection methods, with that exact order.

6.- Go to admin account settings (user/1/edit) and set "Administration pages language" to Spanish.

With that configuration, if you create a new page node in Spanish, then, when you go to translation page for that node and adds an English translation, a locale combo appears in translation edit, in which the only possible value is Spanish. If you save the translation it seems that it creates a redundant translation into Spanish. If you navigate to /en/node/1 it appears in Spanish. Neither you can't edit the English translation.

As a temporary solution, I've solved the problem configuring the "URL" detection method above "Account administration pages" detection method, but the administration pages language setting, obviously, has no effect.

insert() and other public methods with an $options param should refer to where to find details on this

$
0
0

API page: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Database%...

The $options param just says:

> array $options: (optional) An array of options on the query.

This is not very useful, and requires a developer to go digging in the source to figure this out.

The query() method explains more:

https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Database%...

The various methods such as insert(), update(), delete() need to do the same.

Though note that the link to the other method isn't properly being made:

> See the documentation for self::defaultOptions() for details

Move JTB::assertJsCondition() to JSWebAssert, deprecate old

$
0
0

Problem/Motivation

assertJsCondition() should follow the path of assertElementVisible() and assertElementNotVisible().

That is, it should be deprecated and moved to JSWebAssert, so it's not nearly as confusing as to why it's there and not on JSWebAssert alongside other assertions with messages.

Proposed resolution

Move, deprecate.

Remaining tasks

User interface changes

API changes

Data model changes

Make Trait for field discovery in migrate entity derivers

$
0
0

Problem/Motivation

In contrib (and even in core itself), there is a lot of boilerplate repeated when a migrate deriver wants to add fields to an source migrate deriver. Let's make the code for discovering and adding fields generic and make a re-usable trait.

Paragraphs and Commerce would use this. Node, user and taxonomy term in core could also.

Proposed resolution

Take a look at node source deriver, make a trait and then implement it for node, user and taxonomy.

Remaining tasks

  1. Code it
  2. Run existing tests
  3. Commit it

User interface changes

API changes

Data model changes


Restore Menu Link parent references when deleting nested links

$
0
0

Problem

When you delete a menu link (directly or through deleting a node with menu link and fireing the hook menu_link_content_entity_predelete), if the menu link had any children, their reference to the parent gets orphaned in the MenuLinkContent entity, but is remapped to the grandparent in the menu_tree table by the MenuTreeStorage.
Depending on the data displayed you will see the orphaned children menu links moved up 1 level, or pointing to the root menu. In the database the menu_link_content_data.parent column contains a reference to a non-existing entity. This can cause errors and problems.

Steps to reproduce

  1. clean install D8.6 dev
  2. create 3 nested menu links in a menu, e.g. in Main Navigation
  3. delete the 'middle' menu link
  4. look at /admin/structure/menu/manage/main: this should show link 3 as child of link 1
  5. edit link 3: this should show the parent link as the menu root, not link 1

Proposed resolution

Take the logic of remapping parent references to the grandparent as used in \Drupal\Core\Menu\MenuTreeStorage::delete and apply this to \Drupal\menu_link_content\Entity\MenuLinkContent::preDelete too.

Remaining tasks

  • Create a patch
  • Add automated tests

User interface changes

None.

API changes

None.

Data model changes

After deleting MenuLinkContent entities any children will have their parent refs remapped to their grantparent in both data tables: menu_tree and menu_link_content_data.

Allow off-canvas dialog to be rendered elsewhere on the page

$
0
0

Problem/Motivation

The settings tray currently uses the dialog system and is always rendered on the right side of the page. Some modules may have a need for the tray to appear at the top, bottom, or left of the page.

Proposed resolution

Add a class or other attribute to a link which tells settings tray to render in a different location than the default right side of the page.

Remaining tasks

User interface changes

API changes

Data model changes

Field rendering should respect configurable field display

$
0
0

Problem

As discussed in #2353867: Title does not appear as a field in Manage Display, sitebuilders cannot configure the display of node's title even though they often want to.

Worse, even if developers use a hook to modify the node's title field adding ->setDisplayConfigurable('view', TRUE), and a sitebuilder then enables the title field in a view mode, it makes no difference. The template_preprocess_node and the node.html.twig take over the rendering of the node's title, ignoring the configured view displays.

The same problem applies to node 'created', node 'uid', taxonomy term 'name' and aggregator feed 'title' fields.

This issue has been split from #2353867: Title does not appear as a field in Manage Display to contain minimal, back-compatible changes to core in order to allow setDisplayConfigurable to be usable in contrib. The changes here are also a necessary prerequisite to solving the original issue in core.

A related problem is that the node title field template is used both when the node title is used for the page title in the page title block, and when the field is made configurable and displayed as part of an entity display.

Solution

1) Modify the logic of template_preprocess_* and templates so that they only usurp rendering if the field's display is not configurable.

2) Add an '#inline_field' variable to field templates so that the can distinguish whether they are called in a context where they should return block markup or inline markup. Use this for node title, uid and created fields.

3) Add an 'inline-field.html.twig' helper template to help themers developing field templates, and remove the duplicate core templates for node title, uid and created.

Results

If a developer makes these fields configurable, then a sitebuilder can configure them and the configuration will take effect.

The exception is when the entity is viewed on it's "own page" (in particular at its canonical route as the main display or potentially other cases such as the preview page). In that situation, there are a variety of problems related to EntityViewController's buildTitle method which are covered in #2941208: Title formatting broken due to flawed EntityViewController->buildTitle.

In general these changes are fully back-compatible provided that a developer has not previously used setDisplayConfigurable to enable configurable display of the relevant fields. This is discussed further in the change record.

Setting 403 or 404 handler to a page that redirects leads to endless loop

$
0
0

Problem/Motivation

Go to admin/config/system/site-information information in D7 or D8.

Set the 403 or 404 page to be "search" in D7, or "/search" in D8 (or any other page that results in a redirect -- search redirects to search/node).

Then go to example.com/foobar to test it out.

Desired result: you get redirected to a search.

Actual result: In D7, you get an infinite loop, with many warnings in the system log. In D8, you just get back to the home page with no message.

Proposed resolution

Fix it so that pages with redirects will work as the 403/404 page, or else add documentation to the page saying they will not work.

Remaining tasks

Test and patch.

User interface changes

403/404 pages will work with redirects.

API changes

None.

Data model changes

None.

Enhance config schema for richer default experiences

$
0
0

Problem/Motivation

In order to autogenerate config forms, expose simple config to REST, improve the config translation system etc. enhancing the config schema system would be really helpful.

Proposed resolution

Additional features:

  • Permissions for simple config
  • Custom UI widgets for specific elements of the config schema
  • Field level access/ simple config level access checking?
  • Default values
  • Many more ...

Remaining tasks

User interface changes

API changes

Data model changes

The Views integration Datetime Range fields should extend the views integration for regular Datetime fields

$
0
0

Follow-up to #2161337: Add a Date Range field type with support for end date

Problem/Motivation

datetime_field_views_data() performs some nice improvements for the Views integration for datetime fields, but has not yet been updated to cover daterange fields, so daterange fields only receive the integration provided by the views_field_default_views_data() fallback. This means that for example, the year-only, month-only, etc. formats aren't available as arguments for daterange fields like they are for datetime fields.

Proposed resolution

The proposed resolution is to allow datetime views plugin to be used for datetime_range fields too. Together with this we have to make sure: extending/reusing the current datetime implementation becomes an easy task for developers, any existing views making use of datetime_range fields is correctly updated, default views shipped with contrib modules using old plugins are automatically migrated on save, etc.
In order to achieve that the solution should include the following tasks:

  • Extending the datetime fields Views integration in order to allow any datetime-based fields to make use of it. #4
  • Letting daterange fields use the same Views integration capabilities that datetime fields have, using the work from previous point. #4
  • Providing an upgrade path for views having old datetime_range fields string/standard views plugins to new plugins types. #24 ~ #139
  • Updating contrib modules provided views having old datetime_range fields string/standard to new plugins types. #133 ~ #142

Remaining tasks

  • map current 'string' view plugin values/operators to new 'datetime' plugin on the update path using regular_expression operator
  • take care of contrib views too. Move all the existing update logic to hook_view_presave and just do $view->save() in the update hook when appropriate as described in #133
  • update path test for #127 and #129 changes
  • Convert Webtestbase based testing to Browsertestbase
  • Deciding if we need a stronger message alerting the user to manually review the views being converted (and/or may be a Change record?). Change Record added.
  • Update the issue summary:
    • User interface changes: the IS should mention this issue is neither adding nor removing UI elements, instead we are moving from string/standard views plugins UI to datetime ones. A screenshot with "before - after" should help.
    • API changes: "Extending the datetime fields Views integration in order to allow any datetime-based fields to make use of it" solution task introduce a new API helper for datetime-based fields who want to integrate datetime views plugins easily.
    • Data model: we are not changing any data model. However existing and contrib modules shipped views may be altered. Developers and site builders should be aware of that.

  • UI/API/Data Model changes above need a place in the CR - together with a good clean up - as flagged by #192.7
  • Upgrade test path is still using old simpletest. We should move it to use Drupal\FunctionalTests\Update\UpdatePathTestBase

User interface changes

This issue doesn't introduce new UI elements, but it converts Views filter and sort plugins from string/standard formats to datetime based ones. The change is automatic, site-builders and developers don't need to do any action.
See the example below of how the UI will change for a Views filter plugin against a datetime_range field:
Before:
before
After:
before

API changes

datetime_type_field_views_data_helper - new API helper to integrate datetime views plugins easily for any datetime-based fields. Modules defying datetime-based fields can now benefit of datetime Views plugins easily.

Example usage in core/modules/datetime_range/datetime_range.views.inc:

/**
 * Implements hook_field_views_data().
 */
function datetime_range_field_views_data(FieldStorageConfigInterface $field_storage) {
  \Drupal::moduleHandler()->loadInclude('datetime', 'inc', 'datetime.views');

  // Get datetime field data for value and end_value.
  $data = datetime_type_field_views_data_helper($field_storage, [], 'value');
  $data = datetime_type_field_views_data_helper($field_storage, $data, 'end_value');

  return $data;
}

Data model changes

There are no Data model changes. However existing and contrib modules' shipped Views - using datetime_range fields/plugins - may be altered. See update message about the ids of changed views like (view id is datetime_test):
update info

The update will map existing datetime_range views string plugins operators/values according with this list:

  • = maps to =, value is unchanged
  • != maps to !=, value is unchanged
  • not maps to !=, value is unchanged
  • starts maps to regular_expression, value is prefixed with '^'
  • ends maps to regular_expression, value is suffixed with '$'
  • any other operator (contains, word, allwords, not_starts, not_ends, shorterthan, longerthan, regular_expression) maps to regular_expression, value is unchanged if not empty otherwise *. is used

Example, filter Starts with with 'value' will be converted into Regualr expression with '^value';

Change link for language code identifier when creating custom languages


autocomplete widget doesn't warn about field cardinality, loses data silently

$
0
0

To reproduce:

- create a reference field, say on article nodes
- set its widget to autocomplete
- create a new article node
- enter one node title in the widget and let it autocomplete
- enter a comma and start typing another node title
- the widget lets you do this: it should not.
- save the node
- the node saves: it should not. The form should fail validation
- edit the node: only the last entered node title is shown
- check the DB: only the last entered node was saved in the field value

Add skip-process option to file_copy and download process plugins

$
0
0

The file_copy process plugin being added in #2695297: Refactor EntityFile and use process plugins instead throws MigrateException when a copy fails, aborting the entire row being processed. This makes sense for the core usages in d6_file and d7_file, where it makes no sense to create the file entity if the file itself does not exist in Drupal. However, in contrib we'd like to use this plugin in other contexts - in particular, to copy a file and create a file entity within a file/image field mapping in a node migration (#2635622: Process plugin for importing/creating files by URL). In this case, we don't want to throw out the node for the sake of a missing file, we just want to leave the field empty.

To support this, let's add a skip_process_on_failure option - when set to TRUE, we'll throw MigrateSkipProcessException instead of MigrateException.

Admin toolbar should always be rendered in the admin language (if set)

$
0
0

Problem/Motivation

If the site has an admin language preference option set in negotiation, users can set their admin language preference. However, even if that is set, only admin pages are affected. The admin toolbar is not. The admin toolbar displayed on non-admin pages will use the language of that page, not the admin language.

Proposed resolution

Negotiate an admin language for the toolbar and use that to render the menu.

Remaining tasks

Do it.

User interface changes

The admin toolbar will be in an admin-appropriate language.

API changes

Likely none.

Split SettingsTrayBlockFormTest into multiple class to only enable modules when needed

$
0
0

Problem/Motivation

In #2938309: Only install Quick Edit when necessary for Settings Tray tests it was determined that installing Quick Edit for tests that don't actually need it caused tests to fail randomly.

That issue moved 'quickedit' from \Drupal\Tests\settings_tray\FunctionalJavascript\SettingsTrayBlockFormTest::$modules to the methods that actually used it.

This issue is split apart this test class so that other modules aren't installed when needed

Proposed resolution

Move some methods in SettingsTrayBlockFormTest into 2 new classes
QuickEditIntegrationTest and OverriddenConfigurationTest

Remaining tasks

Create the patch & review

User interface changes

None

API changes

None

Data model changes

None

Module install form has two "install" buttons that do different things

$
0
0

Problem/Motivation

The module install form (admin/modules) has two buttons that do different things:

  • Install new module downloads a module from outside the site and makes it available for installing via the Install button
  • Install installs the modules that were selected on the form

At the top is:

In HEAD, the bottom link is:
before_134.png
But the consensus is to change it to:
Screenshot_122.png
This has confused at least a few people on this issue.

Proposed resolution

Rename the first button "Add new module".

Remaining tasks

Contributor tasks needed
TaskNovice task?Contributor instructionsComplete?
Embed before and after screenshots in the issue summary NoviceInstructions
Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standardsInstructions

User interface changes

Yes, button rewording.

Additionally, whatever wording change is made would need to be carried through to /admin/modules/install and /core/authorize.php. core/authorize.php considers the downloading to be "install" and the activation to be "enable," which is the opposite with the proposed solution for /admin/modules.

/admin/reports/updates also has this button as +Install new module or theme and would need to be updated to agree with the rewording, and /admin/reports/updates/install uses Install wording.

Further, if the reference to installing is no longer part of the first button, then /admin/modules/install may no longer be the appropriate URL, since it doesn't accomplish what the UI will be saying Install does.

For consistency, whatever change is made to these buttons and pages would also be made to /admin/appearance and /admin/theme/install.

API changes

Data model changes

Viewing all 296477 articles
Browse latest View live