What does search search?

13 views
Skip to first unread message

Jeff Vannest

unread,
Oct 2, 2015, 10:12:38 AM10/2/15
to pHKapa
Hello all,
What does the search box actually search? When I'm on Query and use the search box using a word that is only unique to one record I receive 15 records, none of them having that string.

Thoughts?

Jeff

ScarsOfHumanity

unread,
Oct 2, 2015, 12:44:46 PM10/2/15
to pHKapa
It searches with a 'LIKE %condiftion%' on several fields .. in my version i also added "Ticket.description" to the list .. 
                       
 "Ticket.id LIKE" => "%" . $keyword . "%",
                        "Ticket.description LIKE" => "%" . $keyword . "%", -> not used , i sugest this to be added ....
                        "Priority.name LIKE" => "%" . $keyword . "%",
                        "Safety.name LIKE" => "%" . $keyword . "%",
                        "Type.name LIKE" => "%" . $keyword . "%",
                        "Process.name LIKE" => "%" . $keyword . "%",
                        "Origin.name LIKE" => "%" . $keyword . "%",
                        "Category.name LIKE" => "%" . $keyword . "%",
                        "Activity.name LIKE" => "%" . $keyword . "%",
                        "Cause.name LIKE" => "%" . $keyword . "%",
                        "Supplier.name LIKE" => "%" . $keyword . "%",
                        "Workflow.name LIKE" => "%" . $keyword . "%"),

http://www.techonthenet.com/mysql/like.php


On Sex Out 2 15:12 , Jeff Vannest sent:

--
You received this message because you are subscribed to the Google Groups "pHKapa" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phkapa+un...@googlegroups.com.
To post to this group, send email to phk...@googlegroups.com.
Visit this group at http://groups.google.com/group/phkapa.
For more options, visit https://groups.google.com/d/optout.

ScarsOfHumanity

unread,
Oct 2, 2015, 12:44:54 PM10/2/15
to pHKapa

Jeff Vannest

unread,
Oct 2, 2015, 2:29:13 PM10/2/15
to ScarsOfHumanity, pHKapa
But even if I enter a nonsense word like "asdfghjk" I get records being returned, which should not be true if the above LIKE syntax is functioning correctly.
10-2-2015 2-26-43 PM.png

...

10-2-2015 2-27-14 PM.png

pHAlkaline

unread,
Oct 2, 2015, 4:42:45 PM10/2/15
to pHKapa
Hello to all,
This does not happening on demo.phkapa.net 
Do you have the last version , made any change on your code?
To unsubscribe from this group and stop receiving emails from it, send an email to phkapa+unsubscribe@googlegroups.com.

To post to this group, send email to phk...@googlegroups.com.
Visit this group at http://groups.google.com/group/phkapa.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "pHKapa" group.
To unsubscribe from this group and stop receiving emails from it, send an email to phkapa+unsubscribe@googlegroups.com.

jqu...@iol.pt

unread,
Oct 2, 2015, 4:47:02 PM10/2/15
to phk...@googlegroups.com

To it seems that your code is not even doing any search ... and returns all records .. can you post / attach your querycontroller.php ?

Jeff Vannest

unread,
Oct 26, 2015, 9:40:51 AM10/26/15
to jqu...@iol.pt, phk...@googlegroups.com
Sorry for the delay.

I was able to add Tickets.description the Admin Tickets page (http://server//phkapa/admin/phkapa/tickets) by altering /phkapa/app/Plugin/Phkapa/Controller/TicketsController.php.

However, search from the Query page (http://server/phkapa/phkapa/query) still doesn't work at all and returns all records no matter what is entered. I believe that the keyword is not being passed to the QueryController page, since if I set debug to 2, the SQL being used is, "SELECT `Ticket`.`id`, `Ticket`.`ticket_parent`, ...  WHERE 1 = 1 ORDER BY `Ticket`.`origin_date` DESC LIMIT 20". As you can see, although I enter a value in to the query box, the keyword is not being passed to the controller, instead replaced with "1 = 1", which to be the default cake behavior when nothing is searched.

We're still running 1.3.1, although hoping to update to the latest this week.

Jeff

pHAlkaline

unread,
Oct 26, 2015, 11:48:23 AM10/26/15
to pHKapa

Jeff Vannest

unread,
Oct 27, 2015, 8:44:19 AM10/27/15
to pHAlkaline, pHKapa
Thanks!! I'll check that out.

Jeff

Reply all
Reply to author
Forward
0 new messages