[TYPO3-core] RFC #16983: Bug: 16983: getViewDomain returns "http://" when called with id = 0 and existing sys_domain rec -> "Generate Workspace Preview Link" broken
Andreas Kiessling
kiessling at pluspol.info
Mon Jan 17 10:34:59 CET 2011
Hi,
this is a SVN patch request.
Type: Bugfix
BT reference: http://bugs.typo3.org/view.php?id=16983
Branches: 4-4, probably trunk
Problem:
The bug will probably only be seen in the "old" workspace module when
the button "Generate Workspace Preview Link" is used.
With 0009508 the API method t3lib_BEfunc::getViewDomain($this->id) is
used to determine the right domain for the preview link for a whole
workspace (previously: TYPO3_SITE_URL). This works only if $this->id is
> 0 like described in the param documentation or no domain record is
configured. Since that module is not in the "web"-area, there is no page
tree and so no id. -> id = 0
Effects of calling getViewDomain with id = 0:
If parameter $rootline is also not used, the function BEgetRootLine is
called and creates some "fake" rootline for id = 0
If you have a domain record configured, the next check for
getDomainStartPage returns true, but with the faked rootline, there will
be no "firstDomainRecord" and so the $domain is overwritten with a blank
string.
Solution: only try to resolve the domain from domain records if the id
is > 0, otherwise just return the TYPO3_SITE_URL
How to reproduce: open workspace module in 4.4.6 / 4.4 trunk and
generate a preview link. There must also exist a domain record for the
your current host.
You will get something like this:
http://index.php/?ADMCMD_prev=316906209b748eafb0eb631a57b3450f&id=0 [^]
Apply the patch, and you will get:
http://www.example.com/index.php/?ADMCMD_prev=316906209b748eafb0eb631a57b3450f&id=0
[^]
To fix that particular case, the patch only needs to go to 4.4, but it
would probably not hurt in 4.5 either.
Already has a +1 on testing from Michael Voehringer
Regards,
Andreas
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 16983_v1.patch
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20110117/2ec989ff/attachment.asc>
More information about the TYPO3-team-core
mailing list