Repository navigation
Fix date-filtered general statistics with DBAL 4 - #2240
Conversation
|
With a quick search I found more such instances. Please run a search (for example text search in all files with |
In PHP you have two kinds of data objects, namely |
|
Following up on the suggestion to check other date-type mismatches: I found no additional immutable dates bound as mutable in the audited paths. The eight remaining explicit I did find a separate issue in I found no current callers in the application or templates, so this is a dormant defect rather than another confirmed HTTP 500 path. It is distinct from the DBAL binding fixed here and can be addressed separately. Validation: the existing regression tests and temporary DBAL conversion checks passed (8 tests, 211 assertions). |
Summary
Selecting a period on
/stats/general/{period}throws an HTTP 500 becauseVoteRepository::count()binds aDateTimeImmutableas Doctrine's mutabledatetimetype. Bind it asdatetime_immutableto match the method signature and allow period-filtered general statistics to load.Additional information
The regression test uses DBAL's real statement type conversion with a mocked database driver. It covers dated and all-time counts, with and without federated users, across all five vote/favourite tables. Both dated cases reproduced the reported
InvalidTypeexception before the fix.Validation:
vendor/bin/phpunit --no-configuration --bootstrap vendor/autoload.php tests/Unit/Repository/VoteRepositoryTest.php: 4 tests passed, 130 assertions.Related issues
Fixes #2239