Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with pdoPage snippet of pdoTools component #33

Open
krava77 opened this issue Apr 26, 2023 · 8 comments
Open

issue with pdoPage snippet of pdoTools component #33

krava77 opened this issue Apr 26, 2023 · 8 comments

Comments

@krava77
Copy link

krava77 commented Apr 26, 2023

Hello!
I have two: contexts: web(english) and de(german).

I have an issue with langRouter + pdoPage. It works correctly with web context until I haven't german language in the settings of my browser, but when I add it, the langRouter returns an empty result.
Could you help me resolve this issue?

MODx: 3.0.1-pl
langRouter: 1.4.2

English version located on url: http://localhost:8081/en/
German version located on url: http://localhost:8081/de/

my context settings:
base_url: /
cultureKey: en and de in the de context
url_scheme: https://
site_url: {url_scheme}{http_host}{base_url}{cultureKey}/

here is the langRouter log:
[2023-04-26 18:09:41] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"
[2023-04-26 18:09:41] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Unhandled request:
REQUEST_URI: /en/profile/
REDIRECT_URI:
QUERY_STRING: q=en/profile/
q: en/profile/
Context: web
Site start: 1
[2023-04-26 18:09:41] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 186) contextmap: array(2) {
["en"]=>
string(3) "web"
["de"]=>
string(2) "de"
}

[2023-04-26 18:09:41] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"
[2023-04-26 18:09:41] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Culture key found in URI:
REQUEST_URI: /profile/
REDIRECT_URI:
QUERY_STRING: q=en/profile/
q: profile/
Context: web
Site start: 1
[2023-04-26 18:09:43] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"
[2023-04-26 18:09:43] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 166) PHP warning: Undefined array key "q"
[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Unhandled request:
REQUEST_URI: /assets/components/pdotools/connector.php
REDIRECT_URI:
QUERY_STRING:
q:
Context: web
Site start: 1
[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 186) contextmap: array(2) {
["en"]=>
string(3) "web"
["de"]=>
string(2) "de"
}

[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 186) Detected culture key: string(2) "de"

[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 186) Detected context key: string(2) "de"

[2023-04-26 18:09:43] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"
[2023-04-26 18:09:43] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"[2023-04-26 18:09:43] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 166) PHP warning: Undefined array key "q"

[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Culture key not found in URI:
REQUEST_URI: /assets/components/pdotools/connector.php
REDIRECT_URI:
QUERY_STRING:
q:
Context: de
Site start: 114
[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 198) Redirect to http://localhost:8081/de/?pdotreat3=1&pageId=6&hash=b5edf689092779b36e96e2bdc4b3cbc95f1be8e0
[2023-04-26 18:09:43] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"
[2023-04-26 18:09:43] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 166) PHP warning: Undefined array key "q"
[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Unhandled request:
REQUEST_URI: /assets/components/pdotools/connector.php
REDIRECT_URI:
QUERY_STRING:
q:
Context: web
Site start: 1
[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 186) contextmap: array(2) {
["en"]=>
string(3) "web"
["de"]=>
string(2) "de"
}

[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 186) Detected culture key: string(2) "de"

[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 186) Detected context key: string(2) "de"

[2023-04-26 18:09:43] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 166) PHP warning: Undefined array key "q"
[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Unhandled request:
REQUEST_URI: /assets/components/pdotools/connector.php
REDIRECT_URI:
QUERY_STRING:
q:
Context: web
Site start: 1
[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 186) contextmap: array(2) {
["en"]=>
string(3) "web"
["de"]=>
string(2) "de"
}

[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 186) Detected culture key: string(2) "de"

[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 186) Detected context key: string(2) "de"

[2023-04-26 18:09:43] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"
[2023-04-26 18:09:43] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 166) PHP warning: Undefined array key "q"
[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Culture key not found in URI:
REQUEST_URI: /assets/components/pdotools/connector.php
REDIRECT_URI:
QUERY_STRING:
q:
Context: de
Site start: 114
[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 198) Redirect to http://localhost:8081/de/?pdouser=1&pageId=6&hash=0f7a4ea631e722615e70cfd727eef12ae0193c54
[2023-04-26 18:09:43] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"
[2023-04-26 18:09:43] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 166) PHP warning: Undefined array key "q"
[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Culture key not found in URI:
REQUEST_URI: /assets/components/pdotools/connector.php
REDIRECT_URI:
QUERY_STRING:
q:
Context: de
Site start: 114
[2023-04-26 18:09:43] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 198) Redirect to http://localhost:8081/de/?pdotreat1=1&pageId=6&hash=6b61654128b5084c489de49dcf1c40c4881ba6af
[2023-04-26 18:09:44] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"
[2023-04-26 18:09:44] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Unhandled request:
REQUEST_URI: /de/?pdouser=1&pageId=6&hash=0f7a4ea631e722615e70cfd727eef12ae0193c54
REDIRECT_URI:
QUERY_STRING: q=de/&pdouser=1&pageId=6&hash=0f7a4ea631e722615e70cfd727eef12ae0193c54
q: de/
Context: web
Site start: 1
[2023-04-26 18:09:44] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 186) contextmap: array(2) {
["en"]=>
string(3) "web"
["de"]=>
string(2) "de"
}

