?
avatar PhilETaylor
PhilETaylor
5 Jul 2020

Steps to reproduce the issue

This is a regression since Joomla 4.0.0 Beta 2 as beta 2 was working.

Install Joomal 4.0-dev
Login to super admin
Click Install next to Blog Sample Data
Click ok in JS popup
Click Components -> Smart Search -> Index
Click Index button
Click Menus -> + next to Main Menu
Click Select (Menu Item Type)
Click Smart Search
Click Search
Enter menu Title "Search"
Click Save and close

Go to front end and navigate to new menu Search item

Search for "blog"

Expected result

Search results!

Screenshot 2020-07-05 at 13 55 47

Actual result

Page refreshes, no search results, no refilled input box with search query

Screenshot 2020-07-05 at 13 54 37

System information (as much as possible)

PHP 7.4.7 Safari on Mac

Additional Information

Now go and hack your DOM and change the method="get" to method="post" in the search form and then click search - TADA!!!

However, it should, and was working with a GET request until recently.

avatar PhilETaylor PhilETaylor - open - 5 Jul 2020
avatar joomla-cms-bot joomla-cms-bot - change - 5 Jul 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Jul 2020
avatar PhilETaylor
PhilETaylor - comment - 5 Jul 2020

This is related to SEF Urls.

Disable SEF Urls and it works fine.

Therefore I'll offer up my nginx configuration (as per #29303) of

## Enable SEF URLs
# Joomla API application
location /api/ {
	try_files $uri $uri/ /api/index.php?\$args;
}
# Joomla public frontend application
location / {
	try_files $uri $uri/ /index.php?\$args;
}
## -- End
avatar PhilETaylor
PhilETaylor - comment - 5 Jul 2020

Tested with official Joomla 3 docker images (APACHE) (using Joomla 4.0-dev code) and it works as expected with and without SEF and with and without .htaccess, so this is a nginx specific issue...

avatar PhilETaylor
PhilETaylor - comment - 5 Jul 2020

Finally got to the bottom of this

ok this problem is with the nginx configuration provided by @nikosdion in #29303 - sorry Nic :)

When you have

/index.php?\$args

in your try_files in nginx location blocks and then go to a url of

http://127.0.0.1/index.php/search?q=blog

you get an Input object of

Screenshot 2020-07-05 at 14 46 18

as soon as I remove the \ I get the expected result input of the below and search works again.

Screenshot 2020-07-05 at 14 46 03

Therefore the problem is that the advice for nginx users in #29303 is slightly wrong :)

avatar PhilETaylor PhilETaylor - change - 5 Jul 2020
Title
[4.0][Release Blocker] Frontend search completely broken
[4.0] Frontend search completely broken
avatar PhilETaylor PhilETaylor - edited - 5 Jul 2020
avatar PhilETaylor
PhilETaylor - comment - 5 Jul 2020

Also going to post https://docs.joomla.org/Nginx here, as that documents nginx config with Joomla, and has no \ before the $args :)

avatar PhilETaylor PhilETaylor - change - 5 Jul 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-07-05 13:52:51
Closed_By PhilETaylor
avatar PhilETaylor
PhilETaylor - comment - 5 Jul 2020

Closing as nothing to "fix" per se because ultimately its just a typo in the advice given in #29303, if Nic can update that then people (like me) will not copy and paste the wrong thing again :)

avatar PhilETaylor PhilETaylor - close - 5 Jul 2020
avatar nikosdion
nikosdion - comment - 5 Jul 2020

@PhilETaylor Thanks for the heads up! I had copied the code from Admin Tools... forgetting that since it was a PHP heredoc I had escaped dollar signs. I updated the comment in #29303 by removing the backslashes. Can you please give it another try?

avatar PhilETaylor
PhilETaylor - comment - 5 Jul 2020

Without the slashes it works as expected and search works again as per the debug in #29985 (comment)

Thanks Nik - I just did not want others to fall over the same issue I had :)

avatar nikosdion
nikosdion - comment - 5 Jul 2020

No problem. I totally fat fingered that copy and paste ?

avatar PhilETaylor
PhilETaylor - comment - 5 Jul 2020

Could be worse, it could have been in the htaccess.txt and not in some Nginx config that not many people will use ;-)

/me goes hunting in the htaccess.txt next hahahaha

Add a Comment

Login with GitHub to post a comment