Bug #22884
closedHidden sys_domain-records not ignored
0%
Description
If you have several disabled domain records before valid (enabled) domain-records, typo3 will use the very first found domain-record for link generation.
example:
[disabled] 192.168.100.14
[disabled] 192.168.100.13
[enabled] 192.168.100.10
> generated link -> 192.168.100.14/index.php> should be -> 192.168.100.10/index.php
4.4-dev Revision 7927
Actually this happens with tt_news and wt_directory. So it doesn't seem to be a problem with a single extension. As they both use standard typo3-link-generators.
This is a result of the function class.tslib_content::typoLink() as this function doesn't verify if the sys_domain-records are hidden or not.
I attached two patches and will also post them in the mailing list anytime soon.
First patch contains only the additional sql-param to avoid loading hidden domain records from database. I don't think these records are necessary and could therefore be ignored.
The second one takes care of an old TODO-mark inside this function to reduce sql-queries in typolink generator. Actually typo3 executes a sql query for each single typolink generation. I saved the result into class-variables, to avoid querying the db each time. On second request in same instance typo3 will use the already fetched data and will not query again. As this happens for each instance of the pi-base class, there should be no problem with multi-domain / multi-sites environments in typo3.
Actually I tested my changes in tt_news, and wt_directory without an error.
(issue imported from #M14730)
Files
Updated by Ralle Büchnitz over 14 years ago
I added some minor changes, to the third diff.
- logical enhancement with $forceTarget (executed in both parts of the if/else statement, so moved it right before the condition)
- trying to read from
- $GLOBALS['TSFE']->config['config']['absRefPrefix']
what should be retrieved by
- $GLOBALS['TSFE']->absRefPrefix
HINT: It seems like this function has become pretty messy, as variables will be set and unset and set again (p.e.: $targetDomain). But this is a little to difficult for me right now. So more optimization could be done the future.
Updated by Ralle Büchnitz over 14 years ago
I tried to post my patches to the core mailing list, but I failed. My mail has been always rejected.
Could anyone else - please - post these patches?
Updated by Xavier Perseguers almost 13 years ago
- Category deleted (
Communication) - Assignee deleted (
Steffen Kamper) - Target version deleted (
0)
Updated by Nicole Cordes over 12 years ago
This issue can be closed as domain records can be forced by setting the "forced" flag.
Updated by Steffen Gebert over 12 years ago
- Status changed from Accepted to Closed
- Assignee set to Steffen Gebert