Problem/Motivation
In #2123251: Improve DX of responsive images; convert theme functions to new #type element, we missed removing link_path from the following:
/**
* Implements hook_theme().
*/
function responsive_image_theme() {
return array(
'responsive_image' => array(
'variables' => array(
<strong> 'link_path' => NULL,</strong>
'uri' => NULL,
'attributes' => array(),
'responsive_image_style_id' => array(),
),
),
);
}
We were trying to get this to more closely mimic the similar array for an image and missed removing this. link_path is not used in preprocess or the template so is safe to remove. A rendered responsive_image can be passed into a link on the code level, which is a better approach than link_path.
Proposed resolution
Remove link_path from responsive_image in responsive_image_theme.
Remaining tasks
Commit patch.
User interface changes
None.
API changes
Removes link_path, but link_path doesn't do anything right now and has existed only since #2123251: Improve DX of responsive images; convert theme functions to new #type element was committed.
Beta phase evaluation
| Issue category | Bug |
|---|---|
| Issue priority | Major because it is an inconsistency between image and responsive_image. |
| Prioritized changes | The main goal of this issue is improving developer experience. This is also further cleanup after the larger cleanup in a recent critical change, #2260061: Responsive image module does not support sizes/picture polyfill 2.2, and a major change, #2123251: Improve DX of responsive images; convert theme functions to new #type element. |
| Disruption |
Unlikely to be disruptive to beta sites if this is fixed quickly. Any effects on core systems are addressed in this patch, and there are no known contributed modules this would affect. As of April 20, 2015, there are roughly 250 public beta sites. Responsive images module is not enabled by default, so a smaller number of those sites could be using responsive images. Even a smaller number of those site use custom code (meaning not using the field formatter) to output responsive images. Extraordinarily unlikely that those sites have been updated to use #link_path after #2123251: Improve DX of responsive images; convert theme functions to new #type element was committed The benefits of this change outweigh the disruption, as it decreases fragility by reducing the difference between image and responsive_image. |
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 2478667-1-link-path-removal.patch | 544 bytes | rainbowarray |
Comments
Comment #1
rainbowarrayHere's the patch. I've updated the change notice at https://www.drupal.org/node/2475903 to reflect this change.
Comment #2
rainbowarrayComment #3
attiks commentedThanks for the catch and fix
Comment #4
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed b838fd5 and pushed to 8.0.x. Thanks!