Closed (fixed)
Project:
Subscriptions
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Oct 2012 at 19:31 UTC
Updated:
12 Nov 2012 at 02:40 UTC
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
Comment #1
salvisWhen 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...
Comment #2
davey_b commentedIs there much point having the overview tab then? Wouldn't it be best just to remove it?
Comment #3
salvisThere 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.
Comment #4
davey_b commentedOK, 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.
Comment #5
salvisInvestigating 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?
Comment #6
davey_b commentedI 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.
Comment #7
salvisName the "other pages" where this occurs. I don't want to stab in the dark.
Comment #8
davey_b commentedIt shows the correct number of subscriptions in the "Pages/Threads" tab.
Comment #9
salvisSorry, 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...
Comment #10
davey_b commentedThe tab that is not correct is the "Overview" tab.
Comment #11
salvisI see the problem, need to investigate...
Comment #12
davey_b commentedOk, let me know if there is anything I can do to help or if you want me to test something.
Thanks
Comment #13
salvisHmm, I was able to reproduce it at some point, but I cannot anymore...
Comment #14
jerry commentedFWIW, 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.
Comment #15
salvisCan you please try the -dev version?
Comment #16
jerry commentedOf 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.
Comment #17
salvisShort of debugging subscriptions_page_user_overview() in subscriptions.admin.inc I don't know what to do.
This requires reproducing the issue...
Comment #18
karingI'll have a look. I still have a 7.x-1.0 on a test site.
Starting with:
Overview:
Individual Tabs: numbers agree with what's in Overview tab.
1. Adding a Category subscription in Individual tab -> Overview:
Categories 12. Adding a Content type subscription from a node -> Subscribe fieldset ->
Back to Overview page
Content Types 2So, 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?
Comment #19
jerry commentedOK, 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.
Comment #20
salvisGreat, 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.
Comment #21
jerry commentedLooks good from here.