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

Messages are not rendered last, meaning those messages set within placeholders only appear on the next request

$
0
0

@catch at #2702001-12: Inject config factory for BigPipe (including in exception handlers):

Can we open a follow-up, or link to the existing issue if there is one, to something which would allow the message to be printed in the same request? For example could we show error messages in the footer as a final fallback?

@Wim Leers' reply at #13:

You mean a follow-up to #2678568: Ensure good UX & DX even when A) rendering of placeholder fails, B) some response event subscriber fails, not to this, right? This is solely code clean-up. What you describe sounds feasible, but I'm not sure if it's desirable. It'd mean appending HTML to the HTML just before the closing </body> tag. And that HTML may simply end up not being visible depending on the theme. I think it's good enough as it is.

And @catch's reply to that at #14:

Well I still think the config setting for error display leaking into bigpipe is a bit smelly, I'm not aware of anywhere else we have to deal with that.


Problems with a number of views grouped filters

$
0
0

Problem/Motivation

When using a grouped filter in a View that is not 'string' based, saving the view gives an "Error" page with message "InvalidArgumentException: The configuration property display.default.display_options.filters.created.group_info.group_items.1.value.type doesn't exist. in Drupal\Core\Config\Schema\Mapping->get() (line 66 of core/lib/Drupal/Core/Config/Schema/Mapping.php)".

This is all due to the fact that the grouped filter value schema is always a string.

This applies for example to Date, Datetime, numeric and Boolean grouped fields.

Proposed resolution

Update the handling of the grouped filter type in the code to allow for configuration to set other value types then strings. Then update the views filter Schema to set non-string grouped filter values where needed.

Steps to reproduce

Create a content view with a filter "Content: Authored On". Expose the filter and select "Grouped filters". Create a group with value type "A date..." and another group with "An offset..." selected, click "Apply".

Go back to edit the filter. Both groups now have value type "A date..." selected.

Saving the view gives an "Error" page with message "InvalidArgumentException: The configuration property display.default.display_options.filters.created.group_info.group_items.1.value.type doesn't exist. in Drupal\Core\Config\Schema\Mapping->get() (line 66 of core/lib/Drupal/Core/Config/Schema/Mapping.php)".

response.gzip is redundant and should be removed

$
0
0

Problem/Motivation

There's a config:

system.performance response.gzip

...which is defined in core/modules/system/config/schema/system.schema.yml and is mapped to the D6/7 variable page_compression e.g. in core/modules/system/migration_templates/d6_system_performance.yml

However, after the changes to page cache in #2368987: Move internal page caching to a module to avoid relying on config get on runtime it seems that response.gzip doesn't actually do anything any more.

In fact, it looks like consensus was reached in #28 of that issue that this should be removed:

catch and [Wim Leers] agreed that the best way forward was to simply remove the "Compress cached pages"/response.gzip

It seems that the changes committed didn't remove response.gzip though.

Proposed resolution

Remove response.gzip and remaining references to it e.g.

core/modules/page_cache/src/Tests/PageCacheTest.php:228:    $config->set('response.gzip', 1);
core/modules/system/migration_templates/d6_system_performance.yml:17:  'response/gzip': page_compression
core/modules/page_cache/src/StackMiddleware/PageCache.php:184:   * If page_compression is enabled, a gzipped version of the page is stored in

core/modules/system/config/schema/system.schema.yml:189:        gzip:
core/modules/system/config/schema/system.schema.yml-190-          type: boolean
core/modules/system/config/schema/system.schema.yml-191-          label: 'Compress cached pages'

Remaining tasks

Review patch to remove response.gzip and remaining references to it.

User interface changes

None - the "Compress cached pages" option is already gone from the UI.

API changes

None.

Data model changes

None.

Visiting index.php should redirect to install.php if settings.php already has database credentials but database is empty.

$
0
0

Problem/Motivation

If the user visits the site index for a Drupal site that has database credentials in settings.php but has not yet been installed completely, the user will receive a fatal error that does not in any way indicate that the user should visit install.php to complete the installation.

Proposed resolution

Detect an empty database during bootstrap, and redirect to install.php if installation is not already in progress.

