Archive : minus one!

Found a bug? Tell us!!
Post Reply
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Archive : minus one!

Post 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
Fabien Chabreuil (blog)
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Archive : minus one!

Post by onli »

I can confirm this in my own blog. Maybe some of the others have an idea what happens here?
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Re: Archive : minus one!

Post 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!
Fabien Chabreuil (blog)
JaneAlora
Posts: 1
Joined: Tue Dec 21, 2021 8:44 pm

Re: Archive : minus one!

Post by JaneAlora »

Definitely the admi should help.
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Re: Archive : minus one!

Post by Fabien »

Up!
No solution, really?
Fabien Chabreuil (blog)
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Archive : minus one!

Post by onli »

No, sorry. But I can still confirm the issue, it it reproducible even in my blog. I will have a look.
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Archive : minus one!

Post 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 :)
Fabien
Regular
Posts: 204
Joined: Wed Mar 15, 2006 1:02 pm
Location: Paris (France)
Contact:

Re: Archive : minus one!

Post 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
Fabien Chabreuil (blog)
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: Archive : minus one!

Post 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.
Post Reply