[TYPO3-core] Approving patches

Bernhard Kraft kraftb at kraftb.at
Sat Oct 28 12:19:56 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi !

> This approach can have some problems. Exanple is bug about 
> simulateStatic that is discussed for ages (cannot make link from one 
> domain to another and use simulateStatic). All current approaches are 
> wrong (because they do not take into account that setup of a different 
> domain can be without simulateStatic) but correct approach affects 
> performance too much. However people want to use that wrong approach. If 
> they get enough +1s, this wrong thing can get into core and make core 
> behave improperly.
> 
> So there is a little risk in this approach.


I do not really want to focus on the approach - I guess such a method has it's
advantages and benefits the same as it has disadvantages and will cause some
worries - but rather on Dmitrys problem with links to other sites + simStatic:

I had the problem with link's to other domains too ... When you create a link to
an page in another domain (using the "typolink" method - which is the case for
link's from tt_content elements) it will first not contain the right domain but
only the ?id= parameter will be correct.
I guess for simulateStatic this will be the same. AFAIR you will not get the requested
page delivered because the supplied UID is outside of the domain which was generated
in the link.

Now you have the option to set: "config.typolinkCheckRootline = 1" in your TS and
the link's to the other domain will get generated properly - with the URL of the referenced
site as it will take the domain records into account.

The proplem which Dmitry mentioned is that if you have 3 domains - 2 of them use simulateStatic
(or realURL) and one doesn't - and you generate links to the simStatic and NotSimStatic page from
the remaining simStatic page then all links will get generated using simulateStatic like URL's -
which will not get recognized on the page which has simStatic not set ... clear ?

* Solution for Dmitrys problem: Let the "config.simulateStaticDocuments" TS value (and of course
the "config.tx_realurl_enable" TS setting) not only be a simply boolean 0/1 value but rather also
a string - add code that if I set:

config.simulateStaticDocuments = www.firstDomainWithSimulateStatic.com,www.secondSimStatic.com

that simulate static will only get used for links mentioned in the list (or it was set to "1"
which means "all")

This was you could easily also mix realURL and simulateStatic sites in one installation :)

The admin just has to keep track where he set what (but this is always the case :)


And another problem I stumbled on (and which for I made a "fix-extension" for a customer) is
that the "config.typolinkCheckRootline" parameter only get's checked in the "typolink" method.

But cObj->typolink() isn't the lowest-level link method. Menu-links for example from TMENU's or
such get generated by directly calling the "more low-level" link method t3lib_tstemplate.php->linkData

the linkData method is also called in cObj->typolink finally to generate the link.

The problem I stumbled on was that the customer (which used realURL) set one of the pages to be
a shortcut to a page in another domain ... As realURL resolves shortcuts while generating the links
the menu will create a link to the shortcut-target-page - of course with a wrong domain.
(normally you get a link to the shortcut-page id and the shortcut-target get's resolved while rendering
the page)

And you can't even fix that by setting "config.typolinkCheckRootline" as the menu-links don't get
generated using the "typolink" method.

I fixed this by moving the code-block which reacts on "typolinkCheckRootline" from the
tslib_content.php->typolink method to the t3lib_tstemplate.php->linkData method.

Now correct-domain links work also for menu-shortcuts.

I have an example for the correct-domain menu links here as an extension (sorry - no diff)

http://think-open.org/kraftb/index/T3X_kb_domainLinks.t3x
(The above with simulateStatic as list-value is not implemented here)



greets,
Bernhard
- --
- ----------------------------------------------------------------------
"Freiheit ist immer auch die Freiheit des Andersdenkenden"
Rosa Luxemburg, 1871 - 1919
- ----------------------------------------------------------------------
[[ http://think-open.at | Open source company ]]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFFQy7MIl4dkVkDMFkRApudAJ9orvR+7CBj+4CgD8Im6f3jm/zu4wCgjmn/
goblaucYocJm1pXK20wKsGE=
=aWa+
-----END PGP SIGNATURE-----



More information about the TYPO3-team-core mailing list