Patch in #728702-17: Visiting index.php should redirect to install.php if settings.php already has database credentials but database is empty. is confirmed to resolve this issue for both D7 and D8.

Remaining tasks

None.

User interface changes

User will be redirected to install.php if there is a database configuration but the database is empty.

API changes

None.

Original report by @arpeggio

The setup are:
-database empty
-drupal updated from CVS
-set the C:\xampp\htdocs\sites\sites.php with $sites['localhost'] = 'kapitbisig.com';
-manually populated the the database credentials in C:\xampp\htdocs\sites\kapitbisig.com\settings.php

I got the following error message when I browsed http://localhost

Fatal error: Call to undefined function _system_rebuild_theme_data() in C:\xampp\htdocs\includes\theme.inc on line 586

Deprecate RIGHT JOINs, because SQLite doesn't support them.

$
0
0

Even the latest versions of SQLite do not support RIGHT JOIN (changelog), so the query needs to be folded to a LEFT JOIN.
Otherwise we had to remove RIGHT JOIN support from our generic DB driver.
Currently doesn't seem to be used anywhere, otherwise we would have hit this already. IMHO, still a major bug needing backport.

Try to remove the "map HEAD to GET" logic in \Drupal\rest\RequestHandler::handle()

$
0
0

Problem/Motivation

  1. @dawehner is convinced that we should be able to solve #2752325: Automatically provide HEAD support when a REST resource supports GET purely in the routing system, without changing \Drupal\rest\RequestHandler::handle.
  2. @Wim Leers is convinced that this is impossible. See #2752325-70: Automatically provide HEAD support when a REST resource supports GET for his full explanation.
  3. @dawehner posted a patch at #2752325-75: Automatically provide HEAD support when a REST resource supports GET that contains his proposed solution.

How to continue?

Well, @Wim Leers explained at #2752325-79: Automatically provide HEAD support when a REST resource supports GET why #75 cannot work, and predicted it would fail with a particular PHP error. Exactly that error occurred in the test run.

@dawehner is still not convinced, but in the interest of fixing an important bug, he'd rather see Wim's patch go in (which passes tests) than his own (which does not yet pass tests).

Proposed resolution

Figure out how to make #2752325-75: Automatically provide HEAD support when a REST resource supports GET pass tests.

Remaining tasks

TBD

User interface changes

None.

API changes

None.

Data model changes

None.

Allow plurals on bundle labels

$
0
0

Discussed with @catch on IRC to close #23298: Entity bundles should declare a plural form of their label in favour of this.

Problem/Motivation

Entity types can define now plurals for their labels starting with #1850080: Entity type labels lack plurality, cannot generate UI text based on label if plural is needed. It's possible now to have the variants "content item" (singular) and "content items" (plural) for nodes. We want the same for bundles. We want to be able to have "article" (singular) and "articles" (plural).

It's not the same as for entity types. Entity types can define the label plural variants in the annotation while for bundles the site builder should be able to add such variants. Thus we need to store the variants in the bundle config entity and provide UI for site builders.

Proposed resolution

  1. Make \Drupal\Core\Config\Entity\ConfigEntityBundleBase implement a new interface ConfigEntityBundleInterface.
  2. Add next methods to the new ConfigEntityBundleInterface interface: getSingularLabel(), getPluralLabel() and getCountLabel(). These are similar to those implemented to entity types.
  3. Create a 'bundle_config_entity' schema that contains the new storage keys: label_singular, label_plural, label_count.
  4. Implement the UI and storage for NodeType entity type.

Remaining tasks

Open issues for each bundle type that requires label plurals.

User interface changes

User is able to add plural variants in NodeTypeForm UI.

The site is installed in English (2 variants)

The site is installed in Romanian (3 variants)

API changes

New interface \Drupal\Core\Config\Entity\ConfigEntityBundleInterface:

  • getSingularLabel()
  • getPluralLabel()
  • getCountLabel()

Data model changes

The bundle config entity has new keys/values: label_singular, label_plural, label_count.

Expose TextItems' "processed" property when normalizing

$
0
0

Problem/Motivation

