When configuring an image field to show a default image and no image is provided, the path of image wrongly contains 2 slashes after default images directory (usually default_images). See next image tag:

<img property="schema:image" typeof="foaf:Image" src="http://localhost:8888/sites/default/files/default_images//def.png" alt="">
CommentFileSizeAuthor
#1 double-slash-2107673-1.patch1.39 KBclaudiu.cristea

Comments

claudiu.cristea’s picture

Assigned: Unassigned » claudiu.cristea
Status: Active » Needs review
StatusFileSize
new1.39 KB

This should fix the problem.

Status: Needs review » Needs work

The last submitted patch, 1: double-slash-2107673-1.patch, failed testing.

jhedstrom’s picture

Issue summary: View changes
Issue tags: +needs-reroll
claudiu.cristea’s picture

You'll need to check if this still occur or it has been fixed along with other patches.

nikita.izotov’s picture

Issue tags: -

Tested few times with different fields and seems like this bug is already fixed
If you have same problem then please provide steps how to reproduce this issue.

pierremarcel’s picture

Status: Needs work » Reviewed & tested by the community

I also tested a few times and also can't reproduce it. I guess it perhaps have been fixed since the issue was opened October 8, 2013.

webchick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +SprintWeekend2015
$ grep -r '#upload_location' .
[snip]
./core/modules/image/src/Plugin/Field/FieldType/ImageItem.php:      '#upload_location' => $settings['uri_scheme'] . '://default_images/',

Looks like that one still exists. Can someone test default images and see if they suffer from the dreaded double-slash bug?

webchick’s picture

Issue tags: +Needs manual testing
fotuzlab’s picture

Status: Needs work » Reviewed & tested by the community

Tried following steps:

1. Added a default image in article content type.
2. Created a new article with default image.

RESULT: Path of thumbnail besides upload button and image in display on node view page have correct urls. No double slash.

3. Edited last created content and replaced default image with a new image from local.

RESULT: Path of thumbnail besides upload button and image in display on node view page have correct urls. No double slash.

4. Created new content and added an image from local machine.

RESULT: Path of thumbnail besides upload button and image in display on node view page have correct urls. No double slash.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs reroll

double-slash-2107673-1.patch no longer applies.

error: core/modules/image/lib/Drupal/image/Plugin/field/field_type/ImageItem.php: No such file or directory

pierremarcel’s picture

I did a bit more digging into this, and in Drupal7 we have the same code. I re-tested in Drupal8 uploading default image > replacing it with a new one > making sure image-style was off under manage display, and so far no issues with double-slashes at all.

jyotisankar’s picture

Issue tags: -SprintWeekend2015, -Needs manual testing, -Needs reroll +Needs Review

Checked the same file both in drupal7 and drupal8. There is no such file called "core/modules/image/lib/Drupal/image/Plugin/field/field_type/ImageItem.php". Also did a manual testing, not able to reproduce the same. Hope the issue is fixed.

webchick’s picture

Status: Needs work » Closed (cannot reproduce)
Issue tags: -Needs Review +SprintWeekend2015

Ok, closing this out. Thanks so much for the testing!