Skip to content

Conversation

@johnwebman
Copy link
Contributor

@johnwebman johnwebman commented Sep 22, 2025

The existing event listing in the admin panel does not filter by date correctly for events. The filter is designed for ordinary posts that have no concept of a start or end date and currently only offers the publish date for filtering.

490661353-ded02d48-da88-42a6-a309-846e5211c874

Ideally you'd want to filter by start date. for events. This update does just that.

490666490-52f0922e-b7a1-4177-81d3-373172e0c13e

The new code identifies all events with a valid start date and creates a unique dropdown for each month-year. Selecting a month-year and hitting the filter button will bring back just the events with the corresponding month-year start date.

Removed default listing date selection which is by publish date and replaced with custom date selection for event start date.
@johnwebman johnwebman marked this pull request as ready for review September 22, 2025 11:50
@johnwebman
Copy link
Contributor Author

@ritakikani
You can safely ignore the static code analysis. I think this is a classic case of AI not being that intelligent.
The issues suggested by the static code review can be broken down as follows:

  1. You can't escape html code and then render it. It's just not possible. So that one is a red herring. In any case we're not dealing with any user input so there is no XSS or security issue.
  2. There's nothing wrong with printf in this circumstance. I could have used echo or printr and these also would have been ok.
  3. It suggests I should use placeholders in the SQL query, but that's exactly what I've done. So it's missed all that. In any case, this code is not injectable so the security issue is irrelevant.

A static code review can often fail as it doesn't have the context of the environment that the code is running in, so you quite often get false negatives. I think your reviewers will agree that the static code analysis can be ignored in this instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant