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