#2128055: Files should be uploaded to per year/month directories by default changed the default file upload location to include YYYY-MM in the file upload location. However ImageItem::generateSampleValue() was not updated to use the new system resulting in un-replaced tokens in the directory path. This causes, for example, devel_generate to throw an exception when generating content that includes images.

Comments

mikeker created an issue. See original summary.

mikeker’s picture

Status: Active » Needs review
Issue tags: +Windows
StatusFileSize
new942 bytes

Looks like this only throws exceptions on Windows -- the colon character in reserved on Windows, allowed in *nix, and the token used is [date:custom:Y]-[date:custom:m].

Regardless it will still generate incorrect paths on *nix.

anavarre’s picture

Issue tags: +Novice, +Quickfix

Tried to generate content with devel_generate. Confirmed the faulty path to images:

/sites/default/files/[date:custom:Y]-[date:custom:m]/generateImage_PtGdNs.jpeg

Applied the patch cleanly, tried again to generate some content. Directory structure is now correct:

/sites/default/files/2015-10/generateImage_rgKfnq.png
effulgentsia’s picture

Issue tags: +rc target triage

This is fixing a bug that got introduced during RC, so I think is appropriate to fix during RC as well. Tagging for triage to get input from another committer.

effulgentsia’s picture

Issue tags: -rc target triage +rc target

@xjm agrees, so tagging.

zaurav’s picture

Tested in a Linux environment. Initially, when generating content (drush genc 50) watchdog logs show an error https://www.drupal.org/files/issues/Screen%20Shot%202015-11-04%20at%2012...

Image is still uploaded.
But after applying patch, error is resolved.

Tried to replicate on Windows VM got the following error (without applying patch). https://www.drupal.org/files/issues/Screen%20Shot%202015-11-04%20at%205....
Application of path was not successfull (using Acquia Dev Desktop Drupal 8.0.0-beta15)

duaelfr’s picture

Status: Needs review » Reviewed & tested by the community

I did a round of manual testing and I can confirm that this patch fixes the issue.

  • effulgentsia committed 4d4f76b on 8.0.x
    Issue #2604602 by mikeker: ImageItem::generateSampleValue() throws "Call...
effulgentsia’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! Pushed to 8.0.x. @zaurav: your Windows screenshot looks like a different error to me, but might be a nice find. If you can consistently reproduce it, please open a new issue for it.

effulgentsia’s picture

using Acquia Dev Desktop Drupal 8.0.0-beta15

Actually, that might be the problem, since beta15 is quite old now. Are you able to reproduce it with either the branch tip of 8.0.x, or with RC3 + the #2 patch applied?

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.