Text Formats are running on REST json requests. This makes Drupal less useful for a REST backend and can lead to duplication of effort when attempting to use Drupal to feed data to another source.

Proposed resolution

Make Drupal use text input formats for long text fields.


Allow profiles to provide a base/parent profile and load them in the correct order

$
0
0

Updated: Comment #96

Problem/Motivation

With Drupal 7's vastly-improved install profile functionality, and the recently-improved drupal.org distribution packaging infrastructure, many new install profiles have been created, and they are awesome.

However, install profiles are not inheritable, so if you want to, say, take Drupal Commons, and base your site off of it, but add one or two extra modules in your own customized install profile, you have to clone the entire install profile and change it to your needs. Allowing install profiles to declare base profiles (just like themes can declare base themes) would allow more code reuse, and make install profiles even more useful.

Proposed resolution

Modify the module load system to take into account base install profiles.

Remaining tasks

  • Create plan

User interface changes

None.

API changes

Install profiles can define base profiles using the syntax base: BASE_PROFILE inside their .info.yml files.

Invoke field methods first on the current entity translation

$
0
0

Problem/Motivation

Currently when invoking field methods we iterate over the entity translations and call the desired method on each field for each entity translation. However there is no specific order in which we'll iterate over the translations, which might be a problem for contrib and custom if you have a complex field, which updates it's value in the presave method and depends on the entity translation which has been currently edited.

For example if you save a referenced entity in the field presave method with a new revision but before doing so check if the referenced entity is already saved in a new revision. The referenced entity will be changed only for the currently edited entity translation, which means we have to ensure that the field presave method is called first for the current entity translation.

Proposed resolution

Change the order of the entity translation languages over which we iterate in ContentEntityStorageBase::invokeFieldMethod, so that the current entity translation will be processed as the very first one.

Remaining tasks

Review

User interface changes

none

API changes

none

Data model changes

none

Clicking elements with children in Javascript tests throws a GastonJS exception

$
0
0

Problem/Motivation

There's an current bug with GastonJS that makes clicking elements with children impossible: https://github.com/jcalderonzumba/gastonjs/issues/19

As we continue to write Javascript tests, we're going to run into this more and more, so instead of waiting for the GastonJS fix we should implement a temporary fix in JavascriptTestBase which protects test-writers from running into this problem. When testing Quick Edit, for example, we will run into this bug when trying to click the "Save" button, as it has nested HTML. I had to implement a similar fix to the one proposed here when writing tests for #2421427: Improve the UX of Quick Editing images.

I've attached a test-only patch which outlines this issue, and a patch with a fix.

Proposed resolution

Catch the GastonJS error and use Javascript to click the target element.

Remaining tasks

Review.

User interface changes

None.

API changes

None.

Data model changes

None.

Subselects don't work in DBTNG conditions, except when used as value for IN

$
0
0

Problem

Started as an issue to allow query like SELECT ... FROM ... WHERE ... AND (SELECT COUNT(*) ...) = value), it turns out that the new algorithm is very generic and allows for many more situations that are allowed by (standard) SQL:

  • Select query at left hand side:
      SELECT ...
      FROM ...
      WHERE (SELECT COUNT(*) FROM ... WHERE ...) > value
  • Select query at right hand side:
      SELECT ...
      FROM ...
      WHERE value < (SELECT AVG(...) FROM ...)
  • Multiple select queries at right hand side:
      SELECT ...
      FROM ...
      WHERE value BETWEEN (SELECT MIN(...) FROM ...) AND (SELECT MAX(...) FROM ...)
  • Select query at left and right hand side (new test):
      SELECT t.name
      FROM test t
      WHERE (SELECT AVG(tt.priority) FROM test_task tt WHERE tt.pid = t.id) > (SELECT AVG(tt2.priority) FROM test_task tt2)
  • Select query at left hand side and multiple select queries at right hand side:
      SELECT ...
      FROM ...
      WHERE (SELECT AVG(...) FROM ... WHERE ...) BETWEEN (SELECT MIN(...) FROM ...) AND (SELECT MAX(...) FROM ...)

Original post

