We are getting an obscure bug when we redirect from an XSLT extension in umbraco where the trace is output. I need to set up the same version of the source that the site in question was built with, are there any guides to getting up and running with the source?
All the source can be found at the codeplex site, http://umbraco.codeplex.com/ can you not just copy the entire web installation of the existing site over the dev machine.
What is the trace output you're getting? Perhaps it is something simple, like missing the exclude-urns?
Thanks ofor the reply Ian, I don't have the trace output at the minute until I get the site set up, but it included a lot of trace information about the site i.e. local IP that could be used to compromise it.
Could you expand on what you mean by 'exclude-urns', my Google-Fu has let me down.
4.0.x still supported Vista DB so you can use that if you prefer.
If you're going to open the sln in Visual Studio is uses post-build events to change the web.config file, based on machine name (using an XSLT transform of the web.config). So if you're opening the sln you need to include a file named web.MY-PC.config.xslt (from memory, I don't have it on had at the moment). This will mean you can define custom stuff (such as a web.config ) for when you compile on your machine.
At the top of the XSLT file, where custom extensions are declared, there is another property called "exclude-result-prefixes" it will have some default information in it, add any custom DLL's in there.
This shouldn't be outputting any local IPs though, does the url have "?umbDebugShowTrace=true" in the title?
Might be worth just editing the web.config file and ensure the property "umbracoDebugMode" is set to false.
Here is a bit more on the error.I have numbered each relevant bit of information below.
In the code (2) we had to put a Redirect(..., false) in there to stop the trace from outputting, as you can see from the Fiddler output (3) that the HTML output from the page is shown below the "moved" page, from our understanding this is wrong andything below the first </html> should not be there.
We think this is something to do with Umbraco as when you create a new solution with a redirect this doesn't happen (this happens with the latest version of the source as well).
namespace AmazeXsltHelper { public class Transfer { public static string Redirect(string url) { System.Web.HttpContext.Current.Response.Redirect(url, false);
return ""; } } }
3. Fiddler TextView when redirect is hit
<html><head><title>Object moved</title></head><body> <h2>Object moved to <a href="http://www.nufc.com">here</a>.</h2> </body></html>
Slace I would prefer to set up the SQL database and replicate the environment as I don't know much about vista db.
What is the best way of doing that? I found a SQL install file in the data folder (umbraco 4.0.2.1\umbraco\datalayer\SqlHelpers\SqlServer\Sql\Total.sql) and was using this, is this the best way to set up the DB?
thanks for the reply, I appreciate the help. We have 'endReponse' set to false as when it is true trace output can be seen in the response we used fiddler to see this. As the trace exposed the internal IP of the server this failed a PCI compliance test and as a workaround we set 'endResponse' to false so the HTML is output and not the trace.
This looks like an umbraco specific error that is happening on the latest version of code as well.
I think that the false shouldn't be set, but likewise, that the internal IP shouldn't be exposed, I am confused how it has entered the equation.. Perhaps it's worth posting up the trace output, but blanking out sensitive information, such as the last 2 or 3 octets of the IP.
I've only ever done redirects in c# on either a usercontrol or a masterpage, and I've never had a problem with it before, I assume your output doesn't look like the umbraco trace, such as http://our.umbraco.org/?umbDebugShowTrace=true
Error loading XSLT Redirect.xslt Thread was being aborted. at umbraco.macro.loadMacroXSLT(macro macro, Hashtable attributes, Hashtable pageElements) in C:\work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\macro.cs:line 604
1.22377341254266
0.092352
Template
Error adding macro Redirect Thread was being aborted. at umbraco.macro.loadMacroXSLT(macro macro, Hashtable attributes, Hashtable pageElements) in C:\work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\macro.cs:line 610 at umbraco.macro.renderMacro(Hashtable attributes, Hashtable pageElements, Int32 pageId) in C:\work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\macro.cs:line 456 at umbraco.presentation.templateControls.Macro.CreateChildControls() in C:\work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\umbraco\templateControls\Macro.cs:line 78
Source set-up for 4.0.2.1
We are getting an obscure bug when we redirect from an XSLT extension in umbraco where the trace is output. I need to set up the same version of the source that the site in question was built with, are there any guides to getting up and running with the source?
Where do I even find the source for the above release?
All the source can be found at the codeplex site, http://umbraco.codeplex.com/ can you not just copy the entire web installation of the existing site over the dev machine.
What is the trace output you're getting? Perhaps it is something simple, like missing the exclude-urns?
You need to download this changeset: http://umbraco.codeplex.com/SourceControl/changeset/view/67270
The code was in the $/branches/rb404 branch
Thanks ofor the reply Ian, I don't have the trace output at the minute until I get the site set up, but it included a lot of trace information about the site i.e. local IP that could be used to compromise it.
Could you expand on what you mean by 'exclude-urns', my Google-Fu has let me down.
Thanks Slace, what about setting up the database what is the best way to get that going?
4.0.x still supported Vista DB so you can use that if you prefer.
If you're going to open the sln in Visual Studio is uses post-build events to change the web.config file, based on machine name (using an XSLT transform of the web.config). So if you're opening the sln you need to include a file named web.MY-PC.config.xslt (from memory, I don't have it on had at the moment). This will mean you can define custom stuff (such as a web.config ) for when you compile on your machine.
At the top of the XSLT file, where custom extensions are declared, there is another property called "exclude-result-prefixes" it will have some default information in it, add any custom DLL's in there.
This shouldn't be outputting any local IPs though, does the url have "?umbDebugShowTrace=true" in the title?
Might be worth just editing the web.config file and ensure the property "umbracoDebugMode" is set to false.
<add key="umbracoDebugMode" value="false"/>
Here is a bit more on the error.I have numbered each relevant bit of information below.
In the code (2) we had to put a Redirect(..., false) in there to stop the trace from outputting, as you can see from the Fiddler output (3) that the HTML output from the page is shown below the "moved" page, from our understanding this is wrong andything below the first </html> should not be there.
We think this is something to do with Umbraco as when you create a new solution with a redirect this doesn't happen (this happens with the latest version of the source as well).
Any ideas would be a big help.
1. XSLT File
2. Code
3. Fiddler TextView when redirect is hit
Slace I would prefer to set up the SQL database and replicate the environment as I don't know much about vista db.
What is the best way of doing that? I found a SQL install file in the data folder (umbraco 4.0.2.1\umbraco\datalayer\SqlHelpers\SqlServer\Sql\Total.sql) and was using this, is this the best way to set up the DB?
Any gotcha's I should watch out for?
Thanks for the help...
Hi Brendan,
Curious to why are you setting the 'endResponse' to false in the Response.Redirect? Set it to true - it should perform the redirect.
If you want the binaries for v4.0.2.1 - I've got a little "unofficial" archive here: http://code.leekelleher.com/umbraco/archive/
(I needed them all for a mammoth upgrade from v2.1.1 to v4.5.1)
Cheers, Lee.
Hi Lee,
thanks for the reply, I appreciate the help. We have 'endReponse' set to false as when it is true trace output can be seen in the response we used fiddler to see this. As the trace exposed the internal IP of the server this failed a PCI compliance test and as a workaround we set 'endResponse' to false so the HTML is output and not the trace.
This looks like an umbraco specific error that is happening on the latest version of code as well.
Any ideas?
Thanks,
B
I found this post, which might be an interesting read, how to do 301 redirects from XSLT: http://our.umbraco.org/forum/using/ui-questions/5255-301-redirect-options
I think that the false shouldn't be set, but likewise, that the internal IP shouldn't be exposed, I am confused how it has entered the equation.. Perhaps it's worth posting up the trace output, but blanking out sensitive information, such as the last 2 or 3 octets of the IP.
I've only ever done redirects in c# on either a usercontrol or a masterpage, and I've never had a problem with it before, I assume your output doesn't look like the umbraco trace, such as http://our.umbraco.org/?umbDebugShowTrace=true
Request Details
Trace Information
Thread was being aborted.
at umbraco.macro.loadMacroXSLT(macro macro, Hashtable attributes, Hashtable pageElements) in C:\work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\macro.cs:line 604
Thread was being aborted.
at umbraco.macro.loadMacroXSLT(macro macro, Hashtable attributes, Hashtable pageElements) in C:\work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\macro.cs:line 610
at umbraco.macro.renderMacro(Hashtable attributes, Hashtable pageElements, Int32 pageId) in C:\work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\macro.cs:line 456
at umbraco.presentation.templateControls.Macro.CreateChildControls() in C:\work\Umbraco\releases\umbraco 4.0.2.1\umbraco\presentation\umbraco\templateControls\Macro.cs:line 78
Control Tree
Session State
Application State
Request Cookies Collection
Response Cookies Collection
Headers Collection
Response Headers Collection
Form Collection
Querystring Collection
Server Variables
Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618
Turns out there is a trace="true" on default.aspx that was causing the issue, it should be fixed now.
is working on a reply...