I just can't make a simple search work

achilleas

New Member
Here is the situation.
I have a db table let's say "my_table" with some fields (field1, field2, field3, searchfield4).

I make a new list "showall" with connection to that table. Automatically it creates all the necessary things (form, group, elements).

I want the user to search in my_table for a specific searchfield4.

So I create a new form "search form". I copy the element searchfield4 (with full name my_table___searchfield4) from showall group to search form group. The new full name is ___searchfield4.

In the search form I publish the redirect plugin. Jump page the url of the showall list.
Use as search data YES.

Make a menu item with that form. Enter the exact searchfield4 value and nothing happens. The result shows all the records.
What I'm doing wrong?

Joomla 2.5.1
Fabrik 3.0.4 (latest from svn)
on xampp localhost.


below is the var_dump($_SESSION) - the searchfield4 real name is UniqueNo and the search string is 00001104030358c3714
================================
Code:
array(1) {
  ["__default"]=>
  array(28) {
    ["session.counter"]=>
    int(6)
    ["session.timer.start"]=>
    int(1330889830)
    ["session.timer.last"]=>
    int(1330889872)
    ["session.timer.now"]=>
    int(1330889872)
    ["session.client.browser"]=>
    string(76) "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2"
    ["registry"]=>
    object(JRegistry)#22 (1) {
      ["data":protected]=>
      object(stdClass)#23 (2) {
        ["com_fabrik"]=>
        object(stdClass)#24 (3) {
          ["package"]=>
          string(6) "fabrik"
          ["list7_com_fabrik_7"]=>
          object(stdClass)#25 (3) {
            ["filterlimitstart"]=>
            int(0)
            ["filter"]=>
            object(stdClass)#280 (1) {
              ["searchall"]=>
              string(0) ""
            }
            ["searchall"]=>
            string(0) ""
          }
          ["searchform"]=>
          object(stdClass)#27 (2) {
            ["form"]=>
            object(stdClass)#28 (1) {
              ["searchall"]=>
              string(0) ""
            }
            ["fromForm"]=>
            NULL
          }
        }
        ["searchform"]=>
        object(stdClass)#29 (2) {
          ["form13"]=>
          object(stdClass)#30 (2) {
            ["searchall"]=>
            NULL
            ["filters"]=>
            array(13) {
              ["join"]=>
              array(1) {
                [0]=>
                string(3) "AND"
              }
              ["key"]=>
              array(1) {
                [0]=>
                string(13) "``.`UniqueNo`"
              }
              ["condition"]=>
              array(1) {
                [0]=>
                string(1) "="
              }
              ["search_type"]=>
              array(1) {
                [0]=>
                string(6) "search"
              }
              ["access"]=>
              array(1) {
                [0]=>
                int(0)
              }
              ["grouped_to_previous"]=>
              array(1) {
                [0]=>
                bool(false)
              }
              ["eval"]=>
              array(1) {
                [0]=>
                int(0)
              }
              ["required"]=>
              array(1) {
                [0]=>
                bool(false)
              }
              ["value"]=>
              array(1) {
                [0]=>
                string(19) "00001104030358c3714"
              }
              ["full_words_only"]=>
              array(1) {
                [0]=>
                bool(false)
              }
              ["match"]=>
              array(1) {
                [0]=>
                string(1) "0"
              }
              ["hidden"]=>
              array(1) {
                [0]=>
                int(0)
              }
              ["elementid"]=>
              array(1) {
                [0]=>
                string(2) "68"
              }
            }
          }
          ["fromForm"]=>
          int(13)
        }
      }
    }
    ["user"]=>
    object(JUser)#31 (23) {
      ["isRoot":protected]=>
      bool(false)
      ["id"]=>
      int(0)
      ["name"]=>
      NULL
      ["username"]=>
      NULL
      ["email"]=>
      NULL
      ["password"]=>
      NULL
      ["password_clear"]=>
      string(0) ""
      ["usertype"]=>
      NULL
      ["block"]=>
      NULL
      ["sendEmail"]=>
      int(0)
      ["registerDate"]=>
      NULL
      ["lastvisitDate"]=>
      NULL
      ["activation"]=>
      NULL
      ["params"]=>
      NULL
      ["groups"]=>
      array(0) {
      }
      ["guest"]=>
      int(1)
      ["_params":protected]=>
      object(JRegistry)#32 (1) {
        ["data":protected]=>
        object(stdClass)#33 (0) {
        }
      }
      ["_authGroups":protected]=>
      array(1) {
        [0]=>
        int(1)
      }
      ["_authLevels":protected]=>
      array(2) {
        [0]=>
        int(1)
        [1]=>
        int(1)
      }
      ["_authActions":protected]=>
      NULL
      ["_errorMsg":protected]=>
      NULL
      ["_errors":protected]=>
      array(0) {
      }
      ["aid"]=>
      int(0)
    }
    ["com_mailto.links"]=>
    array(1) {
      ["1fabdf14dfa47cf3d2d93fd2ca960cefb135243e"]=>
      object(stdClass)#34 (2) {
        ["link"]=>
        string(54) "http://localhost/doc-next/2-uncategorised/1-2312312312"
        ["expiry"]=>
        int(1330889834)
      }
    }
    ["session.token"]=>
    string(32) "35f9fbe92d6620b1ac287a7803b07832"
    ["fabrik.connection.2"]=>
    string(310) "a:11:{s:2:"id";s:1:"2";s:4:"host";s:9:"localhost";s:4:"user";s:4:"root";s:8:"password";s:0:"";s:8:"database";s:11:"doc-service";s:11:"description";s:10:"service db";s:9:"published";s:1:"1";s:11:"checked_out";s:1:"0";s:16:"checked_out_time";s:19:"0000-00-00 00:00:00";s:7:"default";s:1:"0";s:6:"params";s:0:"";}"
    ["com_fabrik.list7_com_fabrik_7.order.50"]=>
    string(0) ""
    ["com_fabrik.list7_com_fabrik_7.order.51"]=>
    string(0) ""
    ["com_fabrik.list7_com_fabrik_7.order.52"]=>
    string(0) ""
    ["com_fabrik.list7_com_fabrik_7.order.53"]=>
    string(0) ""
    ["com_fabrik.list7_com_fabrik_7.order.54"]=>
    string(0) ""
    ["com_fabrik.list7_com_fabrik_7.order.55"]=>
    string(0) ""
    ["com_fabrik.list7_com_fabrik_7.order.56"]=>
    string(0) ""
    ["com_fabrik.form.data"]=>
    array(29) {
      ["___UniqueNo"]=>
      string(19) "00001104030358c3714"
      ["listid"]=>
      string(0) ""
      ["listref"]=>
      string(0) ""
      ["rowid"]=>
      string(0) ""
      ["Itemid"]=>
      string(3) "155"
      ["option"]=>
      string(10) "com_fabrik"
      ["task"]=>
      string(12) "form.process"
      ["isMambot"]=>
      string(0) ""
      ["formid"]=>
      string(2) "13"
      ["returntoform"]=>
      string(1) "0"
      ["fabrik_referrer"]=>
      string(39) "http://localhost/doc-next/tracking-list"
      ["fabrik_ajax"]=>
      string(1) "0"
      ["_packageId"]=>
      string(1) "0"
      ["limitstart"]=>
      string(1) "0"
      ["99dccb03782ceb9e2df4e96075413dcf"]=>
      string(1) "1"
      ["format"]=>
      string(4) "html"
      ["fabrik_repeat_group"]=>
      array(1) {
        [14]=>
        string(1) "1"
      }
      ["submit"]=>
      string(4) "Save"
      ["fontSize"]=>
      string(3) "100"
      ["befecb3867e0be256b9f42aacc5186c9"]=>
      string(26) "q052ejlsrp87pdgvrb0tt1vn81"
      ["014ec63f6f5e2567f1e88875c54e5c13"]=>
      string(32) "40fad413596515cba9641ec2031407a1"
      ["5984036cce58aa0968829c09d7db7056"]=>
      string(26) "uk387ti536q6396vaj6kobfin4"
      ["9ab575294804b8a549f0dd7923e694a3"]=>
      string(32) "7c9daa90bd3059932aa4ca1823a742f6"
      ["jpanesliders_panel-sliders"]=>
      string(1) "0"
      ["jpanesliders_element-sliders-options"]=>
      string(1) "0"
      ["jpanesliders_element-sliders-publishingsettings-21"]=>
      string(1) "0"
      ["jpanesliders_element-sliders-viewsettings-21"]=>
      string(1) "0"
      ["6948735990f5db06526f89bef6a0bcae"]=>
      string(26) "n1l6ppp7iu13svpco2vrih29b6"
      ["view"]=>
      string(4) "form"
    }
    ["com_fabrik.form.13.redirect.showsystemmsg"]=>
    array(1) {
      [0]=>
      bool(true)
    }
    ["com_fabrik.form.13.redirect.url"]=>
    array(0) {
    }
    ["com_fabrik.form.13.redirect.redirect_content_how"]=>
    string(5) "popup"
    ["com_fabrik.form.13.redirect.redirect_content_popup_width"]=>
    string(3) "300"
    ["com_fabrik.form.13.redirect.redirect_content_popup_height"]=>
    string(3) "300"
    ["com_fabrik.form.13.redirect.redirect_content_popup_x_offset"]=>
    string(1) "0"
    ["com_fabrik.form.13.redirect.redirect_content_popup_y_offset"]=>
    string(1) "0"
    ["com_fabrik.form.13.redirect.redirect_content_popup_title"]=>
    string(0) ""
    ["com_fabrik.form.13.redirect.redirect_content_popup_reset_form"]=>
    string(1) "1"
    ["com_fabrik.form.13.redirect.msg"]=>
    array(1) {
      [0]=>
      NULL
    }
  }
}
 
i tried one more. I copied the showall list to searchall list.
I then went to elements and unpublish everything except the searchfield4 (uniqueNo).

I menu'd the searchall form and again nothin happend. It lists everything.
If I set the "Append jump url with data" to YES then the search works, but I don't want the field be viewable from the URL (security reasons). I want the $_SESSION thing to work...

Any suggestions?
Thanks in advance!
 
I seem to have the same problem - although even when I set Append jump url with data it still shows all the records
 
It's working on my site (GitHub 31-3-2012).
What is your fabrik version?

You can enable fabrik debug (in fabrik options) and append &fabrikdebug=1 (or ?&fabrikdebug=1, if it's the first parameter) to your Jump URL.
Then with a click on "get ListData: your-table" you can see the generated SELECT statement
 
I only wanted the simplest functionality, so I just have 3.0.4 from the website.

With debug on, the SQL has no WHERE clause at all, so it returns all the records.
 
Updated to the latest code via GitHub, but it is still not working for me.

Now get

WHERE (1=1 AND 1=1)

in the debug as the entire where clause.

Element type is field and has the same name as the list - I copied it from the original group's element, which is easier now in 3.0.
 
I think there may be a bug here.
I got it working by changing my table column names (and then elements) to all lower case, and it worked. Before, my column names had an initial upper case. I deduced this change because another search I made worked and I looked at the differences - the table was all lower case column names.

Now - how do I change the behaviour of the Where clause so that it uses LIKE %input% ?
 
Is there a reason that you don't use the standard list filter?

There you can set the element to partial search/exact search/full word search.
 
I have the exact same issue. This worked fine in Fabrik 2.1.1 (which my live site is currently using) but in 3.0.4 the element fields names must all be in lowercase for it to work.

I want to use a "search form" with the redirect plugin because its a public facing site and the filters are not very intuative.
 
The standard list filter is good, but the customer does not want the user to have access to the entire list of data at any time. Rather, the user must provide some filter and only see matching records. If there are too many matching records, then this needs to be restricted somehow e.g only the first x records.
 
Yes! Thanks Rob - how did I miss that? I'd like to limit the rows per page to just 3 - but it seems to ignore the "Rows per page" value? It is always 10.
 
Can you confirm that the issue is actually that they need to be lowercase, or simply that they must match?

I've gone thru that chunk of code, and can't see any reason why it would care if the search form or the target list uses upper or lower or mixed case element names ... but it will matter that they match. So a search form with element ___fooBar will only match a target list element with tablename___fooBar. If either element name has different case, then they won't match up.

-- hugh
 
Ok.

Basically I have a form with no list associated with it. The field names are all EXACTLY the same. I have selected the redirect plugin on this form and redirect to the correct list with the "Use as search Data" set to Yes.

This is the same as what I was doing in 2.1

It returns all records in the database and there are no search filters in the debug.
 
OK, I just needed to check that the case exactly matched on both forms.

And at the moment, I'm at a loss as to why it would work with lower case, but not with mixed case names.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top