Issue with apostrophe in "search by text" field
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page pleaseIf you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
Quote from damir_rdk on December 18, 2020, 19:32Hi,
When I search for existing product by the title which contains apostrophe, such as “Egyptian Daisy’s”, there will be no results, and the text in the search field will be switched to “Egyptian Daisy\’s” – \ will be added before apostrophe.
When I search for any other product without apostrophe in its title, results are fine.
I've tried these solutions, but without luck:
https://wordpress.org/support/topic/search-by-text-filter-doesnt-work-with-apostrophes/
and
https://wordpress.org/support/topic/apostrophe-in-title-label/Can you please help?
To replicate the issue, you need to be logged in - details sent in private data popup.
Thank you very much!
Damir
Hi,
When I search for existing product by the title which contains apostrophe, such as “Egyptian Daisy’s”, there will be no results, and the text in the search field will be switched to “Egyptian Daisy\’s” – \ will be added before apostrophe.
When I search for any other product without apostrophe in its title, results are fine.
I've tried these solutions, but without luck:
https://wordpress.org/support/topic/search-by-text-filter-doesnt-work-with-apostrophes/
and
https://wordpress.org/support/topic/apostrophe-in-title-label/
Can you please help?
To replicate the issue, you need to be logged in - details sent in private data popup.
Thank you very much!
Damir
Quote from Pablo Borysenco on December 21, 2020, 13:58Hello Damir
Ok! Please add FTP access( https://c2n.me/43SC6rb.png ->https://c2n.me/42BAoj4.png) I will fix it
Hello Damir
Ok! Please add FTP access( https://c2n.me/43SC6rb.png ->https://c2n.me/42BAoj4.png) I will fix it
Quote from damir_rdk on December 21, 2020, 22:12Hi Pablo, thanks for your reply.
Unfortunately this website is hosted on some kind of AWS instance where FTP is not allowed.
Can you try to explain what do I need to change? I am a developer as well, so I can do the changes myself, if you can explain it here.I didn't want to change plugin files so the changes doesn't disappear after the plugin update, and I couldn't figure out how to fix it from the theme / functions.php file.
Hi Pablo, thanks for your reply.
Unfortunately this website is hosted on some kind of AWS instance where FTP is not allowed.
Can you try to explain what do I need to change? I am a developer as well, so I can do the changes myself, if you can explain it here.
I didn't want to change plugin files so the changes doesn't disappear after the plugin update, and I couldn't figure out how to fix it from the theme / functions.php file.
Quote from Pablo Borysenco on December 22, 2020, 16:31Hello
Ok! In file - \wp-content\plugins\woocommerce-products-filter\ext\by_text\index.php - change these lines - https://c2n.me/4akpwvc.png
$woof_text = stripslashes($woof_text);
$woof_text = str_replace("'", "\'", $woof_text);
Hello
Ok! In file - \wp-content\plugins\woocommerce-products-filter\ext\by_text\index.php - change these lines - https://c2n.me/4akpwvc.png
$woof_text = stripslashes($woof_text);
$woof_text = str_replace("'","\'", $woof_text);
Quote from damir_rdk on December 23, 2020, 00:10Hi Pablo,
I've added both lines but unfortunately your code doesn't seem to help. I'm not sure if I understand it correctly - I see you remove slash in the first line, but you are adding it back in the next line?
I also tried this variant:
KEPT THIS: $woof_text = stripslashes($woof_text);
REMOVED THIS: $woof_text = str_replace("'", "\'", $woof_text);
But without luck.But, I've figured out that the slash is not being added when I turn off the "Autocomplete" option. Does this helps?
Thank you,
Damir
Hi Pablo,
I've added both lines but unfortunately your code doesn't seem to help. I'm not sure if I understand it correctly - I see you remove slash in the first line, but you are adding it back in the next line?
I also tried this variant:
KEPT THIS: $woof_text = stripslashes($woof_text);
REMOVED THIS: $woof_text = str_replace("'","\'", $woof_text);
But without luck.
But, I've figured out that the slash is not being added when I turn off the"Autocomplete" option. Does this helps?
Thank you,
Damir
Quote from Pablo Borysenco on December 23, 2020, 13:21Hello Damir
Drop me a screenshot of this file with your changes
Hello Damir
Drop me a screenshot of this file with your changes
Quote from damir_rdk on December 23, 2020, 23:21Hi Pablo,
I've copied the website locally, where I already have the first local version of website, on which I am doing testings. So now I have two versions locally, on the same configuration, server, platform.
First one (old) work normally, while the second one (new, the one I've created from the live site backup) is not working.
This seems like encoding issue, because plugin versions are the same, and I also tried deactivating all other plugins in order to see if some of them is making a conflict. Please see screenshots:
First local website: https://salondart.org/wp-content/uploads/salon1.png
Second local website: https://salondart.org/wp-content/uploads/salon2.pngDoes this help?
Database encoding and tables encoding seems the same as well. Can you suggest what else I can check?
P.s. screenshot of how I edited the file (I've reverted it back):
https://salondart.org/wp-content/uploads/edit.png
Hi Pablo,
I've copied the website locally, where I already have the first local version of website, on which I am doing testings. So now I have two versions locally, on the same configuration, server, platform.
First one (old) work normally, while the second one (new, the one I've created from the live site backup) is not working.
This seems like encoding issue, because plugin versions are the same, and I also tried deactivating all other plugins in order to see if some of them is making a conflict. Please see screenshots:
First local website: https://salondart.org/wp-content/uploads/salon1.png
Second local website: https://salondart.org/wp-content/uploads/salon2.png
Does this help?
Database encoding and tables encoding seems the same as well. Can you suggest what else I can check?
P.s. screenshot of how I edited the file (I've reverted it back):
https://salondart.org/wp-content/uploads/edit.png
Quote from Pablo Borysenco on December 24, 2020, 13:39Hello
You edited the code incorrectly. This is my fault (formatting the message).
please check this screenshot and do the same code - https://c2n.me/4akpwvc.png
Your screenshot - https://clip2net.com/s/4am2qLb
Hello
You edited the code incorrectly. This is my fault (formatting the message).
please check this screenshot and do the same code - https://c2n.me/4akpwvc.png
Your screenshot - https://clip2net.com/s/4am2qLb
Quote from damir_rdk on December 24, 2020, 17:18Hi Pablo,
Yes, I already tried that as well. It's not working.
I also tried to do a simple, obvious str_replace (replace "Da" with "Ne"), outside the if statement, it's also not working...
Please see screenshot:
https://salondart.org/wp-content/uploads/edit2.pngKeep in mind "autocomplete" option is enabled for this field.
Hi Pablo,
Yes, I already tried that as well. It's not working.
I also tried to do a simple, obvious str_replace (replace"Da" with"Ne"), outside the if statement, it's also not working...
Please see screenshot:
https://salondart.org/wp-content/uploads/edit2.png
Keep in mind"autocomplete" option is enabled for this field.
Quote from Pablo Borysenco on December 25, 2020, 10:28Hello
Please check this screenshot - https://c2n.me/4akpwvc.png please change your code - https://c2n.me/4amEPSj.png
Hello
Please check this screenshot - https://c2n.me/4akpwvc.png please change your code - https://c2n.me/4amEPSj.png
Quote from damir_rdk on December 25, 2020, 11:43Hi Pablo,
Sorry, I've corrected my code, but it still doesn't work.
I've also tried to correct the code here, in the ELSE part of the statement, because I'm not sure if the woo_text_search_like_option is enabled or not, but without luck (reverted it back):
Also, please note my statement from the previous comment - I've tried to do a simple, obvious str_replace() even before this IF statement, but it didn't work.
I am clearing cache manually before each try (deleting the cache folder from the server), and clearing browser cache as well.
Hi Pablo,
Sorry, I've corrected my code, but it still doesn't work.

I've also tried to correct the code here, in the ELSE part of the statement, because I'm not sure if the woo_text_search_like_option is enabled or not, but without luck (reverted it back):

Also, please note my statement from the previous comment - I've tried to do a simple, obvious str_replace() even before this IF statement, but it didn't work.
I am clearing cache manually before each try (deleting the cache folder from the server), and clearing browser cache as well.
Quote from Pablo Borysenco on December 25, 2020, 13:14In this case I need FTP access to your test site
In this case I need FTP access to your test site
Quote from damir_rdk on January 19, 2021, 22:51Hi Pablo,
Unfortunately I didn't got approval from the client to provide access for the website.
If you would like me to share screen and follow your instructions, we can do that.
Otherwise you can close the ticket and thank you very much for your willing to help.
Regards,
Damir
Hi Pablo,
Unfortunately I didn't got approval from the client to provide access for the website.
If you would like me to share screen and follow your instructions, we can do that.
Otherwise you can close the ticket and thank you very much for your willing to help.
Regards,
Damir
Quote from Pablo Borysenco on January 20, 2021, 12:56Hello Damir
In this case just replace this file - \wp-content\plugins\woocommerce-products-filter\ext\by_text\index.php
New file - https://drive.google.com/file/d/1D1RlxaQ9TZqn65dV2bK0ktiPL9wsOi7K/view?usp=sharing
Hello Damir
In this case just replace this file - \wp-content\plugins\woocommerce-products-filter\ext\by_text\index.php
New file - https://drive.google.com/file/d/1D1RlxaQ9TZqn65dV2bK0ktiPL9wsOi7K/view?usp=sharing
Quote from damir_rdk on January 20, 2021, 13:30Hi Pablo,
I've replaced the file, but unfortunately this didn't help.
Please note that we have changed the "by text" search to consider only the excerpt field content. Maybe it's behaving unexpected because of this.
Also, I have an older backup of the website, and the search by text works fine on it. In the meantime we exported and imported products etc. Maybe DB/tables encoding was changed during this process.
Regards,
Damir
Hi Pablo,
I've replaced the file, but unfortunately this didn't help.
Please note that we have changed the"by text" search to consider only the excerpt field content. Maybe it's behaving unexpected because of this.
Also, I have an older backup of the website, and the search by text works fine on it. In the meantime we exported and imported products etc. Maybe DB/tables encoding was changed during this process.
Regards,
Damir
Quote from Pablo Borysenco on January 21, 2021, 11:35Hello Damir
Maybe it's behaving unexpected because of this. - it cannot affect such a problem
Unfortunately I have no more ideas
Hello Damir
Maybe it's behaving unexpected because of this. - it cannot affect such a problem
Unfortunately I have no more ideas
Quote from damir_rdk on January 21, 2021, 11:43Yeah, I understand.
Thank you very much for your willing to help!
Yeah, I understand.
Thank you very much for your willing to help!
Quote from damir_rdk on February 3, 2021, 12:46Hi Pablo,
Just wanted to give it another try.
I have two versions of the website locally - working (old) and non-working one.
I noticed apostrophes are saved in different way in these two databases:Working (old site, my local installation):
Not working (live site):
Does this maybe can help you?
When I use the old database on the current live site, the issue with apostrophe is gone.
Keep in mind our "search by text" is configured to search only through "excerpt" field.
Hi Pablo,
Just wanted to give it another try.
I have two versions of the website locally - working (old) and non-working one.
I noticed apostrophes are saved in different way in these two databases:
Working (old site, my local installation):

Not working (live site):

Does this maybe can help you?
When I use the old database on the current live site, the issue with apostrophe is gone.
Keep in mind our"search by text" is configured to search only through"excerpt" field.
Quote from damir_rdk on February 4, 2021, 12:32Another thing Pablo - we agreed with client that we will create a staging / testing environment for you to take a look at this.
Can you please confirm you are still willing to take a look, so we can start creating it?
Thank you!
Another thing Pablo - we agreed with client that we will create a staging / testing environment for you to take a look at this.
Can you please confirm you are still willing to take a look, so we can start creating it?
Thank you!