[Note: issue #369314: Subselects don't work in DB conditions... handled only the IN case]

I was trying to construct a query with a subselect that looks like:

SELECT ...
FROM ...
WHERE ...
  AND (SELECT COUNT(*) ...) = value)

However, I did not entirely manage to get it to work.

Attempt 1:

$query->condition($count_subquery, $value, '=');

Fails because $count_subquery is a SelectQueryInterface which is a QueryConditionInterface. And if the $field argument is a QueryConditionInterface it gets compiled and placed in the main query as is, thereby ignoring the $value and $operator arguments.

Attempt 2:

$query->condition($value, $count_subquery, '=');

Fails because no brackets are placed around the subquery.

This leads to a workaround:

$query->condition($value, $count_subquery, 'IN');

This happens to work because the IN operator places brackets around the value(s). However, it will not always be possible to use IN. There are times you may want to use a comparison operator other than '=', e.g. <, <=, >, >=. Also, at times, it may be necessary to compare 2 subselects (select objects whose average score is higher than the overall average score).

So, the error can be split into 2 situations:
1) SelectQueryInterface objects as the left hand side ($field operator) are not handled correctly.
2) SelectQueryInterface objects as the right hand side ($value operator) are only handled correctly when the operator happens to be 'IN'.

Proposed resolution

To solve 1)
Method DatabaseCondition::compile(): Add an additional check to this if:

          if ($condition['field'] instanceof QueryConditionInterface) {

Something like:

          if ($condition['field'] instanceof QueryConditionInterface && !($condition['field'] instanceof SelectQueryInterface && isset($condition['value']))) {

Subsequently the else branch needs to handle this situation, by adding:
- Compile on the $condition['field'] if it is a SelectQueryInterface.
- Brackets around that result of compile.

To solve 2)
- This will need some refactoring of the above mentioned else branch.

Remaining tasks

Can some experts regarding this part of Drupal confirm this is indeed an error and is a use case that is to be supported. Is the proposed solution in the correct direction. If so, I will try to write a patch including tests.

some blocks in system are in system, some in translated-system label when install in another language

$
0
0

Problem/Motivation

Some blocks in the block layout library are grouped under the label "System", some under the translation of "System"

Steps to reproduce

  1. Install in another language than english
  2. Login as admin
  3. Go to the block layout page admin/structure/block

Alternative:

  1. Login as admin
  2. Enable multilanguage modules
  3. Add another language
  4. Interface-translate "System"
  5. Go to the block layout page admin/structure/block

Multiple instances of "System" are not translated while some are. See the screenshots below, where "System" was translated to "TEST" in German.

Noticed in #2019511: Explain why the language switcher would not show under some configurations

Proposed resolution

Remaining tasks

User interface changes

Before


After


All system blocks are now in translatable categories.

API changes

No.

Derivatives should not be created on read-only stream wrappers

$
0
0

Problem/Motivation

If the source image is passed as a stream wrapper, ImageStyle::buildUri() creates the destination on the same stream wrapper. This is fine for public:// and private:// and even for any writable custom stream wrapper. But when it comes to build a derivative from a read-only stream wrapper, Drupal cannot write there because it's simply... READONLY. The attached test proves this bug.

This is somehow related to #987846: Switching file storage to anything other than public/private breaks image styles but is not the same in the sense that D8 allows creation of derivatives from sources passed as stream wrappers but will fail to create the files on read-only wrappers.

Proposed resolution

When the source image is passed as a read-only stream wrapper, set the derivative scheme to \Drupal::config('system.file')->get('default_scheme'). Potentially back-port to D7.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Remove REST's resource- and verb-specific permissions for EntityResource, but provide BC and document why it's necessary for other resources

$
0
0

Problem/Motivation

Facts for Drupal 8.0 & Drupal 8.1's REST:

  1. REST module's EntityResource respects Entity Access & Field Access.
  2. REST module requires every entity type to be explicitly enabled in rest.settings.yml.

Therefore it is very confusing that every entity type gets another permission, per verb, to be able to actually use that REST resource.

Proposed resolution

@klausi at #1816354-1: Add a REST module, starting with DELETE:

Access control is also a problem right now, we don't have that in the routing system yet (see #1793520: Add access control mechanism for new router system for work on that). And we don't have something like entity_access() or access controllers in core (see #1696660: Add an entity access API for single entity access for that). I think I will just expose my own permissions right now ("read resourceXY over REST API", "create resourceXY over REST API" etc.) and check for that.

That is the issue that brought REST to core. It was not at all discussed further. No follow-up was created. In other words: very little scrutiny was applied to the REST module before it could be committed to Drupal 8. I'm certain such a patch would not have been able to land in the past few years (say, since 2014) — it looks like we were far more lax in 2012.

It's totally possible that access handling in general and permission handling in particular were discussed elsewhere, but if so, I could not find it (I looked at all these issues).

The only other issue that was remotely related is #1866908: Honor entity and field access control in REST Services. In there, two commits happened:
the first marked \Drupal\rest\Plugin\rest\resource\EntityResource::permissions()'s permissions as "restricted" (this method no longer exists), as a stopgap. The second commit removed that, and instead added proper entity access checking. But … it did in fact NOT remove the permissions for entities! It just kept them!

In other words, the only reason permissions still exist, at least for EntityResource, is simply that this was overlooked. No follow-up issue was created, and thus it was simply forgotten. It makes sense to allow @RestResource to opt in to having a permission, for example in the case of DbLogResource. But it does not make sense to always have this, without even the ability to opt out!

We (which includes dawehner, Crell, I, and others) also discussed this at DrupalCon New Orleans and unanimously agreed that:

  1. it does not make sense for Drupal 8 to continue to have permissions enabled by default for EntityResource
  2. we should not break BC
  3. we should therefore make sure that newly installed Drupal 8.2 sites don't need to enable these permissions for EntityResource, but existing Drupal 8 sites will continue to use that

This issue/patch therefore proposes:

  1. we keep permissions enabled by default for @RestResource plugins: this guarantees BC for all custom/contrib REST resources
  2. we remove permissions from EntityResource in Drupal 8.2.x by default, but keep them enabled for existing Drupal installations
  3. we document A) why we have permissions, B) how you can opt out from permissions for a particular REST resource

