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

Configurable background color when cropping to larger dimensions

$
0
0

Comment #142

Problem/Motivation

When creating an Image Style that applies the image_crop effect with one or both dimensions exceeding the source dimensions, the new area is rendered in black. Site administrators should be able to configure the color of the new area being created. This should be a per-style configuration, NOT a global one. Site administrators may have styles that integrates with light layouts and there, they want white background for cropped image. Other style may be necessary for dark pages and there they may want heavy-gray background color.

Proposed resolution

Adding a background color at effect level for image_crop.

Remaining tasks

N/A

User interface changes

When configuring a Crop (image_crop) effect at admin/config/media/image-styles/manage/{image_style}/add/image_rotate or admin/config/media/image-styles/manage/{image_style}/effects/{image_effect} admins should be able to provide a color, in hex string format, for the additional area created by upscaling crops.

API changes

Note: These API changes assure full backward compatibility.

core/includes/image.inc

image_crop() has 2 additional optional arguments:

  1. $background_color, defaults to NULL.
  2. $background_alfa, defaults to 0.

image_rotate() was unified to the same logic.

Before:

function image_crop($image, $x, $y, $width, $height)
function image_rotate($image, $degrees, $background = NULL)

Now:

function image_crop($image, $x, $y, $width, $background_color = NULL, $background_alpha = 0)
function image_rotate($image, $degrees, $background_color = NULL, $background_alpha = 0)

\Drupal\system\Plugin\ImageToolkitInterface

Applied to \Drupal\system\Plugin\ImageToolkit\GDToolkit implementation too.

Crop & rotate public methods have adapted their argument list in the same way.

New \Drupal\image\ImageEffectBackgroundColorBase abstract

Now CropImageEffect and RotateImageEffect are extending the new ImageEffectBackgroundColorBase:

abstract class ImageEffectBackgroundColorBase extends ImageEffectBase implements ConfigurableImageEffectInterface {
  ...
}

This new base class adds some code reusing for effects with background color.

Original report by FiReaNG3L

ImageAPI.module sounds very interesting; I recently had problems with imagecache / image.inc putting a black background on images when scaling / cropping to a definite size (say 150x150 pixels) when the image is too wide or tall to fit the square.

Is there a way to customize the background to another color (say, white) with image API?

I tried to modify image.inc myself but the best I could achieve is a background change that worked, but bleeded in the image if black was present.

Thanks for all the awesome work on imagecache / imageAPI!


Improvement help text Recipient field

$
0
0

Problem/Motivation

The help text of the Recipient field in the email action form is now missing the user mail token.

Steps to reproduce:
1. enable the actions module
2. create advanced action: send email (admin/config/system/actions/add)
3. check the text below "Recipient" input field

Proposed resolution

improve text:
for example

"The email address to which the message should be sent OR enter [node:author:mail], [comment:author:mail], [user:mail], etc. if you would like to send an email to the author of the original post or to one or more users. "

Remaining tasks

Contributor tasks needed
TaskNovice task?Contributor instructionsComplete?
Update the patch to incorporate feedback from reviews (include an interdiff)Instructions
Embed before and after screenshots in the issue summary NoviceInstructions

User interface changes

before

API changes

No

Data model changes

No

Duplicate AJAX wrapper around a file field

$
0
0

