Closed gvv1401 closed 4 years ago
Please check the AJAX request in your browser console. What is the result from the server?
XHR:
http://p484107.webspaceconfig.de/?tx_ipandlanguageredirect_pi1[browserLanguage]=en&tx_ipandlanguageredirect_pi1[ipAddress]=&tx_ipandlanguageredirect_pi1[referrer]=&tx_ipandlanguageredirect_pi1[languageUid]=0&tx_ipandlanguageredirect_pi1[rootpageUid]=1&tx_ipandlanguageredirect_pi1[countryCode]=&tx_ipandlanguageredirect_pi1[domain]=
==================================================
RESPONSE HEADER:
HTTP/1.1 200 OK
Date: Thu, 17 Jan 2019 13:36:38 GMT
Server: Apache
Expires: 0
Cache-Control: no-cache, must-revalidate
Pragma: no-cache
Content-Language: de
X-TYPO3-Parsetime: 6120ms
Last-Modified: Thu, 17 Jan 2019 13:36:38 GMT
Vary: Accept-Encoding
X-UA-Compatible: IE=edge
X-Content-Type-Options: nosniff
Keep-Alive: timeout=5, max=96
Connection: Keep-Alive
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
==================================================
RESPONSE:
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<!--
This website is powered by TYPO3 - inspiring people to share!
TYPO3 is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.
TYPO3 is copyright 1998-2018 of Kasper Skaarhoj. Extensions are copyright of their respective owners.
Information and contribution at https://typo3.org/
-->
....
I get the same SyntaxError message in Chrome with TYPO3 9.5.4 and EXT:ipandlanguageredirect 2.1.0.
The redirect button only has #
as a link, regardless of the current website's language.
<a class="ipandlanguageredirect__button" href="#"
data-ipandlanguageredirect-container="link">
Zeige besser passende Version dieser Seite
</a>
That are two different things. @gvv1401 mentioned a problem on page load while @sebkln mention a problem on a click if I understand both of you.
@gvv1401 The response is simply wrong. There should no html but a JSON. Pls check the TypoScript typenum configuration (and maybe a realurl configuration). @sebkln I would create a new issue and check the browser console for errors.
Sorry for the confusion. I do get the exact same error as @gvv1401 on page load. I just wanted to add the fact that the extension does render the suggest container1, but with a wrong (empty) link.
JSON.parse
in Frontend.min.js to console.log
. Result: it's the complete HTML markup of the current page.1
(matching default setting in Redirect.php).0
is english (matching default setting in Redirect.php).1
is german (matching default setting in Redirect.php).I added the frontend plugin to a test page. The result is:
{
"redirectUri": "http:\/\/testdomain.test\/en\/tests\/",
"activated": false,
"events": [
"suggest"
],
"activatedReasons": {
"differentLanguages": false,
"differentRootpages": false
},
"country": "de",
"givenParameters": {
"browserLanguage": "",
"referrer": "",
"ipAddress": "127.0.0.1",
"languageUid": 0,
"rootpageUid": 1,
"countryCodeOverlay": "",
"domain": "testdomain.test"
}
}
I assume that that I did not set every necessary configuration in Redirect.php. Can you tell me the minimal adjustments every integrator has to make?
Maybe it's an obvious mistake I made.
[1] The suggest container is hidden because of max-height: 0
, which seems to be a different issue.
I'm not sure what I can answer. On one page a HTML is given back (what's wrong) and on another page the correct JSON is given back. I do not know the difference between your two instances - sorry
No problem. For now I went with a RewriteRule
in my .htaccess file. Checking for browser language is sufficient in my case. Will investigate my issue with this extension at a later time.
We've got the same problem in TYPO3 9.5. The "&type=1555" in the AJAX call is missing.
I can see this error on a Typo3 8.7.20, too. Just as described, but I use realURL, so that does not seem to be the main reason for the error.
But I additionally I get on some pages JSON code in the browser instead of the rendere3d page (including the error in the Chrome console): https://github.com/einpraegsam/ipandlanguageredirect/issues/20
Maybe this issue helps here
For TYPO3 9.5 you need a PageTypeEnhancer for type=1555 https://docs.typo3.org/typo3cms/extensions/core/Changelog/9.5/Feature-86160-PageTypeEnhancerForMappingTypeParameter.html
Just add redirect.json: 1555
to the map of your PageTypeEnhancer in the site config file.
Example:
routeEnhancers:
PageTypeSuffix:
type: PageType
map:
redirect.json: 1555
The filename of redirect.json
can by anything.
In TYPO3 8.7 with realurl it should work out of the box.
Maybe @einpraegsam can adapt the docs for this issue.
Thank you for your help! The problem is that it works in general but sometimes only the json string appears in the browser. From then on, those pages are only reachable directly via their pageid url.
Added an example to documentation in 290f731fb2fde08cf0970e7864d0e08922bb2100
Hello! I have TYPO3 site (v.9.5.1) with ipandlanguageredirect (v.2.1.0). When page loaded I got error message in Chrome:
Error message in FF:
Why? Any idea?
P.S. jQuery version is 1.11.2