Hi, guys.
Protocol relative URLs bugs on exp:file:entries. The first “/” disappears.
I’m using Pixel&Tonic; Matrix for galleries and, on exp:channel:entries, works fine.
Is this really a bug?
Thanks, guys!
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
August 28, 2012 9:23pm
Subscribe [2]#1 / Aug 28, 2012 9:23pm
Hi, guys.
Protocol relative URLs bugs on exp:file:entries. The first “/” disappears.
I’m using Pixel&Tonic; Matrix for galleries and, on exp:channel:entries, works fine.
Is this really a bug?
Thanks, guys!
#2 / Aug 29, 2012 3:10pm
Hello Robson,
Thank you for posting your question here on the ExpressionEngine forums.
Can I have a few more details about the problem?
Can you show me an example of where and how this is taking place?
What are you expecting to see and what do you actually see.
What version of ExpressionEngine are you currently running?
I look forward to hearing from you.
Cheers,
#3 / Aug 29, 2012 4:05pm
Sure, Shane!
Setting the URL of Upload Directory as “//a.domain.com/files/locations” and using this code:
{exp:file:entries limit="1" category="71" disable="pagination" dynamic="no" orderby="date"}
{if credit}/* credits: {credit} */{/if}
.index .main {
background-repeat: no-repeat; background-position: 50% 0;
background-image: url({home_4c_file_url}); /* IE8- override */
}
@media only screen and (max-width: 444px){
.index .main {
background-image: url({home_2c_file_url});
}
}
@media only screen and (max-width: 662px){
.index .main {
background-image: url({home_3c_file_url});
}
}
@media only screen and (min-width: 663px){
.index .main {
background-image: url({home_4c_file_url});
}
}
{/exp:file:entries}returns this:
.index .main {
background-repeat: no-repeat; background-position: 50% 0;
background-image: url(/a.domain.com/files/locations/_home_4c/2467623880_df75f9b8a5_o.jpg); /* IE8- override */
}
@media only screen and (max-width: 444px){
.index .main {
background-image: url(/a.domain.com/files/locations/_home_2c/2467623880_df75f9b8a5_o.jpg);
}
}
@media only screen and (max-width: 662px){
.index .main {
background-image: url(/a.domain.com/files/locations/_home_3c/2467623880_df75f9b8a5_o.jpg);
}
}
@media only screen and (min-width: 663px){
.index .main {
background-image: url(/a.domain.com/files/locations/_home_4c/2467623880_df75f9b8a5_o.jpg);
}
}Please, note the missing “/” at the URL. But I guess this just happens on exp:files:entries.
I’m using eecms 2.5.2.
#4 / Aug 30, 2012 12:18pm
Hey Robson,
Usually when you use a relative path you do not use double whacks like your example. Can you tell me why you are coding the relative path this way?
It “feels” like a windows thing, but at then again the whacks would be going the other direction to browse to a network share. But I may be wrong, I have always used Linux and I am not that familiar with Windows.
I have a feeling that ExpressionEngine is behaving the way it is suppose to.
Thank you,
#5 / Aug 30, 2012 12:33pm
Shane, I want to use a protocol relative URL, not a relative URL. And I don’t see how the operational system can impact this behavior. By the way, the server is running on Linux.
You can read about protocol relative URL here and here.
I didn’t test this on exp:channel:entries, I’m sorry, but looks like this just happens on exp:file:entries. There’s been a while I’m omitting the protocol on the URLs of my assets. This is the first time I saw this happening and the first time I use the exp:file:entries.
Thank you so much.
#6 / Aug 31, 2012 11:10am
Hey Robson,
Bug filed!
I was able to reproduce this easily. Nice find.
Please comment on the bug to stay up to date on it’s progress.
Is there anything else I can help with?
Cheers,
#7 / Aug 31, 2012 11:16am
Thanks again, Shane!
You can close the thread!
Have a nice day!
#8 / Aug 31, 2012 12:03pm
Hey Robson,
Dude, it’s Friday and we are heading into a 3 day weekend. I will have a nice day. 😊
You too! Thanks again for reporting the bug.
Cheers,