Needs work
Project:
Drupal core
Version:
main
Component:
image.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
13 Aug 2015 at 17:51 UTC
Updated:
24 Nov 2022 at 06:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dave reidSeems limited just to Image fields.
Comment #3
dave reidComment #4
dave reidI should just use $destination_dir as the second argument for file_unmanaged_move(). There's no need to construct the exact destination URL.
Comment #6
tkuldeep17 commented@dave patch is failed due to undefined variable `file`, so I have fixed it. and uploading patch.
Comment #8
tkuldeep17 commentedSorry, I missed to fix file variable at one place. Updating patch again.
Comment #12
yogeshmpawarRerolled the patch #8.
Comment #23
larowlanThose methods are now on the file repository service, so I suspect this needs a reroll
Comment #24
kim.pepperfile_unmanaged_move was deprecated in Drupal 8.7.0. See https://www.drupal.org/node/3006851
Comment #25
kim.pepperComment #26
immaculatexavier commentedComment #27
immaculatexavier commentedAddressed #23,#24. Rerolled against #12. Attached reroll diff for the same.
Comment #28
immaculatexavier commentedMissed to upload patch in #27
Addressed #23,#24. Rerolled against #12. Attached reroll diff for the same.
Comment #29
smustgrave commentedFixed #28
Comment #31
smustgrave commentedComment #33
smustgrave commentedSo I removed this if statement
if ($path = \Drupal::service('file.repository')->move($path, $destination)) {because $path couldn't be passed into move(). Wondering if that was the right approach?
Comment #34
smustgrave commentedComment #35
smustgrave commentedForgot to check commit before generating patch.
Comment #36
smustgrave commentedJust realized this has no tests.
Comment #37
medha kumariComment #38
medha kumariReroll the patch #35 with Drupal 9.5.x
Comment #39
smustgrave commentedStill no test case. Nor an interdiff so a reroll doesn’t help in this case.
Comment #40
smustgrave commentedBrought this up in the bugsmash slack channel it seems more like an enhancement than a bug. Moving to Feature request.
Sorry for the confusion.
Comment #42
larowlanCan we simplify a lot of this by using the file.repository service's writeData method?
\Drupal\Tests\image\Kernel\ImageItemTest::testImageItem has test coverage for this method, so can we expand that to add the missing coverage?
Comment #43
sandeepsingh199 commentedWith the help of #42, I have created the patch for D10.1.x. Please check & review.
Comment #44
akram khanFix CCF #43
Comment #45
smustgrave commentedThank you for the patches but tests were not added.
No interdiff in 43
And you can check the patch will apply using core scrips adjusting credit
Comment #46
nitin shrivastava commentedtry to fix #44 ccf error.