exc1usive
Forum Replies Created
-
Forum: Plugins
In reply to: [Participants Database] multilingual siteI confirm, this change fixes the problem.
Waiting for the update.Thank you very much for your cooperation!
Forum: Plugins
In reply to: [Participants Database] multilingual siteBy search result feedback you mean this string template “Found %d result while searching for %s”?!))) If yes, than yes – so far, I came across this behavior only in the search result feedback.
If more precise, I would say you may see it in the returned by the function $PDb_Combo_Multi_Search->current_search_term() value.Forum: Plugins
In reply to: [Participants Database] multilingual siteI just tried to set up “display” values as I described above, and it didn’t work. It looks like it doesn’t even trying to get translation for “multiword” options. It always returns their “stored” values.
I set my options list like this:General worker, Mechanical fitter, Electrical fitter, Pipe::Pipe fitter, Welder
In the database I changed English translation for key “Pipe” to value “Pipe fitter123”, and everywhere on the site I see “Pipe fitter123”. But, in the search terms string it says:
Found 7 results while searching for Electrical fitter, Pipe fitter, Welder.
It supposed to be “Pipe fitter123” and this means that for “multiword” search terms it always returns the stored values(Pipe::Pipe fitter). I could understand if the search term would be equal the “display” value “Pipe”, but it’s not.
The question is still open.
Forum: Plugins
In reply to: [Participants Database] multilingual siteI don’t quite understand your answer. I didn’t say anything about “combo” input, we don’t use this type of search. All fields on the search form are fields with selectors – Multiselect Checkbox, Multiselect Dropdown, and Dropdown List. The only exception is Currency field where a user makes manual input in “from”-“to” fields.
We don’t set any settings on “Combination Search Settings” tab. We provide search fields list in “Multi Search Fields” on “Multi Search Settings” tab. I just tried to set a checkmark for “Whole Word Match Only” setting on “Multi Search Settings” tab, but it didn’t do anything. The search itself works fine, it produces the correct list of participants. The only problem with the translation of “multiple word” search terms in the stringFound 1 result while searching for Electrical fitter, Germany, Austria.
Everywhere else this “multiple word” option gets its translation.
So, this Multiselect Checkbox field has following options defined “General worker, Mechanical fitter, Electrical fitter, Pipe fitter, Welder”. Only “Welder” from this list gets its translation, since it’s a single word option. Once again, we are talking about search term translation only in this string “Found %d result while searching for %s”, everywhere else all options get their translations.The only workaround I can think of is to set up a “display” value and use only single-word values. In this case everything should work correctly.
General::General worker, Mechanical::Mechanical fitter, Electrical::Electrical fitter, Pipe::Pipe fitter, Welder::Welder
I think this limitation should be included in documentation.
Forum: Plugins
In reply to: [Participants Database] multilingual siteYes, I understand that. We have used Q-Translate for awhile, and, unfortunately, it didn’t fill all our requirements and we decided to use our own parser where we pull translated string from the database. It works well all around except for search terms in the line mentioned in previous post.
Actually, I just found out another reason why it might happened. It happens only to a string which consists of two or more words (contains spaces). It doesn’t matter if the field is Multiselect Checkbox or Multiselect Dropdown, I tried both. It only depends on spaces in the string. For example,1 Ergebnisse bei der Suche nach Electrical fitter, Schweisser, Estland gefunden.
Where, Schweisser and Estland consist of one word and they got translated, and “Electrical fitter” has space in it, and got not translated, but only in search terms text. Everywhere else it gets translation.
Any ideas what I might be doing wrong?Forum: Plugins
In reply to: [Participants Database] multilingual siteThank you for your response. It solves the problem from my second question.
What about the first one, when the search form has Multiselect Checkbox options?The options on the form got translated, but in the text with search terms the filter remain their default values.
Here is an example how it looks on the page. This is English version:Found 1 result while searching for Electrical fitter, Germany, Austria.
And this is the German version of the same search:
1 Ergebnisse bei der Suche nach Electrical fitter, Deutschland, Österreich gefunden.
The search terms – “Germany, Austria” come from Multiselect Dropdown fields, and they got translated. The search term – “Electrical fitter” comes from Multiselect Checkbox field, and values are always in English (default language).
To translate user-defined strings we use parser in pdb-translate_string filter. As I stated before, it might happened because of leading comma in search terms for Multiselect Checkbox field.- This reply was modified 6 years, 8 months ago by exc1usive.
Forum: Plugins
In reply to: [Participants Database] add_filter() logic parenthesisCase closed!
Forum: Plugins
In reply to: [Participants Database] add_filter() logic parenthesisYour update fixes the issue.
Thank you!Forum: Plugins
In reply to: [Participants Database] add_filter() logic parenthesisGreat! Thanks a lot!
Forum: Plugins
In reply to: [Participants Database] add_filter() logic parenthesisYes, indeed! But, I don’t set the values for those search fields during this experiment, they are just left out blank.
Forum: Plugins
In reply to: [Participants Database] add_filter() logic parenthesisNo, I don’t mess with the pdb-list_query_parens_logic filter in my code.
But, after you told me about its existence, I added following lines to my functions.php file.function ff_parenthesize_or_statements() { return true; } add_filter( 'pdb-list_query_parens_logic', 'ff_parenthesize_or_statements' );Not sure if it’s the right way of using it. But it didn’t change the query, the parenthesis are still around AND statements.
What else can I try to find the origin of this behavior?
Forum: Plugins
In reply to: [Participants Database] add_filter() logic parenthesisI’m using theme’s page template to display the list. It has some logic in php and html markup. Since I put the shortcode in php, I have to use echo do_shortcode(…); function.
But, the issue lies somewhere else. I simplified everything by removing the usage of templates, but the problem is still there.
So, here are the steps to reproduce the problem:1. I created blank page and placed shortcode [pdb_list template=multisearch] directly to its content. No php, no html, no templates this time.
2. In my functions.php, I removed all unnecessary logic and the loop where i altered the query list object, and just used constants in action, like this:function filter_by_avalability_dates($query_filter) { $query_filter->add_filter('user_login', '=', '2@mail.com', 'OR'); $query_filter->add_filter('user_login', '=', '1@mail.com', 'OR'); } add_action('pdb-list_query_object', 'filter_by_avalability_dates');That is it! Now, on my search form I set filter for only one field, any field, and have this result in my debug log.
(just where portion of the query)WHERE (p.work_country LIKE "%Austria%" AND p.user_login = "2@mail.com") OR p.user_login = "1@mail.com"The expected result would be:
WHERE p.work_country LIKE "%Austria%" AND (p.user_login = "2@mail.com" OR p.user_login = "1@mail.com")See the difference? I don’t know how you might have different result in your tests? I definitely doing something wrong.
If I change OR to AND for the first value (only for an experiment):function filter_by_avalability_dates($query_filter) { $query_filter->add_filter('user_login', '=', '2@mail.com', 'AND'); $query_filter->add_filter('user_login', '=', '1@mail.com', 'OR'); } add_action('pdb-list_query_object', 'filter_by_avalability_dates');The query would be
WHERE (p.work_country LIKE "%Austria%" AND p.user_login = "2@mail.com" AND p.user_login = "1@mail.com")As you can see, in parenthesis goes only expressions joined using AND. I would like to put parenthesis around ORs.
Forum: Plugins
In reply to: [Participants Database] add_filter() logic parenthesisHi, Roland!
Yes, both plugins have the latest versions are installed.
I have placed the action ‘pdb-list_query_object’ in my functions.php file in the following manner:function filter_by_avalability_dates($query_filter) { //....here goes logic to populate string array $available_users if ( !empty($available_users) ) { foreach ($available_users as $u_login) { $query_filter->add_filter('user_login', '=', $u_login, 'OR'); } } } add_action('pdb-list_query_object', 'filter_by_avalability_dates');The only line where I alter the query object in my function is
$query_filter->add_filter('user_login', '=', $u_login, 'OR');To display the list of participants I placed a shortcode on the page.
echo do_shortcode("[pdb_list template=custom filter='role=user&approved=yes']");Let me know if you need any other information.
Forum: Plugins
In reply to: [Participants Database] add_filter() logic parenthesisRoland, I followed you suggestion and enabled debug mode. Here is an example of the query that was generated after applying filter for list view.
PDb_List::_setup_iteration list query: SELECT p.id, p.full_name, p.qualification, p.work_country, p.wage, p.country, p.native_language, p.additional_languages, p.details FROM wp_participants_database p WHERE (p.role = “user” AND p.approved = “yes” AND p.work_country LIKE “%Austria%” AND p.user_login = “2@mail.com”) OR p.user_login = “1@mail.com” ORDER BY p.date_updated DESC
so, this part comes from the shortcode
p.role = “user” AND p.approved = “yes”
this part is from filter form
p.work_country LIKE “%Austria%”
and the last part
p.user_login = “2@mail.com” OR p.user_login = “1@mail.com”
was added in action ‘pdb-list_query_object’ I was talking about in previous post.
As you can see first value of custom filter goes in parenthesis with the filter from the form, I was expecting to see something like this:
SELECT p.id, p.full_name, p.qualification, p.work_country, p.wage, p.country, p.native_language, p.additional_languages, p.details FROM wp_participants_database p WHERE p.role = “user” AND p.approved = “yes” AND p.work_country LIKE “%Austria%” AND (p.user_login = “2@mail.com” OR p.user_login = “1@mail.com”) ORDER BY p.date_updated DESC
P.S. “Enable Filter Mode” option is ON, and always was
Forum: Plugins
In reply to: [Participants Database] null_select::false is brokenThanks a lot! Your update has fixed this issue.