If I edit my profile, and upload a picture to Picture field, after that I see the messages but twice all times. (drupal_render() should check if it's rendering a 'render element' and if so call drupal_render_children() (inline) instead (1920886) ) not about the ajax its just rendering the element.

user edit duplicate messages

I find these message only one place (/core/modules/file/file.module;466) and I think somewhere is called twice. István Palócz see that bug, and he said the problem somewhere in ajax response.

Views: HTML is escaped with aggregation enabled

$
0
0

Problem/Motivation

I have a view with aggregation enabled. When I rewrite the output of a field and add HTML markup, it is escaped (i.e. the markup is shown). If I turn aggregation off, the field is rendered as expected.

This only happens if the Aggregation Type is NOT set to group results together.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Can't install migrate module

$
0
0

On a fresh D 8.2.0 - system installs other modules, but doesn't react, when I try to install migrate module.

Exposed filters are not inherited in attachment display

$
0
0

For a view with a page display and an attachment display, exposed filters are not inherited in attachment display even if 'Inherit exposed filters' option is set to yes.

Contextual filter issues while passing multiple taxonomy selections from node, to pages, to views

$
0
0

I am having trouble with the proper configuration of passing multiple taxonomy term selections through a page (which calls a view) and uses contextual filters to display only nodes that have, in this case, categories which match the ones i've multiple selected in the node.

I have a node with a taxonomy multiple select box (category). I select two categories.
I have a page that is used for that node's specific content type. It calls a view.

Presently that view is configured such that the view's contextual filter, as it is presented in pages, is:
CONTENT: HAS TAXONOMY TERM ID
and I select 'category'.

In views i have set up a contextual filter with these specs:
Content: Has taxonomy term ID
Specify validation criteria - Validator: taxonomy term
filter value type: term name converted to term id (I could use others, a few seem to work - my gut tells me I need the ..Terms ID separated by, or +)
and then undre more i've selected "allow multiple values"

I think the issue is in passing the arguments from the page to the view, so I thought I would try creating custom arguments - but this is completley lost on me.

its worth noting that there is ONE other contextual filter I pass before this - but it's working just fine because I dont need multiple values.

Any support would be greatly appreciated,
Thanks

Please explain why core css always loaded before theme css by group

$
0
0

I work currently on a own theme and run into the small issue that always the core css files loaded before my css ist loaded. After some debugging i found there is a group additionaly to the css weight that are the reason for the sorting.

Why it is needed?
How i can force a css file to be always on top position?

Is it really needed? In D8 there is the SMACCS concept for grouping... the weight.... and additionaly a unuseful grouping...

regards
Dennis


Remove obsolete definition of BLOCK_LABEL_VISIBLE in tests

$
0
0

The constant has been converted to BlockInterface::BLOCK_LABEL_VISIBLE, no need to define it in the test.

Bad site name encoding in email header

$
0
0

As soon as your Drupal site name is composed of non ASCII characters, the "From" header is causing trouble.
Gmail for instance, will systematically take it as spam.

Mail received

Incorrect permission check in views node access filter

$
0
0

Original report from @Berdir, copied from the private security tracker and made public as this issue requires "administer node" permissions:

This module has a access bypass (?) vulnerability.

I noticed that \Drupal\node\Plugin\views\filter\Access checks the administer nodes permission to bypass node access, but since 7.x, there is actually a dedicated permission for that (bypass node access).

That could be a possible security issue if you have users with administer nodes that are however not allowed to see all content and you use that filter in combination with having the default node access/alter disabled (I guess that filter only makes sense in that scenario).

Discussed with @dawehner a bit, and Views 7.x has basically the same code.

That said, we're not even sure this class works at all in 8.x (it probably does in 7.x), there were no tests that we could see.

Opening this so I don't forget about this. We need to check if the plugin actually works.

Note that administer nodes is a restrict access permission, so you could argue that this is not a security issue, but there is a reason bypass node access was separated into another permission.

Views Combined fields filter with "Contains any word" or "Contains all words" operator results in an incorrect SQL query and a fatal error

$
0
0

In a view, I created a combined fields filter, which was supposed to be exposed to the users, allowing a "universal search" by keywords matching multiple fields of some content type.

An attempt to use the exposed filter results in an error:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.field_editor_valuenode__field_journal.field_journal_target_idnode__field_note.f' at line 10: SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {node_field_data} node_field_data LEFT JOIN {node__field_field_author} node__field_field_author ON node_field_data.nid = node__field_field_author.entity_id AND (node__field_field_author.deleted = :views_join_condition_0 AND node__field_field_author.langcode = node_field_data.langcode) LEFT JOIN {node__field_editor} node__field_editor ON node_field_data.nid = node__field_editor.entity_id AND (node__field_editor.deleted = :views_join_condition_2 AND node__field_editor.langcode = node_field_data.langcode) LEFT JOIN {node__field_journal} node__field_journal ON node_field_data.nid = node__field_journal.entity_id AND (node__field_journal.deleted = :views_join_condition_4 AND node__field_journal.langcode = node_field_data.langcode) LEFT JOIN {node__field_note} node__field_note ON node_field_data.nid = node__field_note.entity_id AND (node__field_note.deleted = :views_join_condition_6 AND node__field_note.langcode = node_field_data.langcode) LEFT JOIN {node__field_organization} node__field_organization ON node_field_data.nid = node__field_organization.entity_id AND (node__field_organization.deleted = :views_join_condition_8 AND node__field_organization.langcode = node_field_data.langcode) LEFT JOIN {node__field_publisher} node__field_publisher ON node_field_data.nid = node__field_publisher.entity_id AND (node__field_publisher.deleted = :views_join_condition_10 AND node__field_publisher.langcode = node_field_data.langcode) LEFT JOIN {node__field_school} node__field_school ON node_field_data.nid = node__field_school.entity_id AND (node__field_school.deleted = :views_join_condition_12 AND node__field_school.langcode = node_field_data.langcode) LEFT JOIN {node__field_titlehtml} node__field_titlehtml ON node_field_data.nid = node__field_titlehtml.entity_id AND (node__field_titlehtml.deleted = :views_join_condition_14 AND node__field_titlehtml.langcode = node_field_data.langcode) LEFT JOIN {node__field_abstract} node__field_abstract ON node_field_data.nid = node__field_abstract.entity_id AND (node__field_abstract.deleted = :views_join_condition_16 AND node__field_abstract.langcode = node_field_data.langcode) WHERE (( (node_field_data.status = :db_condition_placeholder_0) AND (node_field_data.type IN (:db_condition_placeholder_1)) AND( (CONCAT_WSnode_field_data.titlenode__field_field_author.field_field_author_valuenode__field_editor.field_editor_valuenode__field_journal.field_journal_target_idnode__field_note.field_note_valuenode__field_organization.field_organization_valuenode__field_publisher.field_publisher_valuenode__field_school.field_school_valuenode__field_titlehtml.field_titlehtml_valuenode__field_abstract.field_abstract_value LIKE :db_condition_placeholder_2 ESCAPE '\\') )))) subquery; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => publication [:db_condition_placeholder_2] => %sdfs% [:views_join_condition_0] => 0 [:views_join_condition_2] => 0 [:views_join_condition_4] => 0 [:views_join_condition_6] => 0 [:views_join_condition_8] => 0 [:views_join_condition_10] => 0 [:views_join_condition_12] => 0 [:views_join_condition_14] => 0 [:views_join_condition_16] => 0 )

If I add only one field to the filter, the error looks a bit different:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'CONCAT_WSnode_field_data.title' in 'where clause': SELECT COUNT(*) AS expression FROM (SELECT 1 AS expression FROM {node_field_data} node_field_data WHERE (( (node_field_data.status = :db_condition_placeholder_0) AND (node_field_data.type IN (:db_condition_placeholder_1)) AND( (CONCAT_WSnode_field_data.title LIKE :db_condition_placeholder_2 ESCAPE '\\') )))) subquery; Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => publication [:db_condition_placeholder_2] => %sdf% )

But it seems that in both cases there are some spaces missing when constructing the query.

I experience this on a new website currently under construction. Started with Drupal 8.0.2, then upgraded to 8.0.3.

This happens when using the "Contains any word" operator, not when using "Contains"

What is the positioning of the Views section

Typo in EntityResource::delete()

$
0
0
// Delete responses have an empty body.
return new ModifiedResourceResponse(NULL, 204);

Language class should use property 'label' to be consistent with entities

$
0
0

Problem/Motivation

Although Language is not an entity, it almost shares a structure with ConfigurableLanguage and that uses label (just as other entities do).

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Issue categoryTask because there is no error due to this. Is for consistant DX.
Issue priorityNormal because is only effecting Language. (Not major; is not "important by community consensus")
Unfrozen changesNot unfrozen because is not only changing css, tests, markup, etc.
Prioritized changesMight qualify for prioritized change under "reduces fragility", but probably not.
DisruptionNot disruptive for core/contributed and custom modules/themes if it retains public method names for BC, but marks them deprecated.

Postponed for 8.1.x because it does not meet the qualification on https://www.drupal.org/core/beta-changes ?

Proposed resolution

  • In core/lib/Drupal/Core/Language/Language.php change name to label to be consistent.
  • Update all uses.
  • Keep old function names as a BC wrapper.
  • Need a follow up issue postponed until 8.1.x. to remove the deprecated methods.

Remaining tasks

User interface changes

No

API changes

No

Related issues


Support revision tracking of entity references in core

$
0
0

A key problem with core's field-based data structures is that referenced entities are tracked by their primary ID, not by revision. This makes it difficult to build out complex data structures using Entity Reference and referenced entities, and have the parent content managed using the new Content Moderation feature, because once one of the referenced entities is changed the changes will be publicly visible.

Proposals (pick one):

  1. Extend the core Entity Reference module to (optionally) support revisions.
  2. Merge the existing Entity Reference Revisions module into core.

Convert Ban's Migrate source tests to new base class

Exposed filters do not appear on attachment display

$
0
0

Steps to reproduce :
1- Create a view
2- Add a page display or a block display
3- Add an attachment to one of the display
4- Add exposed filters to the attachment
5- Set 'Use AJAX ' in other to 'yes' .
Exposed filters does not show up for attachment display.
Try same settings with either page or block display with AJAX enabled. Exposed filter will show up there.

If the default language is not set, the migration log show an error

$
0
0

Problem/Motivation

Follow-up to #2657978: Variable to config: language_default [D6 & D7]. If we have a multilingual site and have not changed the default language, the lanuage_default variable is not set. When we migrate the site, there's an error in the migration log :

Source ID language_default: Input should be an array.

Proposed resolution

Use 'en' as a default value with the default_value process plugin.

Remaining tasks

Write a patch. Add test. Review.

User interface changes

There won't be an error in the migration log.

API changes

None.

Data model changes

None.

Convert User's Migrate source tests to new base class

Viewing all 297360 articles
Browse latest View live


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