Comments

drikc’s picture

Status: Active » Needs review
StatusFileSize
new20.29 KB
new2.01 KB

This patch lightly alterate the existing code to allow to choose links to existing style paths.

drikc’s picture

pfrenssen’s picture

I'd love to have this feature too. Instead of appending the image styles to the 'Link image to'-select box I would prefer having a new dropdown containing all image styles appear underneath the existing one when the 'File' option is chosen.

thedavidmeister’s picture

Status: Needs review » Needs work

The last submitted patch, 1186872-field_formatter_add_style_link.patch, failed testing.

claudiu.cristea’s picture

+++ b/modules/image/image.field.inc
@@ -473,8 +476,11 @@ function image_field_formatter_settings_summary($field, $instance, $view_mode) {
+  foreach ($image_styles as $style) {
+    $link_types[$style] = t('Linked to !style file', array('!style' => $style));
+  }

What if there's a style called 'content' or 'file'? I think we need to name space the new link types:

$link_types['image_style_' . $style] = ...

Can you reroll agains the new codebase?

pfrenssen’s picture

Issue tags: +Needs reroll

Tagging

internetdevels’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new2.67 KB

Reroll

wim leers’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll, +Needs tests

Patch again doesn't apply anymore. Another reroll needed…


  1. +++ b/core/modules/image/lib/Drupal/image/Plugin/Field/FieldFormatter/ImageFormatter.php
    @@ -75,8 +78,11 @@ public function settingsSummary() {
    +      $link_types[$name] = t('Linked to !style file', array('!style' => $style));
    

    s/file/image/?

  2. +++ b/core/modules/image/lib/Drupal/image/Plugin/Field/FieldFormatter/ImageFormatter.php
    @@ -91,26 +97,36 @@ public function settingsSummary() {
    -
    ...
    +
    

    Please don't change whitespace unless it's necessary.

  3. +++ b/core/modules/image/lib/Drupal/image/Plugin/Field/FieldFormatter/ImageFormatter.php
    @@ -91,26 +97,36 @@ public function settingsSummary() {
    +    elseif ($image_link_setting) {
    

    This might as well say elseif (TRUE)… a comparison is missing? :)

  4. +++ b/core/modules/image/lib/Drupal/image/Plugin/Field/FieldFormatter/ImageFormatter.php
    @@ -41,8 +41,11 @@ public function settingsForm(array $form, array &$form_state) {
    -      'file' => t('File'),
    +      'file' => t('File source'),
    

    Shouldn't this be "Original image"?

  5. +++ b/core/modules/image/lib/Drupal/image/Plugin/Field/FieldFormatter/ImageFormatter.php
    @@ -41,8 +41,11 @@ public function settingsForm(array $form, array &$form_state) {
    +      $link_types[$name] = t('File !style', array('!style' => $style));
    

    This would result in strings like:

    • "File thumbnail"
    • "File medium"

    … neither of those really make sense, do they?

    Wouldn't something like !style image style be better? That'd result in:

    • "Thumbnail image style"
    • "Medium image style"
dermario’s picture

Assigned: Unassigned » dermario

I will try to perform my first reroll.

dermario’s picture

Status: Needs work » Needs review
StatusFileSize
new2.59 KB
new2.01 KB

I rerolled the patch from #8 and applied the changes mentioned in #9. The changes between the rerolled patch and my changes for #9 are visible in interdiff-comment-9-after-reroll.txt. I hope that helps reviewing that patch.

jurgenr’s picture

Status: Needs review » Reviewed & tested by the community

Patch #11 works against an updated code base and all improvements from #9 are included.

wim leers’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -Needs reroll
+++ b/core/modules/image/lib/Drupal/image/Plugin/Field/FieldFormatter/ImageFormatter.php
@@ -97,8 +97,8 @@ public function settingsSummary() {
     $elements = array();
-    $image_link_setting = $this->getSetting('image_link');
 
+    $image_link_setting = $this->getSetting('image_link');
     // Check if the formatter involves a link.

Why make this unnecessary whitespace change?

Plus, test coverage is still missing.

dermario’s picture

Issue tags: +#amsterdam2014

I'll try to reroll the patch first and fix the whitespace issue.

dermario’s picture

The rerolled patch that applies to the current HEAD. Now i try to investigate to write a test.

dermario’s picture

Status: Needs work » Needs review
wim leers’s picture

My whitespace remarks in #13 didn't make any sense. So the reroll looks great, this now just needs tests! Thanks :)

oenie’s picture

Issue tags: -#amsterdam2014 +Amsterdam2014

fixing the amsterdam sprint tag to amsterdam2014

dermario’s picture

Yep, thank you. Still working on the tests.

dermario’s picture

Status: Needs review » Needs work
dermario’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new4.16 KB
new2.26 KB

I added some testcode to verify the correct functionality. Thereby i found a bug my original implementation. image_style_load does not exist any more, so i replaced it with entity_load('image_style', ...); See the attached interdiff.

dasjo’s picture

Assigned: dermario » Unassigned
Issue tags: +SprintWeekend2015
alhambra’s picture

Assigned: Unassigned » alhambra

Reviewing this issue.

alhambra’s picture

Patch #21 needs a re-roll...

alhambra’s picture

Assigned: alhambra » Unassigned
StatusFileSize
new4.07 KB

The rerolled patch applies to current HEAD. Made some updates to pass all tests (ImageFieldDisplayTest).

nitesh sethia’s picture

Status: Needs review » Needs work
StatusFileSize
new4.61 KB

Rerolled the patch as per the latest D8 Release.

nitesh sethia’s picture

Status: Needs work » Needs review
StatusFileSize
new4.61 KB

Changing the status to Needs Review.

Status: Needs review » Needs work

The last submitted patch, 27: add_style_links_to-1186872-27.patch, failed testing.

The last submitted patch, 27: add_style_links_to-1186872-27.patch, failed testing.

claudiu.cristea’s picture

berdir’s picture

Version: 8.0.x-dev » 8.2.x-dev

As a new feature, this has to go in 8.2.x now.

I'm not sure this is important enough to be in core, is this really a common use case? Could also be a contrib module that provides this functionality.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

vikashsoni’s picture

StatusFileSize
new77.21 KB

@claudiu.cristea I have appliyed Patch but not working giving error sharing screenshot ....

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new132 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.