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

In Menu/viewsMenuLink::updateLink() do not rebuild everything on save

$
0
0

Problem/Motivation

@todo from #2301317: MenuLinkNG part4: Conversion
in Menu/ViewsMenuLink::updateLink()

      if ($changed) {
        // @todo Improve this to not trigger a full rebuild of everything, if we
        //   just changed some properties.
        $view->storage->save();

Proposed resolution

?

Remaining tasks

Clarify what "rebuild of everything". Is that all views? The whole site?

User interface changes

No.

API changes

No?


D6->D8 CCK Single On/Off Checkbox, Checkboxes/Radio buttons, and Select formatters

$
0
0

Problem/Motivation

All D6 Integer, Float, Decimal or Text fields are converted to Number(Integer) or Text fields in D8. These new fields don't support check boxes, radio buttons, or select lists.

Proposed resolution

When migrating Integer, Float, Decimal or Text fields we need to check the widget and use that as part of the map when figuring out which widget to use.

D8field        = D6field:D6widget

list_text      = text:optionwidgets_select
list_text      = text:optionwidgets_buttons
boolean        = text:optionwidgets_onoff
text           = text:text_textfield
long_text      = text:text_textarea

integer        = number_integer:number
list_integer   = number_integer:optionwidgets_select
list_integer   = number_integer:optionwidgets_buttons
boolean        = number_integer:optionwidgets_onoff

decimal        = number_decimal:number
list_float     = number_decimal:optionwidgets_select
list_float     = number_decimal:optionwidgets_buttons
boolean        = number_decimal:optionwidgets_onoff

float          = number_float:number
list_float     = number_float:optionwidgets_select
list_float     = number_float:optionwidgets_buttons
boolean        = number_float:optionwidgets_onoff

Remaining tasks

User interface changes

API changes

Convert theme_more_link() to more-link.html.twig

$
0
0

Problem/Motivation

We removed theme_link() #1985470: Remove theme_link() as part of a push to stop dedicating theme functions to tiny, single tag chunks of markup because it's overkill and would only get worse if we were to create a Twig template.

For links in particular, there have been many theme functions that are almost identical sort of piling up #1595614: [meta] Remove all the theme functions and templates in core that simply output a link. Replace with #type 'link' render arrays.

theme_more_link() is one of these functions that should not be converted to a Twig template.

Proposed resolution

Create #type 'more_link' that works much as #type 'link', but with a few extra default attributes set. Do not try to recreate the markup of theme_more_link() 1:1 because there is a DIV that has been deemed superfluous in the theme function that might as well be removed here (see comments #52+)

Remaining tasks

Commit patch.

User interface changes

Loss of wrapper divs around "more" links.

API changes

Use #type 'more_link' instead of #theme 'more_link' in renderable arrays.

Original report by @thedavidmeister

Here is the current code for theme_more_link():

<?php
function theme_more_link($variables) {
  return
'<div class="more-link">'. l(t('More'), $variables['url'], array('attributes'=> array('title'=> $variables['title']))) . '</div>';
}
?>

In order to reproduce this with #type = link, we need to make a render array with the following structure:

<?php
$more_link
= array(
 
'#type'=> 'link',
 
'#href'=> 'admin/content',
 
'#title'=> t('More'),
 
'#attributes'=> array(
   
'#title'=> t('Show more content'),
  ),
 
'#theme_wrappers'=> array('container'),
 
'#wrapper_container_attributes'=> array(
   
'class'=> array('more-link'),
  ),
);
?>

Part of #1595614: [meta] Remove all the theme functions and templates in core that simply output a link. Replace with #type 'link' render arrays

Related:
#1939098: Convert theme_more_link() to Twig

MenuLinkNG part5: Remove dead code; and party!

$
0
0

Suggested commit message

Issue #2301319 by pwolanin, dawehner, Wim Leers, effulgentsia: MenuLinkNG part5: Remove dead code; and party!

Problem/Motivation

After #2301317: MenuLinkNG part4: Conversion goes in there will be some dead code left in core - this patch just removes it.

Proposed resolution

Remaining tasks

User interface changes

API changes

Original report by @effulgentsia

Final chunk after #2301317: MenuLinkNG part4: Conversion. This removes the old menu_link module and dead procedural functions from menu.inc.

Fix for tablesort-indicator.html.twig image urls

$
0
0

Follow-up to #2152261: Clean up for tablesort-indicator.html.twig

Problem/Motivation

Fix the urls created for the image assets.

url() will produce /fr-ca/ or /drupal/ prefixed urls, I should have used file_create_url() for this but that doesn't exist in twig yet.

I've got a proposal started for that over at #2168231: Theme Path functions/variables needed in Twig.
In the mean time I'd like to revert part of this so that it's working.
And the best solution for this template would be #2189729: Factor out tablesort-indicator.html.twig() IMO.

Proposed resolution

Make the core template use the same pattern of building the asset file url in preprocess and pass it to the template.

Remaining tasks

User interface changes

API changes

Remove uses of drupal_add_http_header and related functions

$
0
0

Follow-up from #1984766: Change notice: Start relying on Request/Response objects for cache handling.

HTTP headers are now handed by the Symfony Request/Response objects. The legacy http header functions probably aren't doing anything. All uses of these functions need to be updated to use the objects. The functions themselves should be removed in a followup patch.

The affected functions include:
_drupal_set_preferred_header_name
drupal_add_http_header
drupal_get_http_header
drupal_page_header
drupal_send_headers

Lazy-load GD resource in GDToolkit

$
0
0

follow-up of #2211227: Refactor image and imagetoolkit: isExisting, isSupported, supportedTypes, getMimeType

Problem/Motivation

While working on #2211227: Refactor image and imagetoolkit: isExisting, isSupported, supportedTypes, getMimeType, we realized that in the GD toolkit we are currently *always* loading fully an image into a GD resource. This is unnecessary overhead, as the actual GD resource is needed only if an image needs to be manipulated by applying operations to it. In most cases, $imageFactory->get() will only be needed to determine mimetype, height and width to deliver an image to the client, which can be achieved by only calling getimagesize(), and avoiding the current calls to image_type_to_extension(), imagecreatefromxxx(), and even overlaying if an image is not truecolor.

Proposed resolution

Split the logic:

  • ImageToolkitInterface::parseFile() only run getimagesize(), and store its results in a 'preload' property that will be used by getMimeType, getHeight, getWidth if the GD resource has not been created yet
  • fully load the image in the GD resource only when an operation has to be applied on it, and getMimeType, getHeight, getWidth will then return their values dynamically from the resource

Remaining tasks

  • review patch

User interface changes

Nope

API changes

One method added to ImageInterface and Image: setValid()

Move common code of Sequence/Mapping elements one level up to ArrayElement, add a specific interface

$
0
0
  1. The class doxygen is useless. Is it a list of items? Can the keys be strings? What are some examples? When should I use something else for an array
  2. getItemDefinition contains a fatal error. No, seriously, look at it: buildDataDefinition is called with two arguments, it requires three. What does this say about test coverage? Do we need this method if it's not called anywhere, code or test?
  3. All the method doxygen are the old style implements instead of inheritdoc.
  4. onChange is looking for parent which is not a defined property nor is it clear how would it be set.

Themes cannot be uninstalled

$
0
0

Problem/Motivation

Followup to #1067408: Themes do not have an installation status.

Themes now undergo install and uninstall operations and maintain and installation status.

Like modules, themes must now clean up their installed configuration when they are uninstalled. We run into a few issues here.

  1. Theme settings are not rigorously declared. They require representative schemas.
  2. Modules can declare theme settings. These need to be tracked and removed when the theme is uninstalled.

We have a similar issue of a third-party module injecting settings into a configuration entity in #2224761: Add support for cross-field-type, extensible, extra configuration.

Proposed resolution

  1. Declare configuration dependencies for themes.
  2. Remove associated configuration entities when a theme is uninstalled.

User interface changes

None.

API changes

Yes, TBD.

Postponed until

#1067408: Themes do not have an installation status
#2218655: Core expects $theme.settings default config file to exist

Original report by @jessebeach

Allow configuration system to recursively search directories

$
0
0

It would be cool if we had the option to provide sub directories in the /config directory for instance. Then we could structure and organise files a bit more. E.g. default views could live in /config/default_views and still be found ok.

I was thinking we could try and utilize the PHP SPL iterators and use the RecursiveDirectoryIterator, then add a Filter Iterator that filters the actual files by prefix etc...

This is kind of what I was thinking, just an initial patch. Alternatively, the other iterators could live inside the ConfigDirectoryFilterIterator too.

Please feedback. Could be crazy, I would like something like this though.

Preserve taxonomy_forums field when uninstalling forum module

$
0
0

Original report by @andypost

Problem/Motivation

Currently forum module trying to delete taxonomy_forums field in forum_uninstall() but this field could be used in other entities. Also forum node type is not deleted when forum uninstalled so it makes sense preserve all its fields as well

Proposed resolution

Remove field deletion from forum_uninstall()
Also this removes need in calling field_purge_batch() so uninstall will be quicker.
This does not affects re-install of the forum module because forum_enable() cares to re-create all needed entities and fields

API changes

no

#2077435: Use a yml file to create the forum vocabulary

Convert user roles to entity_reference_field

Author name in comment preview not rendering apostrophe properly: a bug or by-design?

$
0
0

This happens on a Drupal 7.26 using the default theme when previewing a comment. The &#039 part is equivalent to an apostrophe. What I don't know if this is something that is part of Drupal to prevent exploits or if this is a bug that should be fixed. I tried searching the Drupal.org forums if this is a bug, I wasn't able to find anything relevant.

I can't figure out how include the screenshot here, so here's a link to the screenshot: http://imgur.com/JjpRfB2.

Bartik theme: Don't change capitalization of translatable strings with CSS

$
0
0

Problem/Motivation

Our translators cannot control ucfirst (capitalization).

Background: #421118: [Meta] Standardize capitalization on actions and #1496418: Views: Don't change capitalization of translatable strings with CSS

Proposed resolution

Remove the css that changes case.

Remaining tasks

  • (done!) 8.x committed in #10
  • Add before and after pictures of 7.x in several representive pages (See contributor task doc for information on how to add screenshots of an patch: http://drupal.org/node/1859584)

User interface changes

Changing case displayed (not source of t() ).

API changes

No API changes.

misleading API documentation on including code

$
0
0

In https://www.drupal.org/coding-standards#includes it says

When including code from the same directory or a sub-directory, start the file path with ".":
include_once ./includes/mymodule_formatting.inc
In Drupal 7.x and later versions, use DRUPAL_ROOT:
require_once DRUPAL_ROOT . '/' . variable_get('cache_inc', 'includes/cache.inc');

That Drupal 7.x example will only work for code referencing the core includes/ directory. Since most people using the API documentation are not working on core, I'd imagine, it's misleading. Using DRUPAL_ROOT in one's own module requires the construction of the path from the Drupal root to the module. The equivalent of
include_once './includes/mymodule_formatting.inc';
is
include_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'mymodule') . '/includes/mymodule_formatting.inc';

I think you could also just do
require_once dirname(__FILE__) . '/includes/mymodule_formatting.inc';
which is not necessarily the same absolute path but is still valid for all the issues that motivated DRUPAL_ROOT to begin with, as far as I can figure out - see #259623: Broken autoloader: convert includes/requires to use absolute paths

The pre-7.x example line in the API doc is also missing quotes and a semicolon - no great benefit to making it pseudocode versus working code, I'd think.


forum_node_view attempt an unnecessary vocabulary_load() under certain circonstances

$
0
0

When enabled, at each node view the forum module will attempt a vocabulary_load() even when not necessary.

This can be avoided by moving 2 lines of code inside a if. Easy win. If we don't, we'll have the taxonomy term load operation attempted on every page that renders at least one node, even when no forum nodes at all are being manipulated.

Missing context filters for Status, Sticky, and Promoted

$
0
0

Views currently doesn't have Context Filter support for the publishing options for nodes. Specifically the Status, Promote and Sticky fields.

I get that these are bit fields that really don't *need* context filters for the purposes of URL handling, but it would be nice to have them for things like generating summary lists that show count totals in a facet like way.

Attached is a patch that adds context filter support for these fields. Additionally I've included an exported view (in the .txt file) that demonstrates the usage of these context filters (once the patch is applied).

Lemme know if I need to make any changes to it!

Link to images styles from image field display settings

$
0
0

Problem/Motivation

When people understand that image styles control the size of their images, but want to change the defaults or create a new style, they return to the field display settings, and don't think to look under configuration. We experienced this problem in the Google Usability Study: (participant 8a)

Proposed resolution

Add a link near image styles drop-down in field display settings to the image style configuration area.

Document (expose) how to enable translation for Menu Things (Menus/Configuration translation, (Plugin) menu links/User interface translation, Custom menu links/Content translation)

$
0
0

Problem/Motivation

Noticed while reviewing #2301317: MenuLinkNG part4: Conversion

People who want to translate "Menus" are not going to realize they need to translate 3 different ways and enable 3 different translation modules.

Documenting now to translate Custom menu links on the menu_link_content module help page... is not a pattern we use. (We do not document how to translate nodes (articles) on the node help page. We do it on the Content translation help page... but by then, someone has already figured out to install (enable) the module, they can see the help.

Proposed resolution

Document (expose) how to enable translation for Menu Things (Menus/Configuration translation, (Plugin) menu links/User interface translation, Custom menu links/Content translation)

by:
making a general translate menu docs page on d.o

  • change the UI so that all menu things have a translate drop down operation (would mean have the plug-in menu links have a translate operation that would link to the User interface translation page?)
  • ?

Remaining tasks

  • Think more about the problem and possible solutions.
  • Move to the proper component once a solution is decided.
  • Put the text from the various related module hook_helps here so we can see what we are talking about
  • ?

User interface changes

?

API changes

No?

Properties/Fields like author and date for Custom menu links translations

$
0
0

Problem/Motivation

Noticed as part of manual testing of #2301317: MenuLinkNG part4: Conversion
Custom menu link edit/add does not expose author or date. But the translation add/edit does.

Proposed resolution

?

Remaining tasks

User interface changes

API changes

Viewing all 296414 articles
Browse latest View live


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