Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL error on filtering #428

Closed
cvl01 opened this issue Feb 22, 2024 · 1 comment
Closed

SQL error on filtering #428

cvl01 opened this issue Feb 22, 2024 · 1 comment

Comments

@cvl01
Copy link

cvl01 commented Feb 22, 2024

Describe the bug
Since one of the last updates (I think since 4.9) filters don’t work for me.

I did some digging in the code and saw that an SQL error is the problem.

The sql call $result_log_rows = $wpdb->get_results( $sql_query_log_rows, OBJECT_K ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared in web/app/plugins/simple-history/inc/class-log-query.php:409 gives the following error:

Unknown column 'c1.value' in 'where clause'

If I change c1.value to context_message_key it works.

Also, the way this error is handled (exit if wpdb has last_error property) is not the best way of debugging, because of this error the simple history admin view just freezes after filtering but shows no error message.

Can you have a look at this problem? It seems to me that it doesn’t happen on all installations. Probably has something to do with sql version. I’m on version: mysqlnd 8.2.16

To Reproduce
Go to simple history, filter on type (e.g. all plugin activity) and on clicking the search button the request fails and no filtered output is shown.

System information (please complete the following information):

  • WordPress version: 6.4.3
  • PHP version: 8.2
  • MySQL: 8.2
@bonny bonny self-assigned this Feb 23, 2024
@bonny
Copy link
Owner

bonny commented Feb 23, 2024

Thanks for the bug report. I can reproduce this.

System info:

  • 10.5.13-MariaDB-1:10.5.13+maria~focal

@bonny bonny added this to In progress in Simple History kanban Feb 24, 2024
@bonny bonny closed this as completed in 95064a7 Feb 24, 2024
Simple History kanban automation moved this from In progress to Done Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants