-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Images with spaces in the file name result in broken image on the page #17
Comments
I could reproduce this issue in DXA JAVA 1.2.1 too. |
Hey guys, I've been trying to debug this a little since we've come across it while developing with the DXA release 1.3. (As far as I can tell the issue should also happen in 1.4). I've traced this through to the BinaryFileManager class on line 102 of the DXA solution, from here this calls At this point however urlPath has already been encoded (which is a good thing) but between here and what hits the database, the urlPath seems to get unencoded somehow. What this means is that while what is passed into that method is
Where you'll notice the path has been unencoded back to having a space in. This then of course fails, since the path in the database is encoded and it can't find a path that isn't encoded. So to go back to the initial DXA code, it calls off to the SDLWeb8 DD4T provider, which I believe is the one found here: https://github.com/dd4t/DD4T.Providers.SDLWeb8.CIL The relevant calls come from the GetBinaryByUrl method in the TridionBinaryProvider, which tries to encode the url again. While this is unnecessary, it isn't the cause of the issue, as the url and the encoded url are at this point the same. (Shown here) The issue as far as I can see is that after this the url is passed to the tridion BinaryMetaFactory (Tridion.ContentDelivery.Meta.BinaryMetaFactory) which seems to unencode the string back into containing spaces before it hits the database and results in the query above. Any questions on this please let me know. Thanks, |
Thanks for your analysis; this is very useful input! Indeed, the problem seems to be in SDL Web 8 CIL/CIS rather than in DXA/DD4T code base. It might be possible to work-around with double encoding, but that would be creating a bug to fix another bug. |
Fixed in DXA 1.5 / CIL 8.2 |
Repro steps:
We are using Web8 and DXA 1.3.
The text was updated successfully, but these errors were encountered: