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 #1

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

Actions #2

Updated by Steffen Gebert almost 14 years ago

Andreas, can you send it to the core list please?

Actions #3

Updated by Andreas Kießling almost 14 years ago

Pending.

Actions #4

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.

Actions #5

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.

Actions #6

Updated by Simon Schaufelberger about 13 years ago

  • Target version deleted (0)

+1, patch works (both combined). can somebody please push to gerrit?

Actions #7

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.

Actions

Also available in: Atom PDF