-
Notifications
You must be signed in to change notification settings - Fork 19
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
SimpleSearch breaks website after server migration #54
Comments
What versions of MODX and SimpleSearch are you using? (There are at the moment 2 different versions of SimpleSearch for MODX 2.x and 3.x respectively.) Can you check the PHP error log to see what the exact error message is? |
Hi,
I’m currently developing locally on two different MacBooks using:
* ModX 3.0.1
* MAMP 6.6
* Apache web server
* PHP 7.4.21
* MySQL 5.7.34
* SimpleSearch 3.0.0-alpha
The setup is the same on both MacBooks.
I migrate back and forth between these two MacBooks to keep all the sites up to date both at work and at home.
This has never been a problem until I implemented SimpleSearch, which technically, is the perfect search tool for the kind of sites I develop.
Now,
The websites I develop with SimpleSearch all works perfectly. It’s when I migrate from one computer to the other it stops working, and not just SimpleSearch but the whole website. In ModX Manager all works but the website shows, apart from error 500, nothing, no source code, no nothing.
If I uninstall SimpleSearch on this migrated website, everything works perfectly, apart for the search-function of course.
If I re-install SimpleSearch it all breaks again.
Simply put, I can only get SimpleSearch to work on the original website, not the migrated one, no matter on which of my to MacBooks I developed the website.
I’ve also tried un-installing SimpleSearch AND removing all packages, deleting all cached files and then re-installing SimpleSearch.
Same result unfortunately.
//Bosse
Bo Lovenhjelm
[signature_2087664032]
Frontend Developer
[signature_1918481955]
Direct: +46 433 27 30 38
NIBE AB NIBE Energy Systems
Switchboard: +46 433 27 30 00
nibe.se<https://www.nibe.se> | nibe.eu<https://www.nibe.eu> | nibe.com<https://www.nibe.com>
NIBE AB behandlar dina personuppgifter enligt: nibe.se/integritetspolicy<https://www.nibe.eu/sv-se/om-nibe/integritetspolicy>
NIBE AB process your personal information according to: nibe.eu/privacypolicy<https://nibe.eu/privacypolicy>
***@***.***
Sedan 1952 har NIBE tillverkat energieffektiva klimatiseringslösningar för hem och större fastigheter.
Allt startade i småländska Markaryd och idag är vi ett internationellt innovationsföretag som fyller 70 år.
Vi arbetar ständigt med att skapa nytta för våra kunder och bidrar till att allt fler kan leva mer hållbart.
Från: halftrainedharry ***@***.***>
Datum: tisdag, 11 oktober 2022 20:53
Till: modxcms/SimpleSearch ***@***.***>
Kopia: Bo Lovenhjelm ***@***.***>, Author ***@***.***>
Ämne: Re: [modxcms/SimpleSearch] SimpleSearch breaks website after server migration (Issue #54)
What versions of MODX and SimpleSearch are you using? (There are at the moment 2 different versions of SimpleSearch for MODX 2. x and 3. x respectively. ) What's the PHP version? How does the webserver differ from you local setup? Can you check
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
What versions of MODX and SimpleSearch are you using? (There are at the moment 2 different versions of SimpleSearch for MODX 2.x and 3.x respectively.)
What's the PHP version? How does the webserver differ from you local setup?
Can you check the PHP error log to see what the exact error message is?
—
Reply to this email directly, view it on GitHub [github.com]<https://urldefense.com/v3/__https:/github.com/modxcms/SimpleSearch/issues/54*issuecomment-1275134402__;Iw!!HMLeYTom!GC38Dm_lolHRJVUdO7faPonPRCiaJeFN5uAVRshuDcrlL40t01iLvqazGLiLOnH3q4oK4gxuhQgnua0FOVocJrZdJiVJ$>, or unsubscribe [github.com]<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AVONED6PGLI7R6UJV4FMVUDWCWZT7ANCNFSM6AAAAAARCHFLRI__;!!HMLeYTom!GC38Dm_lolHRJVUdO7faPonPRCiaJeFN5uAVRshuDcrlL40t01iLvqazGLiLOnH3q4oK4gxuhQgnua0FOVocJjjOHNIj$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Check the system setting "simplesearch.driver_class". Make sure the value is If this doesn't solve the problem then please check the PHP error log. An exact error message (where and why the error occurred) would help a lot to solve the issue. If you are unsure where the PHP error log is located, take a look at the config file "php.ini". Probably the setting |
Ok, I will.
Thanx for getting back to me and help so far. 😊
I’ll get back to you.
//Bosse
Bo Lovenhjelm
[signature_160495380]
Frontend Developer
[signature_2011416591]
Direct: +46 433 27 30 38
NIBE AB NIBE Energy Systems
Switchboard: +46 433 27 30 00
nibe.se<https://www.nibe.se> | nibe.eu<https://www.nibe.eu> | nibe.com<https://www.nibe.com>
NIBE AB behandlar dina personuppgifter enligt: nibe.se/integritetspolicy<https://www.nibe.eu/sv-se/om-nibe/integritetspolicy>
NIBE AB process your personal information according to: nibe.eu/privacypolicy<https://nibe.eu/privacypolicy>
***@***.***
Sedan 1952 har NIBE tillverkat energieffektiva klimatiseringslösningar för hem och större fastigheter.
Allt startade i småländska Markaryd och idag är vi ett internationellt innovationsföretag som fyller 70 år.
Vi arbetar ständigt med att skapa nytta för våra kunder och bidrar till att allt fler kan leva mer hållbart.
Från: halftrainedharry ***@***.***>
Datum: onsdag, 12 oktober 2022 09:56
Till: modxcms/SimpleSearch ***@***.***>
Kopia: Bo Lovenhjelm ***@***.***>, Author ***@***.***>
Ämne: Re: [modxcms/SimpleSearch] SimpleSearch breaks website after server migration (Issue #54)
Check the system setting "simplesearch. driver_class". Make sure the value is \SimpleSearch\Driver\SimpleSearchDriverBasic. If this doesn't solve the problem then please check the PHP error log. An exact error message (where and why the error
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Check the system setting "simplesearch.driver_class". Make sure the value is \SimpleSearch\Driver\SimpleSearchDriverBasic.
…________________________________
If this doesn't solve the problem then please check the PHP error log. An exact error message (where and why the error occurred) would help a lot to solve the issue.
If you are unsure where the PHP error log is located, take a look at the config file "php.ini". Probably the setting error_log. (Maybe also check the values of other settings like log_errors, display_errors, error_reporting.)
—
Reply to this email directly, view it on GitHub [github.com]<https://urldefense.com/v3/__https:/github.com/modxcms/SimpleSearch/issues/54*issuecomment-1275746448__;Iw!!HMLeYTom!EecQ7DExXopRcl2BXr9oqB4qtSrS_sLsNhwv3xwzGyiunndbi2omofg83J4UBq_2HPfmsyWwA3tGTLEENA6r8CZA66tw$>, or unsubscribe [github.com]<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AVONED6L4K6JZMUCDMUZWYLWCZVJRANCNFSM6AAAAAARCHFLRI__;!!HMLeYTom!EecQ7DExXopRcl2BXr9oqB4qtSrS_sLsNhwv3xwzGyiunndbi2omofg83J4UBq_2HPfmsyWwA3tGTLEENA6r8M1FPxa_$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Hi again,
I ended up with upgrading MAMP with mySQL to latest version on both computers which resolved the initial problem.
However, now I have another issue..
SimpleSearch only returns hits if search is made from pages without subpages as seen in dump below.
If search is made when on a subpage SimpleSearch seems to search for a resource in the parent of that subpage and not the actual searchresults page (id 46) which is in the root.
Does SimpleSearch only work in sites that doesn't have subpages or is there a way to fix this?
Search made from page without subpage:
![search1](https://user-images.githubusercontent.com/89969167/195538647-1f7ba88a-094e-4784-bf10-f5a73712cb2c.png)
Search made from page with subpage:
![search2](https://user-images.githubusercontent.com/89969167/195538657-d1b3b084-265a-43dd-bc50-a7ca31a93c95.png)
Resource tree in manager:
![search3](https://user-images.githubusercontent.com/89969167/195538667-d5ddd695-4667-4c69-a6b1-a2393ac564f2.png)
…________________________________
Från: halftrainedharry ***@***.***>
Skickat: den 12 oktober 2022 09:56
Till: modxcms/SimpleSearch ***@***.***>
Kopia: Bo Lovenhjelm ***@***.***>; Author ***@***.***>
Ämne: Re: [modxcms/SimpleSearch] SimpleSearch breaks website after server migration (Issue #54)
Check the system setting "simplesearch. driver_class". Make sure the value is \SimpleSearch\Driver\SimpleSearchDriverBasic. If this doesn't solve the problem then please check the PHP error log. An exact error message (where and why the error
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Check the system setting "simplesearch.driver_class". Make sure the value is \SimpleSearch\Driver\SimpleSearchDriverBasic.
________________________________
If this doesn't solve the problem then please check the PHP error log. An exact error message (where and why the error occurred) would help a lot to solve the issue.
If you are unsure where the PHP error log is located, take a look at the config file "php.ini". Probably the setting error_log. (Maybe also check the values of other settings like log_errors, display_errors, error_reporting.)
—
Reply to this email directly, view it on GitHub [github.com]<https://urldefense.com/v3/__https://github.com/modxcms/SimpleSearch/issues/54*issuecomment-1275746448__;Iw!!HMLeYTom!EecQ7DExXopRcl2BXr9oqB4qtSrS_sLsNhwv3xwzGyiunndbi2omofg83J4UBq_2HPfmsyWwA3tGTLEENA6r8CZA66tw$>, or unsubscribe [github.com]<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AVONED6L4K6JZMUCDMUZWYLWCZVJRANCNFSM6AAAAAARCHFLRI__;!!HMLeYTom!EecQ7DExXopRcl2BXr9oqB4qtSrS_sLsNhwv3xwzGyiunndbi2omofg83J4UBq_2HPfmsyWwA3tGTLEENA6r8M1FPxa_$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
![search1](https://user-images.githubusercontent.com/89969167/195538647-1f7ba88a-094e-4784-bf10-f5a73712cb2c.png)
![search2](https://user-images.githubusercontent.com/89969167/195538657-d1b3b084-265a-43dd-bc50-a7ca31a93c95.png)
![search3](https://user-images.githubusercontent.com/89969167/195538667-d5ddd695-4667-4c69-a6b1-a2393ac564f2.png)
|
I don't quite understand what your setup is. Do you show the search form on every page SimpleSearch should always search the whole website (all resources) unless you define a property like |
yes, thst is exactly right.
I have the search form included on every page via the menu and the results page is 46.
it only finds theresulys page with id 46 from pages that is not subpages. From a subpage it searches from subpage it just ads id 46 to the end of the url and doesn't render hits on the results page.
Hämta Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: halftrainedharry ***@***.***>
Sent: Thursday, October 13, 2022 11:40:10 AM
To: modxcms/SimpleSearch ***@***.***>
Cc: Bo Lovenhjelm ***@***.***>; Author ***@***.***>
Subject: Re: [modxcms/SimpleSearch] SimpleSearch breaks website after server migration (Issue #54)
I don't quite understand what your setup is. Do you show the search form on every page [[!SimpleSearchForm? &landing=`46`]] and then on page 46 you display the search results [[!SimpleSearch]]? SimpleSearch should always search the whole
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
I don't quite understand what your setup is.
Do you show the search form on every page [[!SimpleSearchForm? &landing=`46`]] and then on page 46 you display the search results [[!SimpleSearch]]?
SimpleSearch should always search the whole website (all resources) unless you define a property like &ids in your snippet call.
—
Reply to this email directly, view it on GitHub [github.com]<https://urldefense.com/v3/__https://github.com/modxcms/SimpleSearch/issues/54*issuecomment-1277330609__;Iw!!HMLeYTom!BlQyEaECWMo0-h_6t7oQK_lLHYVK_xzPdYa5loN4zFfzOOzpFMSrw7HvkskY5vXbqkCetgm9Ug8EgUHl6X_mywhdd-sp$>, or unsubscribe [github.com]<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AVONED7QKR6MELUSMFUK5JTWC7KHVANCNFSM6AAAAAARCHFLRI__;!!HMLeYTom!BlQyEaECWMo0-h_6t7oQK_lLHYVK_xzPdYa5loN4zFfzOOzpFMSrw7HvkskY5vXbqkCetgm9Ug8EgUHl6X_my5px9wL-$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
What is the value of the action attribute in your form? This should be the same for every page and subpage.
What is the value of the action attribute in your template chunk?
|
Form action:
<form class="simplesearch-search-form" action="[[~[[+landing]]]]" method="[[+method]]">
Template:
[[!SimpleSearchForm? &landing=`46`]]
…________________________________
Från: halftrainedharry ***@***.***>
Skickat: den 13 oktober 2022 12:16
Till: modxcms/SimpleSearch ***@***.***>
Kopia: Bo Lovenhjelm ***@***.***>; Author ***@***.***>
Ämne: Re: [modxcms/SimpleSearch] SimpleSearch breaks website after server migration (Issue #54)
it only finds theresulys page with id 46 from pages that is not subpages. What is the value of the action parameter in your form? This should be the same for every page and subpage. <form class="simplesearch-search-form" action="searchresultspage. html"
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
it only finds theresulys page with id 46 from pages that is not subpages.
What is the value of the action parameter in your form? This should be the same for every page and subpage.
<form class="simplesearch-search-form" action="searchresultspage.html" method="get">
What is the value of the action parameter in your template?
<form class="simplesearch-search-form" action="[[~[[+landing]]]]" method="[[+method]]">
—
Reply to this email directly, view it on GitHub [github.com]<https://urldefense.com/v3/__https://github.com/modxcms/SimpleSearch/issues/54*issuecomment-1277375916__;Iw!!HMLeYTom!DaOCQJpF503CMKHUlOjqejERHl87uW4eLLaojuTDwuJd4FrcJrpundqZBq7e5_WLx7ZmuBf-W83PktgvPYBVLu_eHH4U$>, or unsubscribe [github.com]<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AVONED3YDTOS6PALESL34UTWC7ORRANCNFSM6AAAAAARCHFLRI__;!!HMLeYTom!DaOCQJpF503CMKHUlOjqejERHl87uW4eLLaojuTDwuJd4FrcJrpundqZBq7e5_WLx7ZmuBf-W83PktgvPYBVLnjG-eCT$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
But what is the actual value that is shown in the source code for the action attribute on your subpage? What is the "Resource Alias" of your search-results-page? (On the screenshot this page seems to be unpublished. It should be published to be publicly accessible.) The id parameter in the form |
The actual value in the source code for the action attribute on your subpage is 46.
The resource alias is: sökresultat - the same as the title.
It is published but hidden from menus.
So which id-parameter should be used for friendly urls?
…________________________________
Från: halftrainedharry ***@***.***>
Skickat: den 13 oktober 2022 12:46
Till: modxcms/SimpleSearch ***@***.***>
Kopia: Bo Lovenhjelm ***@***.***>; Author ***@***.***>
Ämne: Re: [modxcms/SimpleSearch] SimpleSearch breaks website after server migration (Issue #54)
But what is the actual value that is shown in the source code for the action attribute on your subpage? What is the "Resource Alias" of your search-results-page? (On the screenshot this page seems to be unpublished. It should be published to
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
But what is the actual value that is shown in the source code for the action attribute on your subpage?
What is the "Resource Alias" of your search-results-page? (On the screenshot this page seems to be unpublished. It should be published to be publicly accessible.)
The id parameter in the form <input type="hidden" name="id" value="[[+landing]]" /> is irrelevant if friendly-urls are used (which seems to be the case).
—
Reply to this email directly, view it on GitHub [github.com]<https://urldefense.com/v3/__https://github.com/modxcms/SimpleSearch/issues/54*issuecomment-1277412508__;Iw!!HMLeYTom!B5JnpaWtK8DchIC5KgViQVqCoQItXAtJQGLGlT-YLnLlfCxUalCIM3dbps5KHLK8EiWGR8ewHt7WRfz6fPDKcimGDRlO$>, or unsubscribe [github.com]<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AVONED46N54BNY4AJBYDDVLWC7R75ANCNFSM6AAAAAARCHFLRI__;!!HMLeYTom!B5JnpaWtK8DchIC5KgViQVqCoQItXAtJQGLGlT-YLnLlfCxUalCIM3dbps5KHLK8EiWGR8ewHt7WRfz6fPDKcoZ5oj2H$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
And the rendered value in source code on every page when search is made is:
<form class="simplesearch-search-form" action="sökresultat/" method="get">
//Bosse
Bo Lovenhjelm
[signature_3209181915]
Frontend Developer
[signature_3514940998]
Direct: +46 433 27 30 38
NIBE AB NIBE Energy Systems
Switchboard: +46 433 27 30 00
nibe.se<https://www.nibe.se> | nibe.eu<https://www.nibe.eu> | nibe.com<https://www.nibe.com>
NIBE AB behandlar dina personuppgifter enligt: nibe.se/integritetspolicy<https://www.nibe.eu/sv-se/om-nibe/integritetspolicy>
NIBE AB process your personal information according to: nibe.eu/privacypolicy<https://nibe.eu/privacypolicy>
***@***.***
Sedan 1952 har NIBE tillverkat energieffektiva klimatiseringslösningar för hem och större fastigheter.
Allt startade i småländska Markaryd och idag är vi ett internationellt innovationsföretag som fyller 70 år.
Vi arbetar ständigt med att skapa nytta för våra kunder och bidrar till att allt fler kan leva mer hållbart.
Från: halftrainedharry ***@***.***>
Datum: torsdag, 13 oktober 2022 12:46
Till: modxcms/SimpleSearch ***@***.***>
Kopia: Bo Lovenhjelm ***@***.***>, Author ***@***.***>
Ämne: Re: [modxcms/SimpleSearch] SimpleSearch breaks website after server migration (Issue #54)
But what is the actual value that is shown in the source code for the action attribute on your subpage? What is the "Resource Alias" of your search-results-page? (On the screenshot this page seems to be unpublished. It should be published to
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
But what is the actual value that is shown in the source code for the action attribute on your subpage?
What is the "Resource Alias" of your search-results-page? (On the screenshot this page seems to be unpublished. It should be published to be publicly accessible.)
The id parameter in the form <input type="hidden" name="id" value="[[+landing]]" /> is irrelevant if friendly-urls are used (which seems to be the case).
—
Reply to this email directly, view it on GitHub [github.com]<https://urldefense.com/v3/__https:/github.com/modxcms/SimpleSearch/issues/54*issuecomment-1277412508__;Iw!!HMLeYTom!B5JnpaWtK8DchIC5KgViQVqCoQItXAtJQGLGlT-YLnLlfCxUalCIM3dbps5KHLK8EiWGR8ewHt7WRfz6fPDKcimGDRlO$>, or unsubscribe [github.com]<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AVONED46N54BNY4AJBYDDVLWC7R75ANCNFSM6AAAAAARCHFLRI__;!!HMLeYTom!B5JnpaWtK8DchIC5KgViQVqCoQItXAtJQGLGlT-YLnLlfCxUalCIM3dbps5KHLK8EiWGR8ewHt7WRfz6fPDKcoZ5oj2H$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
So when you submit the search form, there is a html-request to Why wouldn't this work on a subpage? Maybe the On your screenshot above ("4 results found ...") why is there no |
Well.. I have at setup on my localhost via latest MAMP 6.6. I've enabled Friendly URLs and every page has the same base URL The SimpleSearch chunk "SearchForm" has the form:
No changes has been made to the snippets "SimpleSearch" or "SimpleSearchForm". My search form has the code:
If search for the term "bygg" is made from the start page (http://localhost/bootstrap/), the search results are displayed on the results page as expected.
If search is made from another page, for example: http://localhost/bootstrap/om-oss/, the search is made but SimpleSearch seems to look for the results page in the wrong place and the results page is not displayed with the results. The rendered form code on this page is the same as above:
SimpleSearch makes the search but tries to render the results on the "om-oss" page though with the right id "46". Hence search made from root of site renders the search results via the intended resource with ID "46". Search made from any other page tries to render the search results on the page search i made from via the intended resource with ID "46". I can't seem to figure out a solution to this problem. If you'd like, I could make a migration file zip and mail a link to file via Sprend so you can install the whole site and see for yourself. //Bo |
Something is wrong with your friendly URLs. When you navigate in the manager to the "Sökresultat" resource and click the "View" button (in the top right corner), what is the URL? It should be Now if you manually add a "search" parameter to the URL ( If nothing else works, maybe try hard-coding the "Sökresultat" URL in the search form. If the URL of the "Sökresultat" is wrong, check the database table
This URL is wrong. It should be The fact that it works is more a coincidence. When friendly URLs are not enabled, the URL of a page is When friendly URLs are enabled the id parameter is generally ignored ( But you can't call |
When I navigate in the manager to the "Sökresultat" resource and click the "View" button (in the top right corner), the URL is http://localhost/bootstrap/sokresultat/
Yes, when I manually add the search string to above URL as: http://localhost/bootstrap/sokresultat/?search=bygg the “right” page renders the results as intended.
Can you give me an example of how hard coding the "Sökresultat" URL in the search form would look like in the form below?
<form class="simplesearch-search-form" action="[[~[[+landing]]]]" method="[[+method]]">
<fieldset>
<label for="[[+searchIndex]]">[[%simplesearch.search? &namespace=`simplesearch` &topic=`default`]]</label>
<input type="search" name="[[+searchIndex]]" id="[[+searchIndex]]" value="[[+searchValue]]" />
<input type="hidden" name="id" value="[[+landing]]" />
<input type="submit" value="[[%simplesearch.search? &namespace=`simplesearch` &topic=`default`]]" />
</fieldset>
</form>
//Bosse
Bo Lovenhjelm
[signature_813729974]
Frontend Developer
[signature_3335593295]
Direct: +46 433 27 30 38
NIBE AB NIBE Energy Systems
Switchboard: +46 433 27 30 00
nibe.se<https://www.nibe.se> | nibe.eu<https://www.nibe.eu> | nibe.com<https://www.nibe.com>
NIBE AB behandlar dina personuppgifter enligt: nibe.se/integritetspolicy<https://www.nibe.eu/sv-se/om-nibe/integritetspolicy>
NIBE AB process your personal information according to: nibe.eu/privacypolicy<https://nibe.eu/privacypolicy>
***@***.***
Sedan 1952 har NIBE tillverkat energieffektiva klimatiseringslösningar för hem och större fastigheter.
Allt startade i småländska Markaryd och idag är vi ett internationellt innovationsföretag som fyller 70 år.
Vi arbetar ständigt med att skapa nytta för våra kunder och bidrar till att allt fler kan leva mer hållbart.
Från: halftrainedharry ***@***.***>
Datum: måndag, 17 oktober 2022 10:01
Till: modxcms/SimpleSearch ***@***.***>
Kopia: Bo Lovenhjelm ***@***.***>, Author ***@***.***>
Ämne: Re: [modxcms/SimpleSearch] SimpleSearch breaks website after server migration (Issue #54)
Something is wrong with your friendly URLs. When you navigate in the manager to the "Sökresultat" resource and click the "View" button (in the top right corner), what is the URL? It should be http: //localhost/bootstrap/sokresultat [localhost]
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
ZjQcmQRYFpfptBannerEnd
Something is wrong with your friendly URLs.
When you navigate in the manager to the "Sökresultat" resource and click the "View" button (in the top right corner), what is the URL? It should be http://localhost/bootstrap/sokresultat [localhost]<https://urldefense.com/v3/__http:/localhost/bootstrap/sokresultat__;!!HMLeYTom!Bza9DgkwvAWxvD8cI0COz_6KFe4A8QnbgTN3NSOUkTTYMQcEvTPP8xNMO2dMNmaz_um5WJCeG-kdyvMJth7K-U_cy6Rn$> (or maybe http://localhost/bootstrap/sokresultat.html [localhost]<https://urldefense.com/v3/__http:/localhost/bootstrap/sokresultat.html__;!!HMLeYTom!Bza9DgkwvAWxvD8cI0COz_6KFe4A8QnbgTN3NSOUkTTYMQcEvTPP8xNMO2dMNmaz_um5WJCeG-kdyvMJth7K-QmsKuLG$>).
Now if you manually add a "search" parameter to the URL (http://localhost/bootstrap/sokresultat?search=test [localhost]<https://urldefense.com/v3/__http:/localhost/bootstrap/sokresultat?search=test__;!!HMLeYTom!Bza9DgkwvAWxvD8cI0COz_6KFe4A8QnbgTN3NSOUkTTYMQcEvTPP8xNMO2dMNmaz_um5WJCeG-kdyvMJth7K-Yi3eXnl$>) you should see the search results. This is all the search form has to do. Navigate to the "Sökresultat" page and provide a search string.
If nothing else works, maybe try hard-coding the "Sökresultat" URL in the search form.
If the URL of the "Sökresultat" is wrong, check the database table modx_site_content (columns "uri" and "alias") or try "Manage" -> "Clear Cache" -> "Refresh URIs".
…________________________________
The URL shown in this case is: http://localhost/bootstrap/?search=bygg&id=46 [localhost]<https://urldefense.com/v3/__http:/localhost/bootstrap/?search=bygg&id=46__;!!HMLeYTom!Bza9DgkwvAWxvD8cI0COz_6KFe4A8QnbgTN3NSOUkTTYMQcEvTPP8xNMO2dMNmaz_um5WJCeG-kdyvMJth7K-aaNxL54$>
This URL is wrong. It should be http://localhost/bootstrap/sokresultat?search=bygg [localhost]<https://urldefense.com/v3/__http:/localhost/bootstrap/sokresultat?search=bygg__;!!HMLeYTom!Bza9DgkwvAWxvD8cI0COz_6KFe4A8QnbgTN3NSOUkTTYMQcEvTPP8xNMO2dMNmaz_um5WJCeG-kdyvMJth7K-Qrm6FJE$> (or http://localhost/bootstrap/sokresultat?search=bygg&id=46 [localhost]<https://urldefense.com/v3/__http:/localhost/bootstrap/sokresultat?search=bygg&id=46__;!!HMLeYTom!Bza9DgkwvAWxvD8cI0COz_6KFe4A8QnbgTN3NSOUkTTYMQcEvTPP8xNMO2dMNmaz_um5WJCeG-kdyvMJth7K-RSLdpeg$>)
The fact that it works is more a coincidence. When friendly URLs are not enabled, the URL of a page is http://localhost/bootstrap/index.php?id=46 [localhost]<https://urldefense.com/v3/__http:/localhost/bootstrap/index.php?id=46__;!!HMLeYTom!Bza9DgkwvAWxvD8cI0COz_6KFe4A8QnbgTN3NSOUkTTYMQcEvTPP8xNMO2dMNmaz_um5WJCeG-kdyvMJth7K-duv9ZGi$> (http://localhost/bootstrap?id=46 [localhost]<https://urldefense.com/v3/__http:/localhost/bootstrap?id=46__;!!HMLeYTom!Bza9DgkwvAWxvD8cI0COz_6KFe4A8QnbgTN3NSOUkTTYMQcEvTPP8xNMO2dMNmaz_um5WJCeG-kdyvMJth7K-QR24lRu$> also works because index.php is the default file).
When friendly URLs are enabled the id parameter is generally ignored (?id=46), but it is still possible to request a page per id ( http://localhost/bootstrap/index.php?id=46 [localhost]<https://urldefense.com/v3/__http:/localhost/bootstrap/index.php?id=46__;!!HMLeYTom!Bza9DgkwvAWxvD8cI0COz_6KFe4A8QnbgTN3NSOUkTTYMQcEvTPP8xNMO2dMNmaz_um5WJCeG-kdyvMJth7K-duv9ZGi$>) unless the system setting request_method_strict is set to Yes.
But you can't call http://localhost/bootstrap/om-oss/?id=46 [localhost]<https://urldefense.com/v3/__http:/localhost/bootstrap/om-oss/?id=46__;!!HMLeYTom!Bza9DgkwvAWxvD8cI0COz_6KFe4A8QnbgTN3NSOUkTTYMQcEvTPP8xNMO2dMNmaz_um5WJCeG-kdyvMJth7K-fV8a66s$>. There exists no index.php file in an om-oss folder! om-oss is used to load the corresponding resource and ?id=46 is ignored.
—
Reply to this email directly, view it on GitHub [github.com]<https://urldefense.com/v3/__https:/github.com/modxcms/SimpleSearch/issues/54*issuecomment-1280446496__;Iw!!HMLeYTom!Bza9DgkwvAWxvD8cI0COz_6KFe4A8QnbgTN3NSOUkTTYMQcEvTPP8xNMO2dMNmaz_um5WJCeG-kdyvMJth7K-fBqnYF_$>, or unsubscribe [github.com]<https://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AVONED63H7AO75NCVWLC25LWDUBWVANCNFSM6AAAAAARCHFLRI__;!!HMLeYTom!Bza9DgkwvAWxvD8cI0COz_6KFe4A8QnbgTN3NSOUkTTYMQcEvTPP8xNMO2dMNmaz_um5WJCeG-kdyvMJth7K-Zx05861$>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Just add the URL to the action attribute Or maybe this works as well: |
Tried both:
And:
Makes no difference at all so same disapointing results as before, only on start page and if I make a search from the results page rendered from search made on start page works... Else is: http://localhost/bootstrap/byggtjanster/snickeri/?search=bygg&id=46 as an example. |
I don't get it! If an absolute URL is in the form ( Are you sure you used the changed search-form-chunk? If you add this directly into the page content, does that work?
Does a simple link tag work?
|
Both adding the form manually to a page and adding the link-tag works. As you can see the code is also in the "SearchForm" chunk, but that affects nothing. |
Duplicate the chunk, give it another name (e.g. "mySearchForm") and then add a
|
Did that and tried 3 different ways in new chunk:
So when I either search from the index ro add the tag-link or your search form directly to a page it renders results and URL is: http://localhost/bootstrap/sokresultat/?search=bygg When I make a search from any other page there is no results and the URL is: http://localhost/bootstrap/om-oss/?search=bygg&id=46 |
As I see it there is only one difference: |
So what is the difference between the hard-coded form
and the output from "mySearchForm"? Maybe the or just put the hard-coded form in a chunk and use that (and don't use |
The output from "mySearchForm" when using standard setup is:
When using alternativ 2 the output is:
When using alternativ 3 the output is:
Tried deleting the line: When replacing standard form in mySearchForm chunk with:
Nothing happens, though it works when inserted directly on the page. So, for example I've put both the form and the tag-link directly on a certain page and the search results page shows. |
Is there any Javascript code on your page that may interfere? |
Well, there are som scripts but none of them rewrites links in any way. I'm really mindf**d by this issue as I really can't figure out a working solution and delivery of webpage is delayed.. :( |
No, I don't want that. And maybe (temporarily) disable javascript in the browser, just to make sure that no javascript code interferes. |
I've "solved" the matter by removing the search form from linked in slide-in modal in main menu and creating a search page with the form directly on that page. Not as elegant but it works. |
Now, I have a site developed locally that van't go live with a functional search.
The text was updated successfully, but these errors were encountered: