Hi tijsdeboeck and Anybody
the patch that was applied to allow for multiple values doesn't work and I can't apply the patch.
Any Help?
- π©πͺGermany Grevil
@Amgad Hassan this issue's fork branch is 5 commits behind the master branch, so it needs to get re-rolled first before it can be applied. I'll see, if I can manually re-roll it for you.
- π©πͺGermany Grevil
Done! It should apply again now! :)
When I have further time again, I'll do a proper review for this, so we can finally get this feature committed.
I applied a static patch, if anyone needs it for the time being.
- π©πͺGermany Grevil
Furthermore, if anyone needs to migrate their file fields to media fields WITHOUT the need of converting the data to an already existing media field but instead wants to migrate the whole D7 file / image cosmos to media (including creating media entities out of files, converting file / image fields to media fields etc.), I can recommend β , although it is currently still in an alpha state, I had great experience with the module and used it for migrating about 7 customer sites from D7 to D9 now!
I'll add this information to this module's front page. Since finding the right migration tools can be fairly difficult.
- last update
about 1 year ago 2 pass - last update
about 1 year ago 2 pass - πΊπΈUnited States nateb Pittsburgh, Pennsylvania, USA
@Grevil
Wondering if you can provide more context around "5 commits behind" in regards to what was current at the time of your post.
Was the patch meant to be applied to branch from Jan 2023? I've applied patch-22 to the (apparently current) 1.0.x-dev branch from 3 Jan 2023. Patching succeeds, but module fails in use:
[error] TypeError: array_search(): Argument #2 ($haystack) must be of type array, null given in array_search() (line 124 of .../web/modules/contrib/filefield_to_mediafield/src/FileToMedia.php) #0 .../web/modules/contrib/filefield_to_mediafield/src/FileToMedia.php(124): array_search('5306cdc328dbe0c...', NULL)
- π©πͺGermany Grevil
@nateB, thanks for the update! Yea, I guess this patch / MR was written against PHP 7.4 back then, so the error didn't come up.
- last update
about 1 year ago 2 pass - Status changed to Needs work
about 1 year ago 1:25pm 22 September 2023 - π©πͺGermany Grevil
Commented and fixed up a bunch of code, back to needs work!
- π©πͺGermany Anybody Porta Westfalica
@tijsdeboeck interested to finish this eventually?
- last update
10 months ago 2 pass - last update
10 months ago 2 pass - Assigned to Anybody
- Status changed to Needs review
10 months ago 10:13am 30 January 2024 - π©πͺGermany Grevil
Alright, all done! I removed the hash creation from the install hook and moved it into the copy method itself. Reason being, that we can not expect the media field to always be named "field_media_image". If an admin wants to reuse already existing media entities, but uses a different field name for the file, the hashes used for identifying duplicate files, will fail.
It is still not perfect, as there could be other media image fields. The files contained inside these image fields are currently not taken into account, but this can be easily resolved in a follow-up issue. Maybe having a "create duplicateMediaFileHashes" drush command would make sense, which should be executed before the main command. Oh well.Furthermore, the hash creation now supports fields with multiple file entries. Please review!
- last update
10 months ago 2 pass - Assigned to Grevil
- Status changed to Needs work
10 months ago 11:31am 30 January 2024 - π©πͺGermany Anybody Porta Westfalica
Great work @Grevil! Left some comments. Afterwards please test and compare carefully.
- last update
10 months ago 2 pass - Assigned to Anybody
- Status changed to Needs review
10 months ago 2:09pm 30 January 2024 - π©πͺGermany Grevil
Adjusted the code accordingly, nice finds @Anybody! Thanks a lot!
Please review and check last unresolved thread on Gitlab.
- π©πͺGermany Grevil
Just tested everything and it works great! Tested it with and without the new "--no-reuse", great stuff! :)
- last update
10 months ago 1 fail - Issue was unassigned.
- Status changed to RTBC
10 months ago 2:46pm 30 January 2024 - π©πͺGermany Grevil
Alright, let's wait for tests to pass before merging.
- Status changed to Needs work
10 months ago 2:51pm 30 January 2024 - π©πͺGermany Grevil
1 Test fails and having the "copy" method two times is probably quite weird.
- last update
10 months ago 2 pass - Status changed to RTBC
10 months ago 2:58pm 30 January 2024 - π©πͺGermany Grevil
Alright, the tests couldn't resolve the drush dependency. Removed the dependency again. Tests should pass now. Back to RTBC. Merging once tests pass.
-
Grevil β
committed 37870e2f on 1.0.x authored by
tijsdeboeck β
Issue #3284486 by Grevil, tijsdeboeck, smokris, Anybody: Add support for...
-
Grevil β
committed 37870e2f on 1.0.x authored by
tijsdeboeck β
- Status changed to Fixed
10 months ago 3:11pm 30 January 2024 - π§πͺBelgium tijsdeboeck Antwerp π§πͺ πͺπΊ π
My mailbox exploded Gitlab updates today! Thanks for your hard work Grevil & Anybody on getting this merged!
Automatically closed - issue fixed for 2 weeks with no activity.