It stopped working >= 2.8.13 due to a change made for this issue: https://github.com/easydigitaldownloads/easy-digital-downloads/issues/6178
If sequential order numbers are enabled nothing below that if is executed, causing the search functionality in the payments (and licenses among others probably) to not fully work as expected.
Searching for a any generic s (non-user/email), discount: or # download doesn't work.
This is tricky.
The PR does fix the search but the search is still broken.
Let's say you enable sequential now and perform a couple of test purchases. Then go to the payments list and search just the payment ID of one of your new test purchases. It will work properly. But it will not work if you search just the payment ID of a purchase from before sequential.
Note: that happens on both master and this PR.
@SDavisMedia although I haven't tested your scenario, I do believe my branch takes that into account.
https://github.com/easydigitaldownloads/easy-digital-downloads/pull/6472/files#diff-b594a31ba846d2a8e7d09d6c474364c0R486
When a numeric search is done it searches for post IDs and sequential IDs. Only when a prefix is provided in the search it will only search for those payments with the prefixes. May still be missing something though 馃槄
I'd say let's see if we can test this once 3.0 is at a more stable point. With the new tables we're building out our own DB patterns that should, _in theory_, give us far more flexibility in the search patterns.
@JJJ @sunnyratilal heads up, let's see if we can support this in the native query classes we're building for payments.
Acknowledged. We can trick this out very easily now, so I鈥檒l think on it and own this for 3.0.
Here's where we are right now:
For 3.0 specifically, get_search_sql() looks like:
https://github.com/easydigitaldownloads/easy-digital-downloads/blob/release/3.0/includes/database/queries/class-base.php#L1028
It's looped through in our parse_where() method:
https://github.com/easydigitaldownloads/easy-digital-downloads/blob/release/3.0/includes/database/queries/class-base.php#L1090
Searchable columns are filterable:
https://github.com/easydigitaldownloads/easy-digital-downloads/blob/release/3.0/includes/database/queries/class-base.php#L1243
Specifically, wp_edd_orders:order_number is marked as searchable 馃憤
Meta queries use WP_Meta_Query so LIKE comparisons are possible.
We also allow for custom groupby clauses, which we use internally inside of wp-admin for grouping discounts and customers currently. Support for multiple groupby's is coming eventually.
If I understand the original problem correctly, the next steps are making sure that our admin area screens and forms are properly passing their s values through.
We _could_ go a step farther and add some _very basic_ parameterization to our search boxes. Say, searching for: order_number=2,status=pending. If we think we want that in a future version other than 3.0, I can get DB\Query\Base ready now so we don't need any breaking changes later.
All ears!
Most helpful comment
Acknowledged. We can trick this out very easily now, so I鈥檒l think on it and own this for 3.0.