Bug #24528
closedgetViewDomain returns "http://" when called with id = 0 and existing sys_domain rec -> "Generate Workspace Preview Link" broken
0%
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
Updated by Michael Voehringer almost 14 years ago
+1 for this patch after testing in with the latest 4.4 svn version
@Andreas Otto †: tanks for the patch
Updated by Steffen Gebert almost 14 years ago
Andreas, can you send it to the core list please?
Updated by Benni Mack almost 14 years ago
Hey Andreas,
I had the same issue, but fixed it differently. What do you think?
All the best,
Benni.
Updated by Andreas Kießling almost 14 years ago
Hi Benni,
how about combining both? Though i currently can't image a scenario where it fails with $id > 0
I just had another idea to tackle this: if $id = 0 and self::getDomainStartPage returns a record -> override the $rootline with the one from the page where the domainRecord is configured.
That way self::firstDomainRecord should be able to fetch "the right" domain.
Updated by Simon Schaufelberger about 13 years ago
- Target version deleted (
0)
+1, patch works (both combined). can somebody please push to gerrit?
Updated by Alexander Opitz almost 10 years ago
- Description updated (diff)
- Status changed from New to Closed
- Is Regression set to No
After speaking with Andreas, I'm closing this issue, as it isn't needed any more with the new workspace module.