Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Newsletter Infusion Bug Or viewpage.php bug?

Hi all,
I just installed newsletter infusion, following the instructions in the readme.txt.
Everything seems to work well escept for the main one: if a user presses subscribe or unsubscribe in the newsletter panel, then the main panel (where my home page usually stands) shows an error that says that the program is not able to retrieve the page.
I gave a look to the code in viewpage.php, hack it to show page_id, and discovered that after pressing subscribe/unsubscribe viewpage.php is called with no parameter. ("viewpage.php"wink, that is page_id is not set for this call.
If you give a look at the first lines of viewpage.php, after the includes, (I've added {} for better readability)
' ---------------
if (isset($page_id) && !isNum($page_id))
' ---------------

it seems to me that the code is ment to redirect to the main page (index.php) if page_id is set BUT it is not a number (I think it's just a sentry to avoid querying the db with a not numeric page_id).
What if, as in this case, no page_id is set?
I think this is a logical bug. I've modified the code to
' ---------------
if ((!isset($page_id)) || (isset($page_id) && !isNum($page_id)))
' ---------------
and of course, after the subscribe or unsubscribe, the main page is displayed correctly. (in my case index.php redirects to my main page and it's what I'm expecting).

In any case I think this is a bug in viewpage.php that shoul be fixed like I did, just in case some bad code calls viewpage.php with no parameter set but I'm wondering about the source of this behaveior: why newsletter infusion calls viewpage.php with page_id not set?
is this a desired behaveior or there is something strange in my setup? I mean: I'm expecting that after a subscribtion or a unsubscription, a page appears which shows a thing like "Your subscription has been activated/deactivated..." or something like this.

Any suggestion?

Thanks in advance,
Luca Biasin
BiasoSoft Sw&Hw engineering

I'm a newby in php programming (but not in programming, as I'm quite old!). I just guessed the syntax to fix the bug. Please excuse myself if I did not get the actual meaning of the code.
You're right in saying you get an error when trying to subscribe/unsubscribe whilst viewing a custom page. Its a small oversight in the file newsletter_panel.php. You need to alter the two form lines (30 & 41):

<form name='newsletter' method='post' action='".FUSION_SELF."'>

<form name='newsletter' method='post' action='".FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "")."'>

Thread Information
2 posts
2046 times
Last Post
Last updated on 14 years ago
You can view all discussion threads in this forum.
You cannot start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You cannot download attachments in this forum.