I note is says the following on the overview tab:

Note: The counts on this page may differ from the ones on the detail pages for various technical reasons.

And it's showing that my test user has no subscriptions but when you click on the Pages/Threads tab it shows the subscriptions they have. Is this issue on the overview tab a bug, just the way it is or is there something I can do to make this work?

Many thanks

Comments

salvis’s picture

When I wrote that, I had come to the conclusion that it was not feasible to get correct counts, but I don't remember the details.

You're welcome to give it a try...

davey_b’s picture

Is there much point having the overview tab then? Wouldn't it be best just to remove it?

salvis’s picture

There is an option in the admin settings to remove it.

Typically it also has user settings on it.

Showing 0 when there are in fact existing subscriptions is a glaring inconsistency — I certainly agree with that —, but it's not the typical case.

Your situation would be worth investigating to see whether the numbers can at least be improved. I thought the Overview numbers tended to be higher rather than lower than the actual counts.

davey_b’s picture

OK, that has sorted it in as much as it's taken the tab away.

If you want me to do any investigation or give you details let me know what you're looking for. I'm fairly new to drupal so not at the module development stage so I don't think I'd be able to contribute actual code hacking at this stage.

salvis’s picture

Title: Overview tab » Wrong numbers on the Overview tab

Investigating this remotely will be difficult but let's give it a try.

What numbers are you seeing on the Overview page and what counts are you getting on the other pages?

davey_b’s picture

I am getting Zero in the overview tab and the correct amount (3 or 4 for the user I'm testing it with) on the other pages.

salvis’s picture

Name the "other pages" where this occurs. I don't want to stab in the dark.

davey_b’s picture

It shows the correct number of subscriptions in the "Pages/Threads" tab.

salvis’s picture

Sorry, but please name a tab where it's not correct. I don't want to pick one that might later turn out to be one that happens to work...

davey_b’s picture

The tab that is not correct is the "Overview" tab.

salvis’s picture

Category: support » bug
Status: Active » Needs work

I see the problem, need to investigate...

davey_b’s picture

Ok, let me know if there is anything I can do to help or if you want me to test something.

Thanks

salvis’s picture

Hmm, I was able to reproduce it at some point, but I cannot anymore...

jerry’s picture

FWIW, it's definitely still occurring for me on 7.x-1.0. The "Overview" tab always shows 0 for each subscription type, despite the fact the the individual subscription tabs have the correct information.

salvis’s picture

Can you please try the -dev version?

jerry’s picture

Can you please try the -dev version?

Of course. Unfortunately, the behavior turned out to be the same with the dev version on my system.

Let me know if there's anything I can do from here to help you track it down.

salvis’s picture

Version: 7.x-1.0 » 7.x-1.x-dev

Short of debugging subscriptions_page_user_overview() in subscriptions.admin.inc I don't know what to do.

This requires reproducing the issue...

karing’s picture

I'll have a look. I still have a 7.x-1.0 on a test site.

Starting with:

Overview:

Pages/Threads 1
Content Types 1
Categories 0
Blogs 0

Individual Tabs: numbers agree with what's in Overview tab.

1. Adding a Category subscription in Individual tab -> Overview:
Categories 1

2. Adding a Content type subscription from a node -> Subscribe fieldset ->
Back to Overview page
Content Types 2

So, this all adds up.

Are your test users getting subscription notifications for the subscriptions that are not included in the numbers in the Overview tab?

jerry’s picture

Short of debugging subscriptions_page_user_overview() in subscriptions.admin.inc I don't know what to do.

OK, I'm happy to do that.

The problem is at line 389 of that file (referencing the dev version here). If the Blog Subscriptions UI module is enabled, the overview tab works as expected. If not, the values displayed are always 0. The reason is that the module_invoke_all() routine overwrites the contents of the $counts array whether a matching hook routine was found or not. If one is found, as when the blog submodule is enabled, it returns a valid counts array. If not, it returns an empty array, wiping out the values that had been calculated above. One simple workaround is to use a temporary return variable and conditionally replace the original with it.

salvis’s picture

Title: Wrong numbers on the Overview tab » All-zero counts on the Overview tab, replace broken hook_count_user_subscriptions() with hook_subscriptions_counts_alter()
Status: Needs work » Fixed

Great, thank you, jerry!

It turns out that hook_count_user_subscriptions() was completely broken. It worked only if it was implemented exactly once.

I've replaced it with hook_subscriptions_counts_alter(), which should work correctly now.

Pushed to the -dev version (give it up to 12h to be repackaged).

Please try it out and let us know what you find.

jerry’s picture

Looks good from here.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.