Remaining tasks

None.

User interface changes

None.

API changes

  • The EntityResource@RestResource opts out from generating the permissions that ResourceBase generates by default, but only for new sites.
  • Other @RestResources continue to generate permissions. This means all contrib/custom ones continue to work as they do today.
  • For details, see the change record: https://www.drupal.org/node/2733435.

Data model changes

New key in rest.settings configuration: bc_entity_resource_permissions. Upgrade path provided: rest_update_8203().


Responsive Image not working in rewritten Views field/area due to XSS filtering

$
0
0

Hi folks

What have I do?
i created a content view with fields and add a normal image field from a normal content type. I set the image formatter to Responsive Image and select a Responsive Image style. After saving, the views shows the image in original size use not the Responsive Image style. But if I go to the Manage display option in the content type area and i select also the Responsive Image in the format settings, the Responsive Image displayed correctly in the default node view. So there the Responsive Image is working properly.

also interesting: if I set the image field in the same views to hidden, and insert a global text field where i put in the image field with {{ field_image }}, the views only shows me the fallback image from the Responsive Image style.

Add migrate support for Drupal 6 node & user reference

$
0
0

Problem/Motivation

We want to add support for Nodereference which was provided in Drupal 6 by the CCK module.

Proposed resolution

Add support for the field type in core.

Remaining tasks

Write the patch, tests, docs.

User interface changes

n/a

API changes

Additional field type support.

Make error level verbose for minimal

Linux commands for uploading a file

Move parts of _drupal_error_handler_real partially to Error

$
0
0

Problem/Motivation

\Drupal\Core\Utility\Error::decodeException decodes an exception, like producing a backtrace etc.
For PHP errors we don't have such a helper method, but rather do similar kind of stuff inside _drupal_error_handler_real()

Proposed resolution

Add a Error::decodeError() methods which does, maybe mostly, of _drupal_error_handler_real()

Remaining tasks

User interface changes

API changes

Data model changes

Viewing all 293057 articles
Browse latest View live


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