Bug #20787
closedURLs in search results are not speaking URLs
0%
Description
The workaround (Note: 0004190 + 0004191) provided by Rober Destigter in issue 1868 is still needed to convert resultlinks to speaking URLs.
Unfortunately the workaround does not solve the problem with RealURL links to pages defined as mountpoints. They are returned like "www.domain.com/page/&MP=148-272"
(issue imported from #M11588)
Updated by Dmitry Dulepov about 14 years ago
Is the link correct (except for MP part)? Does it link to a proper page and domain?
Updated by about 14 years ago
The first part of Andy's message means that #1686 is not resolved. If you have a multidomain enviromnent, the link is not generated as typolink therefore you have no speaking URLs. I don't know why - I think having EnableLinksAcrossDomains enabled makes pi_linkToPage generate correct typolinks across domains.
If you change link generation to pi_linkToPage, it works fine even with mountpoints.
Updated by Stefan Galinski almost 13 years ago
- Target version deleted (
0) - TYPO3 Version set to 4.2
Still valid?
Updated by Andy Meier over 12 years ago
Yes, the issue is still valid. Link generation with
return $this->pi_linkToPage($str,$id,$this->conf['result_link_target'],$urlParameters);
does not solve the problem as suggested by Lorenz. It returns realUrl links but prepends no (or the wrong) domain, if the mounted page resides outside the current domain or is stored in a page outside any domain tree (i.e. a shared folder holding the same mounted pages for multiple domains).
Since the mounted page and not the mountpoint itself is stored in index_phash pi_linkToPage returns the domain record of the mounted page.
I guess that's the reason why the current version (TYPO3 4.5.15) of pi/class.tx_indexedsearch.php is using:
return '<a href="'.htmlspecialchars($scheme.$firstDom.'/index.php?id='.$id.$addParams).'"'.$target.'>'.htmlspecialchars($str).'</a>'; insted.
Unfortunately the value for $firstDom is also wrong in the scenario described above and speaking urls are still not possible. I fixed this by adding another method for getting the domain record if $urlPrameters['MP'] is set.
... $firstDom = current($this->domain_records[$id]); if(isset($urlParameters['MP'])) { $firstDom = $this->getDomainFromPageId($id,$urlParameters['MP']); } ... function getDomainFromPageId($id,$pathMP='') { $identStr = $id.'|'.$pathMP; if (!isset($this->cache_path[$identStr])) { $this->fe_groups_required[$id] = array(); $this->domain_records[$id] = array(); $rl = $this->getRootLine($id,$pathMP); $hitRoot = 0; $sysDName = ''; if (is_array($rl) && count($rl)) { foreach ($rl as $k => $v) { // Check fe_user if ($v['fe_group'] && ($v['uid']==$id || $v['extendToSubpages'])) { $this->fe_groups_required[$id][]=$v['fe_group']; } // Check sys_domain. if ($this->conf['search.']['detect_sys_domain_records']) { $sysDName = $this->getFirstSysDomainRecordForPage($v['uid']); if ($sysDName) { $this->domain_records[$id][] = $sysDName; break; } } // Stop, if we find that the current id is the current root page. if ($v['uid']==$GLOBALS['TSFE']->config['rootLine'][0]['uid']) { break; } } } } return $sysDName; }
Updated by Dave van Grootheest over 12 years ago
So is the problem with using pi_linkToPage limited to situations with mountpoints?
As long that problem is not resolved, it might be helpful to have the script default to pi_linkToPage, and only use a different approach for mountpoints. That would seem to provide speaking URLs in many (non-mountpoint) cases, without having to customize the script for that. (If I understand things correctly, this approach does require typolinkEnableLinksAcrossDomains to be properly set in order to get speaking cross-domain URLs.)
Or would there be a problem with this?
Updated by Alexander Opitz over 11 years ago
Hi,
as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (4.5 or 6.1)?
Updated by Alexander Opitz almost 11 years ago
- Status changed from Needs Feedback to Closed
- Is Regression set to No
No feedback for over 90 days.
If you think, that this is the wrong decision, then please write to the mailing list typo3.teams.bugs with issue number and an explanation.