[TYPO3-english] RealURL: class t3lib_div.getIndpEnv('TYPO3_SITE_URL') not returning correct url path in combination with RealURL

Marieke Vandamme marie at tvh.be
Thu Jul 30 13:47:11 CEST 2009


Hi,

We are currently experiencing problems on our typo3 website with the RealURL
extension. 


In class tx_realurl.decodeSpURL(), the variable tslib_fe.siteScript is used
to retrieve the pagepath
relative to the typo3 base URL. This variable seems to be empty at this
point.
Our base URL looks like "http://www.test.com/site/".
After some debugging, the reason why this variable was empty seems to be
caused by the
function t3lib_div.getIndpEnv('TYPO3_SITE_URL') that is invoked within 
tslib_fe.checkAlternativeIdMethods().


In the case statement 'TYPO3_SITE_URL' within t3lib_div.getIndpEnv(), the
following logic is executing ...


The URL invoked is "http://www.test.com/site/corporate_info/company_video/"

The "PATH_site" variable contains "/srv/www/htdocs/www.test.com/site/"

The "PATH_thisScript" variable contains
"/srv/www/htdocs/www.test.com/site/index.php"

case 'TYPO3_SITE_URL':
	
	
	if (defined('PATH_thisScript') && defined('PATH_site'))	{
		$lPath = substr(dirname(PATH_thisScript),strlen(PATH_site)).'/';
							
		$url = t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR');
		$siteUrl = substr($url,0,-strlen($lPath));
		if (substr($siteUrl,-1)!='/')	$siteUrl.='/';
		
		$siteUrl = "http://tvh.test.com/site/";
	
		$retVal = $siteUrl;
	}


So after invocation, lPath translates to "/", instead of the expected url
pagepath.
We suspect that this lPath variable should contain
"corporate_info/company_video/" after invocation.
So siteUrl should contain "http://www.test.com/site/".
If we hard-code this url in the function, everything runs as expected. But
it is not clear how to change
this function to return the correct siteUrl, or what other options are.

Is there a way to solve this issue? Are we missing something and can this be
resolved by configuration?

Many thanks for any help! Marieke.
-- 
View this message in context: http://www.nabble.com/RealURL%3A-class-t3lib_div.getIndpEnv%28%27TYPO3_SITE_URL%27%29-not-returning-correct-url-path-in-combination-with-RealURL-tp24736875p24736875.html
Sent from the TYPO3 English mailing list archive at Nabble.com.



More information about the TYPO3-english mailing list