Comments (4)
I could reproduce this issue in DXA JAVA 1.2.1 too.
See RWS/dxa-web-application-java#32
from dxa-web-application-dotnet.
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
DateTime lpb = binaryFactory.FindLastPublishedDate(urlPath);
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 /images/tree%20mid_tcm13-3219.jpg
the actual query that hits the db comes out as
declare @p1 int
set @p1=1
exec sp_prepexec @p1 output,N'@P0 int,@P1 nvarchar(4000)',N'select binaryvari0_.BINARY_ID as BINARY_I1_0_, binaryvari0_.PUBLICATION_ID as PUBLICAT2_0_, binaryvari0_.VARIANT_ID as VARIANT_3_0_, binaryvari0_.TYPE as TYPE4_0_, binaryvari0_.IS_COMPONENT as IS_COMPO5_0_, binaryvari0_.DESCRIPTION as DESCRIPT6_0_, binaryvari0_.PATH as PATH7_0_, binaryvari0_.URL as URL8_0_ from BINARYVARIANTS binaryvari0_ where binaryvari0_.PUBLICATION_ID=@P0
and lower(binaryvari0_.URL)=@P1 ',13,N'/images/tree mid_tcm13-3219.jpg'
select @p1
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,
Jordan
from dxa-web-application-dotnet.
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.
from dxa-web-application-dotnet.
Fixed in DXA 1.5 / CIL 8.2
from dxa-web-application-dotnet.
Related Issues (20)
- Sdl.Web.Common.Models.PageModel.GetXpmMarkup() calls unused XpmMetadata HOT 2
- DXA1.6 web solution (dxa-web-application-dotnet-DXA_1.6_Release.zip) HOT 1
- Language selector URL does not expect null page id HOT 2
- Use precompiled views HOT 1
- Have DXA sources in a symbol server HOT 2
- Only possible to embedded MediaItem entities in Rich Text fragments HOT 2
- Component Link mapping fails after link depth reached in web application. HOT 2
- Model Service (R2) ComponentTemplate missing from DCP(s) HOT 3
- ModelServiceClient ArgumentNullException crash HOT 2
- HtmlHelper null pointer exceptions HOT 3
- Ambiguous DXA exception for PCA DXA model addon
- Keyword Model extensions are not supported without a Metadata Schema
- RichText model extensions are not supported
- Output Cache is caching even if there is an error on the page HOT 1
- can DXA Container Framework be extended to support DXA 2.2 on Tridion 9/9.1
- Images with spaces return 404
- BinaryFileManager - StripDimensions UrlDecode ran only when no dimensions HOT 1
- MimeMapping.GetMimeMapping returns wrong mime types
- reuse HttpClient object / SNAT port exhaustion HOT 1
- Outputcache empty content after redirect HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dxa-web-application-dotnet.