The following warnings occurred:
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 783 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined variable $newpmmsg - Line: 40 - File: global.php(841) : eval()'d code PHP 8.1.27 (Linux)
File Line Function
/global.php(841) : eval()'d code 40 errorHandler->error
/global.php 841 eval
/printthread.php 16 require_once
Warning [2] Undefined array key "style" - Line: 909 - File: global.php PHP 8.1.27 (Linux)
File Line Function
/global.php 909 errorHandler->error
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$lang_select_default - Line: 5024 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 5024 errorHandler->error
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key "additionalgroups" - Line: 7162 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 7162 errorHandler->error
/inc/functions.php 5044 is_member
/global.php 909 build_theme_select
/printthread.php 16 require_once
Warning [2] Undefined array key 1 - Line: 1415 - File: inc/functions.php PHP 8.1.27 (Linux)
File Line Function
/inc/functions.php 1415 errorHandler->error
/inc/functions.php 1370 fetch_forum_permissions
/printthread.php 76 forum_permissions
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error
Warning [2] Undefined array key "showimages" - Line: 160 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 160 errorHandler->error
Warning [2] Undefined array key "showvideos" - Line: 165 - File: printthread.php PHP 8.1.27 (Linux)
File Line Function
/printthread.php 165 errorHandler->error



Form Tools
Searchable Fields not Searchable - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: Searchable Fields not Searchable (/showthread.php?tid=379)



Searchable Fields not Searchable - robidigital - Nov 30th, 2009

I noticed that if I have set a field as searchable in my views, it is not searchable view the "All fields" dropdown unless, the field is also a Column in the view. Has anyone found a workaround for this?


RE: Searchable Fields not Searchable - Ben - Dec 1st, 2009

Hey robodigital,

I'm glad you posted. I just looked at the code & I think this should be categorized as a usability bug.

The "searchable" checkbox on the Add/Edit View pages just mean that it will appear as a searchable column in the fields dropdown in the search bar - nothing more. In fact, the actual form fields that will be searched are just those form fields that show up as columns - as you noted.

No good...!

How do you think it should work? The "searchable" column should determine both whether they appear in the dropdown & whether they're searchable? I think that makes the most sense...

Let me know what you think and I'll include this in a future build.

- Ben


RE: Searchable Fields not Searchable - robidigital - Dec 3rd, 2009

Here was the solution -

001.Revise admin submission search so that it search searchable fields rather than columns.

1. In /global/code/submissions.php –
Above ft_get_submission_field_info function on line 1194, Add

Code:
/**
         * RBD CUSTOM - Same as below, but modded to return field array of fields that are marked as 'searchable'
         *
         * This function is used for displaying and exporting the data. Basically it merges all information
         * about a particular field from the view_fields table with the form_fields and field_options table,
         * providing ALL information about a field in a single variable. This functionality is needed repeatedly
         * on multiple pages throughout the script, hence the abstraction.
         *
         * It accepts the result of the ft_get_view_fields() function as the first parameter and an optional
         * boolean to let it know whether to return ALL results or not.
         *
         * @param array $view_fields
         * @param boolean $return_all_fields
         */
        function ft_get_searchable_field_info($view_fields, $return_all_fields = false)
        {
          $display_fields = array();
          foreach ($view_fields as $field)
          {
            $field_id = $field["field_id"];

            if ($field['is_searchable'] == "yes" || $return_all_fields)
            {
              $curr_field_info = array('field_id'    => $field_id,
                                       'is_sortable' => $field['is_sortable'],
                                       'field_title' => $field['field_title'],
                                       'col_name'    => $field['col_name'],
                                       'list_order'  => $field['list_order']);

              $field_info = ft_get_form_field($field_id, true);
              $curr_field_info["field_info"] = $field_info;

              $display_fields[] = $curr_field_info;
            }
          }

          return $display_fields;
        }

2. In /admin/forms/submissions.php -
after line 121
Code:
$display_fields = ft_get_submission_field_info($view_info["fields"]);

add
Code:
$searchable_fields = ft_get_searchable_field_info($view_info["fields"]); //RBD CUSTOM 001.2

3. In /admin/forms/submissions.php -
around line 127
change
Code:
foreach ($display_fields
to
Code:
foreach ($searchable_fields


002.Revise client submission search so that it search searchable fields rather than columns.

1. Completed in 001.1

2. In /client/forms/index.php -
after line 125
Code:
$display_fields = ft_get_submission_field_info($view_info["fields"]);
add
Code:
$searchable_fields = ft_get_searchable_field_info($view_info["fields"]); //RBD CUSTOM 001.2

3. In /client/forms/index.php -
around line 130
change
Code:
foreach ($display_fields
to
Code:
foreach ($searchable_fields



RE: Searchable Fields not Searchable - Ben - Dec 4th, 2009

Excellent! Thanks for letting me know about the problem - and posting the fix!

I'll look it all over and include it in an upcoming build.

- Ben


RE: Searchable Fields not Searchable - Ben - Dec 10th, 2009

Heya,

I've included a fix for this in tonight's build. Turns out it was a pretty deep problem: I had to refactor quite a bit of code to get it working properly.

Please let me know of any issues that you - or anyone else - comes across.

Thanks!

- BEn