Closed (fixed)
Project:
PhotoSwipe - Responsive JavaScript Modal Image Gallery
Version:
5.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Mar 2026 at 12:03 UTC
Updated:
15 Jul 2026 at 10:00 UTC
Jump to comment: Most recent
Comments
Comment #2
dave.mentens commentedComment #3
anybody@dave.mentens please use a MR not patches.
LGTM in general but I think there was a better method for this, I have something with context in mind...
Comment #4
anybodyYeah I think maybe
is more appropriate?
Comment #6
dave.mentens commented@anybody Thanks for the feedback. I've updated my change and made a MR.
Comment #7
dave.mentens commentedComment #8
anybodyTests are failing and shouldn't this use dependency injection maybe?
Comment #10
stred commentedComment #11
anybodyI'm biased. Maybe was wrong, because a DTO should be "dumb" and maybe not use DI - but on the other hand it makes sense for texting, because the DTO still needs the dependency within.
The key fix of this issue is in this line:
https://git.drupalcode.org/project/photoswipe/-/merge_requests/142/diffs...
@grevil what do you think? I tend to merge it as-is, because I think there's no real right or wrong here.
Comment #12
grevil commentedNot a big fan of the dependency injection change. Even if we have the helper method "createFromVariables", the constructor is public. Meaning all "new ImageDTO" calls now require a second parameter, which would require a deprecation notice for now "calling ImageDTO, without "entityRepository" is deprecated in x and will be removed in y.
And (if we'd be 100% version conform) we'd need a new major version, where we remove the parameter entirely. And all this for introducing an inconvenience.
Comment #13
anybodyThanks @grevil okay then let's just keep the key change!
Sorry @stred - can you prepare a separate MR with just the required change maybe? So we have both and can compare the changes.
Comment #14
grevil commentedNo need for that, we can simply force push the old commit id.
Comment #15
grevil commentedJust moved the phpstan-ignore-line line. Otherwise LGTM! Merging.
Comment #17
grevil commented