? Success

User tests: Successful: Unsuccessful:

avatar chrisdavenport
chrisdavenport
15 Apr 2016

This PR avoids the mb_strpos empty delimiter warning that can occur when "Allow Empty Search" is used and no search term is entered.

Summary of Changes

The default Smart Search layout does not check for an empty search term before calling JString::strpos, which ultimately leads to a warning being thrown in mb_strpos.

Testing Instructions

  • Make sure you have Smart Search set up and working with some content indexed.
  • Add a menu item to point to the Smart Search results page. Set "Allow Empty Search" to "Yes" in the menu item (setting this at global level doesn't produce the error (not sure why)).
  • Set "Error Reporting" to "Development" in Global Configuration.
  • Use your menu item to go to the search page.
  • Use Advanced Search to select something from a dropdown. For example, choose "Uncategorised" from the "Category" dropdown.
  • Without entering any search terms, click the Search button. You should see an error message like "Warning: mb_strpos(): Empty delimiter in /var/www/temp/joomla-mb-strpos/libraries/vendor/joomla/string/src/phputf8/mbstring/core.php on line 41"
  • Apply this PR and try searching again. The warning message should no longer appear.
avatar chrisdavenport chrisdavenport - open - 15 Apr 2016
avatar chrisdavenport chrisdavenport - change - 15 Apr 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 15 Apr 2016
Labels Added: ?
avatar richard67 richard67 - test_item - 15 Apr 2016 - Tested successfully
avatar richard67
richard67 - comment - 15 Apr 2016

I have tested this item :white_check_mark: successfully on 4abdece


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9939.

avatar richard67
richard67 - comment - 15 Apr 2016

@chrisdavenport Do you have a test system with an old mysql database not supporting utf8mb4 yet, and a bit mood and time for testing? I urgently need some tester with such emvironment for my PR 9847 (not wanna use the hashtag here so it not gets linked because is unrelated to this here). Or do you know someone who could help with that?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9939.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 15 Apr 2016

@richard67 how to know if a database not support utf8mb4?

avatar richard67
richard67 - comment - 15 Apr 2016

@franz-wohlkoenig Either try in phpMyAdmin to set the database default collation to "utf8mb4_general_ci" - if it works, your combination of database server and client api used by phpMyAdmin supports utf8mb4, and if this does not work, it doesn't support it. And hope the client API used by phpMyAdmin is the same as the one used by the Joomla (which should be the case on a dedicated server or a local testing environment but may not be the case on shared hosting).

Or check in backend in system information your mysql database server version and which client api is used and its version.

If mysql server version is lower than 5.5.3, or mysqlnd client API with version lower than 5.0.9 is used, or other mysql client API with version lower than 5.5.3 is used, then there is no utf8mb4 support, esle there is.

avatar richard67
richard67 - comment - 15 Apr 2016

@franz-wohlkoenig P.S.: If further questions, lets discuss them in my PR 9847 in order not to hijack this here. Just pinged Chris here in his PR because I hoped he could help.

avatar chrisdavenport
chrisdavenport - comment - 15 Apr 2016

@richard67 Sorry, I don't have anything old enough to not support utf8mb4.

avatar richard67
richard67 - comment - 15 Apr 2016

No problem .. just wish me good luck someone will test then.

avatar chrisdavenport
chrisdavenport - comment - 15 Apr 2016

That I can do: Good luck. :-)

avatar brianteeman brianteeman - change - 16 Apr 2016
Category Search
avatar henkrijneveld henkrijneveld - test_item - 18 Apr 2016 - Tested successfully
avatar henkrijneveld
henkrijneveld - comment - 18 Apr 2016

I have tested this item :white_check_mark: successfully on 4abdece

Warning disappears. Suppose global level has no effect bc you cannot use "Use Global" with this parameter (bug?).


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9939.

avatar brianteeman brianteeman - change - 19 Apr 2016
Status Pending Ready to Commit
avatar brianteeman
brianteeman - comment - 19 Apr 2016

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9939.

avatar joomla-cms-bot joomla-cms-bot - change - 19 Apr 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 19 Apr 2016
Milestone Added:
avatar rdeutz rdeutz - change - 19 Apr 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-04-19 11:31:26
Closed_By rdeutz
avatar rdeutz rdeutz - close - 19 Apr 2016
avatar rdeutz rdeutz - reference | 6894106 - 19 Apr 16
avatar rdeutz rdeutz - merge - 19 Apr 2016
avatar rdeutz rdeutz - merge - 19 Apr 2016
avatar rdeutz rdeutz - close - 19 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - close - 19 Apr 2016
avatar joomla-cms-bot joomla-cms-bot - change - 19 Apr 2016
Labels Removed: ?
avatar chrisdavenport chrisdavenport - head_ref_deleted - 19 Apr 2016
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Added:
avatar rdeutz rdeutz - change - 1 May 2016
Milestone Removed:

Add a Comment

Login with GitHub to post a comment