Bug #39514
closed
Page preview broken with lockSSL=1/2 and url_scheme=http
Added by Thomas Heilmann over 12 years ago.
Updated almost 9 years ago.
Description
In t3lib_BEfunc::getViewDomain, the schema that is used for the preview link is built according to the page's url_scheme setting (but only if a domain record is set for the current page tree!). If lockSSL is set to 1 or 2 at the same time, the workspace frontend preview is broken: The original preview link uses http, which is not changed by Tx_Workspaces_Service_Workspaces->generateWorkspaceSplittedPreviewLink. But as the new preview link points to a backend script (the workspace module), TYPO3 shows a blank page (lockSSL=1) or redirects to the backend interface (lockSSL=2).
I am not quite sure how to write a patch for this issue; I think it would involve changes to t3lib_BEfunc, too, as there is no way to change the url scheme of the preview link via the existing hook. Any ideas?
This seems to be related to issue http://forge.typo3.org/issues/34820
As stated in the comments of this issue, a regression for preview links has been introduced in TYPO3 4.5.12
A workaround I have found to broken page output due to mixing of http and https elements in the source is to adjust the baseurl according to the https status :
##In your constants
BASEURL = http://www.myhost.com/
[globalString = ENV:HTTP_HOST=www.myhost.com] AND [globalString =_SERVER|HTTPS=on]
BASEURL = https://www.myhost.com/
[global]
##In your setup
config.baseURL = {$BASEURL}
- Category changed from Bugs to Workspaces
- Project changed from 624 to TYPO3 Core
- Category changed from Workspaces to Workspaces
What about changing these in TYPO3\CMS\Backend\Utility\BackendUtility::getViewDomain($pageId, $rootLine = NULL)
if ($page['url_scheme'] == \TYPO3\CMS\Core\Utility\HttpUtility::SCHEME_HTTPS || $page['url_scheme'] == 0 && GeneralUtility::getIndpEnv('TYPO3_SSL')) {
$protocol = 'https';
}
to
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] == 1 || $GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] == 2 || $page['url_scheme'] == \TYPO3\CMS\Core\Utility\HttpUtility::SCHEME_HTTPS || $page['url_scheme'] == 0 && GeneralUtility::getIndpEnv('TYPO3_SSL')) {
$protocol = 'https';
}
Then every preview link is forced to use https if the backend is only available with https.
- Target version set to 7.5
I can confirm this bug in TYPO3 4.5.30
but the behavior is weird...
Setup for baseUrl:
pageBase = http://www.mydomain.de/
[globalString = ENV:HTTPS=on]
pageBase = https://www.mydomain.de/
[end]
[globalString = ENV:HTTP_HOST=cms.mydomain.de]
pageBase = http://cms.mydomain.de/cms/
[end]
[globalString = ENV:HTTP_HOST=cms.mydomain.de] && [globalString = ENV:HTTPS=on]
pageBase = https://cms.mydomain.de/cms/
[end]
the Backend is reached with https://cms.mydomain.de/cms/typo3/backend.php
in WORKSPACE preview this is set in the sourcecode:
<base href="https://cms.mydomain.de/cms/"></base>
which is correct, but all Links are generated like:
<a href="http://www.mydomain.de/some/path.html"></a>
Those links are not clickable in the browser.
- Status changed from New to Needs Feedback
- Priority changed from Must have to Should have
- Target version changed from 7.5 to 7 LTS
- Is Regression set to No
That was solved for TYPO3 CMS 6.2 with issue #61699 please check again.
At the time of the last update to this ticket, TYPO3 CMS 4.5 was almost end of live with 4.5.40
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.
You could also join the #typo3-cms channel in Slack if you still need support.
Thank you
Also available in: Atom
PDF