Gossamer Forum
Home : Products : Gossamer Links : Discussions :

[BUG] Sending Newsletter...

Quote Reply
[BUG] Sending Newsletter...

Don't know is this bug or not, but this is what happens.

When I wish to send newsletter, I click on + sign right to HOME.

Then I got displayed something like this:
Subscribers: 422 / 422 (Total/Direct)

Now, when I click on first number which represents TOTAL I got this error:

A fatal error has occured:

GT::SQL::Tree (28183): You did not pass any ID's to $tree->parent_ids() at /home/public_html/cgi-bin/links/admin/Links/Newsletter.pm line 507.

Please enable debugging in setup for more details.

This only happens on root, Home.


UnReal Network
Quote Reply
Re: [deadroot] [BUG] Sending Newsletter... In reply to
Here's a small patch to fix that:
--- Links/Newsletter.pm 6 Apr 2005 02:48:40 -0000 1.12
+++ Links/Newsletter.pm 12 May 2005 18:53:59 -0000
@@ -503,7 +503,7 @@

my $tree = $cat->tree;
- my @parents = $direct ? ($catid) : (0, @{$tree->parent_ids(id => $catid)}, $catid);
+ my @parents = $direct || $catid == 0 ? ($catid) : (0, @{$tree->parent_ids(id => $catid)}, $catid);

$nsu->select_options("ORDER BY Username");
my $subscribers = $nsu->select({ CategoryID => \@parents })->fetchall_hashref;
The Total and Direct subscribers for the root category is actually the same since total is the number of direct subscribers plus the subscribers subscribed to the category's parent.