Project

General

Profile

Actions

Bug #24528

closed

getViewDomain returns "http://" when called with id = 0 and existing sys_domain rec -> "Generate Workspace Preview Link" broken

Added by Andreas Kießling almost 14 years ago. Updated almost 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2011-01-12
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The bug will probably only be seen in the "old" workspace module when the button "Generate Workspace Preview Link" is used.
With #19430 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 would only need to go to 4.4, but it would probably not hurt in 4.5 either.

(issue imported from #M16983)


Files

16983_v1.patch (1.21 KB) 16983_v1.patch Administrator Admin, 2011-01-12 15:11
workspace_problem_patch.patch (740 Bytes) workspace_problem_patch.patch Administrator Admin, 2011-01-23 23:30
Actions

Also available in: Atom PDF