[TYPO3-english] tt_news link to external url

Philipp Gampe phil at philippgampe.info
Tue Feb 16 01:58:21 CET 2010


Am 10.02.2010, 18:23 Uhr, schrieb Philipp Gampe <phil at philippgampe.info>:

> Hello list,
>
> using tt_news (latest),
> if I select external url (type=2) then I can use normal TYPO3 link  
> wizard to generate link
>
> this works fine in list and single view, but fails in list view if you  
> enter e.g. a file reference or an email address ...
>
> the problem lies in this line
> $exturl = trim(strpos($row['ext_url'], 'http://') !== FALSE ?  
> $row['ext_url'] : 'http://' . $row['ext_url']);
>
>  from pi/class.tx_ttnews.php line 1049

I solved it and attached a patch to:

> btw. this is related to http://bugs.typo3.org/view.php?id=9114

As mentioned in the bugreport, setting
config.absRefPrefix = something
is mandatory !!!

here for quick copy and paste:
>>>>> snip <<<<<<<<<<<

Index: pi/class.tx_ttnews.php
===================================================================
--- pi/class.tx_ttnews.php	(revision 30008)
+++ pi/class.tx_ttnews.php	(working copy)
@@ -1046,8 +1046,7 @@
  			if ($this->theCode == 'XML') {
  				if ($row['type'] == 1 || $row['type'] == 2) {
  					if ($row['type'] == 2) {
-						$exturl = trim(strpos($row['ext_url'], 'http://') !== FALSE ?  
$row['ext_url'] : 'http://' . $row['ext_url']);
-						$exturl = (strpos($exturl, ' ') ? substr($exturl, 0,  
strpos($exturl, ' ')) : $exturl);
+						$exturl = $this->cObj->getTypolink_URL($row['ext_url']);
  					}
  					$rssUrl = ($row['type'] == 1 ? $this->config['siteUrl'] .  
$this->pi_getPageLink($row['page'], '') : $exturl);
  				} else {
@@ -4034,4 +4033,4 @@
  if (defined('TYPO3_MODE') &&  
$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tt_news/pi/class.tx_ttnews.php'])  
{
  	include_once  
($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tt_news/pi/class.tx_ttnews.php']);
  }
-?>
\ No newline at end of file
+?>


More information about the TYPO3-english mailing list