• Hi Magenta, I’m about to finish the customization of your plugin!

    I have three problems:

    1.- In Types plugin there are this word: “Ribera d’Ebre”.
    But in your search plugin it get: “Ribera d\’Ebre”.
    Then, the search not found anything!

    2.- In Types plugin there are this diferents fields:
    “BCIL”
    and
    “Conjunt BCIL”.

    In the place to search, it get correctly two options checkbox.

    But when I select the “BCIL” option, the result show the posts with “BCIL” and the posts with “Conjunt BCIL”…??

    3.- This is not a problem, is a visual change:
    In the sidebar, your plugin show: text + valor into the brackets + number of total into the brackets.
    Example: option A(option-a)(4)

    I ask if is posible not show the valor, just like that: option A(4)…?

    I looking for into the php code, but I dont know how change it!

    Thanks
    Pep

    https://www.ads-software.com/plugins/search-types-custom-fields-widget/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Magenta Cuda

    (@magenta-cuda)

    1. This is clearly a bug. Apostrophes are the SQL string delimiters and need to be specially handled and clearly it isn’t being done correctly. I need some time to work on this.

    2. The matching routine uses the SQL substring matching (WHERE meta_value LIKE ‘%value%’) instead of equality (WHERE meta_value = ‘value’) so it finds all posts where the meta field has the ‘value’ as a substring. The reason for this is the matching routine is shared with values from checkboxes and values manually entered in textboxes. Ideally, I suppose you would want exact matches for checkbox input and substring match for textbox input. Unfortunately, currently very early in the processing the checkbox values and textbox values are merged and handled uniformly after that. This unfortunately gives the unexpected anomaly you have encountered. This may be fixable by the use of an additional flag to accompany the merged value. I will need to investigate this further.

    3. The part in parenthesis is done by lines 797-801 and 1409-1413.

    if ( $wpcf_field['data']['options'][$value]['display'] == 'db' ) {
                                $label .= ' (' . $wpcf_field['data']['options'][$value]['set_value'] . ')';
                            } else if ( $wpcf_field['data']['options'][$value]['display'] == 'value' ) {
                                $label .= ' (' . $wpcf_field['data']['options'][$value]['display_value_selected'] . ')';
                            }

    and

    if ( $wpcf_field['data']['options'][$value]['display'] === 'db' ) {
                                                $current .= ' (' . $wpcf_field['data']['options'][$value]['set_value'] . ')';
                                            } else if ( $wpcf_field['data']['options'][$value]['display'] === 'value' ) {
                                                $current .= ' (' . $wpcf_field['data']['options'][$value]['display_value_selected'] . ')';
                                            }

    Commenting out these lines will remove the output in parenthesis’s.

    I am currently working on something else so it will be a while (maybe a week or more) before I can return to this.

    Thanks for you error report it is greatly appreciated.

    mc

    Plugin Author Magenta Cuda

    (@magenta-cuda)

    I have not been able to duplicate your problem with apostrophe’s. I tested with single line field and there was no backslash preceding the apostrophe and the search was successful.

    I can think of two different possibilities:

    1) The execution environment is different:
    My environment is PHP 5.4.14 and MySQL 5.5.28 running in STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION mode.
    Please tell me your environment.

    2) Your data may be corrupted:
    How is the data stored in the database. In my case there is no backslash in the raw SQL data retrieved with a SELECT command. How is your data actually stored. Can you create new data and see if the problem persists.

    Plugin Author Magenta Cuda

    (@magenta-cuda)

    @pepcru, at this point I have no idea as to what is causing the problem. Please specify the exact field type you are using and if you can the raw data in the SQL table. As, the moderator takes a very long time to approve my posts please provide as much information as possible as we will be getting only one turnaround per day.

    Thread Starter pepcru

    (@pepcru)

    Dear Magenta, thanks for answers… excuse my delay…

    I running with PHP Version 5.4.4-14+deb7u9

    MySQL, I dont know how to get the version??
    In phpmyadmin, I write: SELECT version();
    And this is the result: 5.5.38-0+wheezy1-log

    Thread Starter pepcru

    (@pepcru)

    I look for and deleted the codes in lines 797-801 and 1409-1413.
    But the text in parenthesis is showing again!??

    Thread Starter pepcru

    (@pepcru)

    You tell: 2) Your data may be corrupted: How is the data stored in the database.

    I dont know where and how, the Types plugin, store datas ???? I can dont find in phpmyadmin…??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘problem with results’ is closed to new replies.