Osclass forums
Support forums => General help => Topic started by: abc500x500 on April 07, 2018, 10:42:28 pm
-
Hi.
I use Osclass 3.7.4 without permalink.
Custom fields can not search!!!
I see those work in oc.3.6.1 !
How can solve this problem?
thanks
-
For example we have a selection fields , when search that fileld in 3.7.4 it do not show true result but in 3.6.1 it show true result.
-
Enable permalinks for them to work.
I did not investigate why they don't work without permalinks.
-
Hi,
Try backporting public function extractParams($uri = '') from 3.6.1 as described here:
https://forums.osclass.org/themes-26/custom-fields-is-not-searching/msg152305/#msg152305
But there's still an issue with spaces and other characters, see this patch:
https://forums.osclass.org/themes-26/custom-fields-is-not-searching/msg160878/#msg160878
Regards
-
Hi,
Try backporting public function extractParams($uri = '') from 3.6.1 as described here:
https://forums.osclass.org/themes-26/custom-fields-is-not-searching/msg152305/#msg152305
But there's still an issue with spaces and other characters, see this patch:
https://forums.osclass.org/themes-26/custom-fields-is-not-searching/msg160878/#msg160878
Regards
Thanks teseo.
I do not want use permalinks.
are there solutions (2 link) for solving using permalinks or otherone ?
-
That solves the problem when permalinks aren't enabled.
Regards
-
From my experience that solution in the other thread regarding rewrite.php works, but only when I enter command line searches and like so - /index.php?page=search&meta[2]=query&sCategory=1 but does not work if I enter words in the custom search fields in sidebar.
-
Hi,
Try backporting public function extractParams($uri = '') from 3.6.1 as described here:
https://forums.osclass.org/themes-26/custom-fields-is-not-searching/msg152305/#msg152305
But there's still an issue with spaces and other characters, see this patch:
https://forums.osclass.org/themes-26/custom-fields-is-not-searching/msg160878/#msg160878
Regards
Hi teseo,
the links/topics seems to be removed. Can you repost this here? What kind of issue is it? Maybe there should be a PR made.
edit: I have done a quick test, it seems that custom fields are ignored/reset in search for some reason without permalinks. This is definitely a bug...
issue: https://github.com/osclass/Osclass/issues/2259
Thanks
dev101
-
@dev101, yes it is:)
I'm curious, why should someone use the site without permalinks?
-
I have updated issue @ github:
official fix:
https://github.com/osclass/Osclass/pull/2261/files
Please give it a test and see if this fixes the issue with CFs and permalinks off. Tested with Osclass 3.7.4 (latest version).
This is a preliminary solution, seems to be working fine on my end, but it needs to be revisited and approved by someone from Osclass Team (so keep that in mind).
I still don't know what is teseo's proposal about this, we can compare them and pick the best approach to fix this.
. . .
I'm curious, why should someone use the site without permalinks?
It does not really matter why, there could be various reasons, one being default mode after Osclass installation is good enough on it's own, permalinks add another layer of complexity (and are usually easier to become buggy).
edit: related recent forum topic: https://forums.osclass.org/general-help/osc_rewrite_enabled/
. . .
Regards
dev101
-
Hi teseo,
the links/topics seems to be removed. Can you repost this here? What kind of issue is it? Maybe there should be a PR made.
Hi,
Don't know why you can't see these messages, they are there... ???
Anyway, the messages are not mine, the first one recommended backport of 3.6.1 function, and the second one:
Hello everybody,
The change made solves the problem but creates another. when you search with spaces or special characters, the url is badly coded and the search does not work. The code must be corrected as follows (see last line ):
public function extractParams($uri = '')
{
$uri_array = explode('?', $uri);
$length_i = count($uri_array);
for($var_i = 1;$var_i<$length_i;$var_i++) {
if(preg_match_all('|&([^=]+)=([^&]*)|', '&'.$uri_array[$var_i].'&', $matches)) {
$length = count($matches[1]);
for($var_k = 0;$var_k<$length;$var_k++) {
Params::setParam($matches[1][$var_k], urldecode($matches[2][$var_k]));
}
}
}
}
This worked but meta parameters would show duplicated in the URL, I have tested your proposal and seems to be working fine.
Regards
-
Hi teseo,
Thanks for your reply!
Yeah, above links do work now, however, yesterday I received page/topic missing page, so maybe they were restored in the meantime, don't really know what happened, as I've tried several times to make sure. update: for some strange reason I can access those links if I'm logged out of the forum, but not when I'm logged in (!?).
Yes, the proposed solution does work for vanilla Osclass, my mistake was that I tested this on my dev version on a different server, which has some differences, and that patch does not work well there. I had to make a different version for it to work, but the point is it got me stranded in the wrong direction that this was related to server/environment, instead of Osclass 'version'. I'll have to revisit my own code and find out from where some 'ghost' extra parameters come from, but for the official Osclass version that solution should be fine.
Thanks again!
Regards
-
Hi teseo,
As apparently I have no ability to access, read and post in that topic as a user, can you post a link there to this discussion here?
Rolling back that code alone is not enough (there are other places that needs changes as well in that case) and, in fact, not recommended.
They should try the above fix instead and see if that solves the search problem (it should).
Regards
dev101
-
Another issue that has been mentioned before by others is that the custom fields DO NOT SHOW on the sidebar except for the main category I think and I don't know if this is how it is by default - I don't know the specifics but on most search pages for me it the custom fields do not show on the sidebar (permalinks disabled).
For this reason, one of the things I have been trying to find out is how to make my own advanced search form like creating a new search form on a custom page and get rid of the sidebar, that way I can create or add the custom fields that I think needs to be searchable, but I have not been able to find how to do that. Thanks!
-
Hi @dev101, sorry for the delay.
I have updated issue @ github:
official fix:
https://github.com/osclass/Osclass/pull/2261/files
Very nice :)
I've added a link to your message in that thread, don't know what might be happening to you ???
Thanks, regards
-
Thank you dev101.
This solution is more elegant than the previous one.
-
I've added a link to your message in that thread, don't know what might be happening to you ???
Thanks teseo, official fix was proposed by garciademarina.
About forum accessibility, it is definitely related to my account's permissions/privileges here, admins are currently looking into why is this happening. I remember Aficionado was complaining about some topics missing; while some probably did disappear, I wonder if this is/was related to it.
Regards
dev101