Page 1 of 1

Archive : minus one!

Posted: Mon Nov 29, 2021 9:12 am
by Fabien
Hi,

Im am using 2.4-beta1 (but I am not sure that the problem doesn't exist before).

Hera are the archive of my blog : https://chabreuil.com/Aurore/archive
As you can see on this page, I am supposed to have written 3 entries during november 2021.

But I have written 4 entries ! If you clic on "3 billets", this page is dispayed and list correctly the four entries : https://chabreuil.com/Aurore/archives/2 ... mmary.html

Same problem for every month !

Best regards,
Fabien

Re: Archive : minus one!

Posted: Mon Nov 29, 2021 4:04 pm
by onli
I can confirm this in my own blog. Maybe some of the others have an idea what happens here?

Re: Archive : minus one!

Posted: Wed Dec 01, 2021 1:57 pm
by Fabien
Minus one… and minus two !

The statistic plugin of my site says : 1093 entries and 3683 commentaries.
But the admin and phpMyAdmin say : 1095 entries and 3726 commentaries…

Help!

Re: Archive : minus one!

Posted: Tue Dec 21, 2021 8:49 pm
by JaneAlora
Definitely the admi should help.

Re: Archive : minus one!

Posted: Thu Feb 17, 2022 3:34 pm
by Fabien
Up!
No solution, really?

Re: Archive : minus one!

Posted: Thu Feb 17, 2022 4:21 pm
by onli
No, sorry. But I can still confirm the issue, it it reproducible even in my blog. I will have a look.

Re: Archive : minus one!

Posted: Mon Feb 21, 2022 6:04 pm
by onli
I think I found it. The fix is a one-liner, see https://github.com/s9y/Serendipity/comm ... 8ff225ca6b.

In the include/function_entries.inc.php, on line 1764 the code was:

Code: Select all

                $group[$grouptime] = 0;
change that to:

Code: Select all

                $group[$grouptime] = 1;
This was an issue that slipped through when the code was made compatible with PHP 8.

Since you already use 2.4-beta1 you could also replace the whole function_entries.inc.php with the one from github.

Thanks a lot for the report, I hope this fixes it :)

Re: Archive : minus one!

Posted: Wed Feb 23, 2022 2:41 pm
by Fabien
Thanks a lot. The problem with the archives is solved.

The problem with the statistic plugin is not solved :
The statistic plugin of my site says : 1102 entries and 3763 commentaries.
But the admin and phpMyAdmin say : 1103 entries and 3806 commentaries.

Cheers, Fabien

Re: Archive : minus one!

Posted: Wed Feb 23, 2022 7:03 pm
by onli
There I really have no clue currently. The plugin hasn't seen updates in a long time. It gets its data directly from the database. https://github.com/s9y/additional_plugi ... istics.php has the code, and I see this there:

Code: Select all

$total_count    = serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}entries", true);
It does not seem like that number is later manipulated and that SQL query really can not be wrong. Maybe if there are entries without id? But that shouldn't be possible.