Filter Search not working on one field in a Simple Module

edited May 2012 in Bug Reports
Hello, I have a simple module to store helmet orders, and I have filters defined for each field in the model's database table. All of the fields are searchable in the Fuel admin, except for one called "transaction_id". It is a varchar field that just stores a typical order transaction number.

I even tried putting the number in quotes to see if the search worked, but it didn't. Every other field works fine. Do you know why?

Erik

Comments

  • edited 5:35AM
    There is some logic in the fuel/modules/models/base_module_models.php file on line 208 and 220 that is probably causing the issue. What get's displayed if you do a $this->debug_query(); before the ending return statement in that method?
  • edited June 2012
    Here is what gets displayed at the very top of Fuel:

    SELECT refunds.id, refunds.id AS ID, date_added as Date, CONCAT("$", FORMAT(refund_amount, 2)) as Amount, transaction_id, credit_card_last_4, customer_name, customer_email, customer_address, refund_transaction_id, refund_type FROM (refunds) ORDER BY date desc

    And this is what gets displayed in the white area right above all the data columns:

    SELECT refunds.id, refunds.id AS ID, date_added as Date, CONCAT("$", FORMAT(refund_amount, 2)) as Amount, transaction_id, credit_card_last_4, customer_name, customer_email, customer_address, refund_transaction_id, refund_type FROM (refunds) ORDER BY date desc SELECT refunds.id, refunds.id AS ID, date_added as Date, CONCAT("$", FORMAT(refund_amount, 2)) as Amount, transaction_id, credit_card_last_4, customer_name, customer_email, customer_address, refund_transaction_id, refund_type FROM (refunds) ORDER BY Date desc LIMIT 25

    Any insights as to why transaction_id doesn't show up in the filter search results? Its quite an important field to search on, being a unique identifier if each row.

    Erik
  • edited 5:35AM
    Just came across this post, and wonder why in the second excerpt above, it does seem that the query is running twice in my case as well? http://www.getfuelcms.com/forums/discussion/812/list-items-on-a-module-with-different-options-on-different-ways
  • edited 5:35AM
    What does the query look like after applying the search filter?

    The query runs twice is expected and is used the second time to calculate the total number of rows for pagination (so no limit in the query).
Sign In or Register to comment.