[2023-04-26 18:09:44] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"
[2023-04-26 18:09:44] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Unhandled request:
REQUEST_URI: /de/?pdotreat3=1&pageId=6&hash=b5edf689092779b36e96e2bdc4b3cbc95f1be8e0
REDIRECT_URI:
QUERY_STRING: q=de/&pdotreat3=1&pageId=6&hash=b5edf689092779b36e96e2bdc4b3cbc95f1be8e0
q: de/
Context: web
Site start: 1
[2023-04-26 18:09:44] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 186) contextmap: array(2) {
["en"]=>
string(3) "web"
["de"]=>
string(2) "de"
}

[2023-04-26 18:09:44] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"
[2023-04-26 18:09:44] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Culture key found in URI:
REQUEST_URI: /?pdotreat3=1&pageId=6&hash=b5edf689092779b36e96e2bdc4b3cbc95f1be8e0
REDIRECT_URI:
QUERY_STRING: q=de/&pdotreat3=1&pageId=6&hash=b5edf689092779b36e96e2bdc4b3cbc95f1be8e0
q:
Context: de
Site start: 114
[2023-04-26 18:09:44] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"
[2023-04-26 18:09:44] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Culture key found in URI:
REQUEST_URI: /?pdouser=1&pageId=6&hash=0f7a4ea631e722615e70cfd727eef12ae0193c54
REDIRECT_URI:
QUERY_STRING: q=de/&pdouser=1&pageId=6&hash=0f7a4ea631e722615e70cfd727eef12ae0193c54
q:
Context: de
Site start: 114
[2023-04-26 18:09:44] (ERROR @ /www/core/src/Revolution/modParser.php : 509) Could not find snippet with name !++site_start.
[2023-04-26 18:09:44] (ERROR @ /www/core/src/Revolution/modParser.php : 509) Could not find snippet with name !++site_start.
[2023-04-26 18:09:44] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"
[2023-04-26 18:09:44] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Unhandled request:
REQUEST_URI: /de/?pdotreat1=1&pageId=6&hash=6b61654128b5084c489de49dcf1c40c4881ba6af
REDIRECT_URI:
QUERY_STRING: q=de/&pdotreat1=1&pageId=6&hash=6b61654128b5084c489de49dcf1c40c4881ba6af
q: de/
Context: web
Site start: 1
[2023-04-26 18:09:44] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 186) contextmap: array(2) {
["en"]=>
string(3) "web"
["de"]=>
string(2) "de"
}

[2023-04-26 18:09:44] (ERROR @ /www/core/components/langrouter/src/LangRouter.php : 164) PHP warning: Undefined array key "REDIRECT_URI"
[2023-04-26 18:09:44] (ERROR in LangRouter @ /www/core/components/langrouter/src/LangRouter.php : 169) Culture key found in URI:
REQUEST_URI: /?pdotreat1=1&pageId=6&hash=6b61654128b5084c489de49dcf1c40c4881ba6af
REDIRECT_URI:
QUERY_STRING: q=de/&pdotreat1=1&pageId=6&hash=6b61654128b5084c489de49dcf1c40c4881ba6af
q:
Context: de
Site start: 114
`

@Jako
Copy link
Owner

Jako commented Apr 29, 2023

Sorry, can you describe the issue a little further? Which url do you call? When is the blank result shown?

Did you prepare every step in https://jako.github.io/LangRouter/usage/ ?

@krava77
Copy link
Author

krava77 commented May 10, 2023

Sorry, for the delay with the answer. Yes, I did as described in the manual and it's working correctly with english language, but it does not work with ajax queries when I add german language to the Chrome or Firefox browser.
If necessary I can provide a video and give you credentials to PM.

@krava77
Copy link
Author

krava77 commented May 10, 2023

@Jako
Copy link
Owner

Jako commented May 10, 2023

The video link does not work.

@krava77
Copy link
Author

krava77 commented May 10, 2023

Sorry, I've fixed the video link

@Jako
Copy link
Owner

Jako commented May 11, 2023

I don't see a reload of the page after moving the german language to the top. I think that could cause the issue.

Since you are creating AJAX or fetch requests to the server, can you please post the relevant payload data. Maybe I can see, what happens there.

@krava77
Copy link
Author

krava77 commented May 11, 2023

yes you are right, the element does not reload on Ajax query, when the german on top.
Sorry, I don't understand what particular information you need. If necessary, I can provide you access to the site in PM.
With german on top, I see the 301 status error, whereas if other languages on top, I see 200 status query.

изображение

@Jako
Copy link
Owner

Jako commented May 11, 2023

The connector is redirected (with 301). Thats the issue. The redirected location loads the german start page (de/) and not the connector result. Thats more a pdotools issue. I am not sure how to solve that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants