Closed (fixed)
Project:
Simplenews
Version:
5.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Feb 2007 at 02:59 UTC
Updated:
23 Jul 2008 at 10:56 UTC
Jump to comment: Most recent file
Comments
Comment #1
j4h8 commentedAnybody any ideas on this? Same problem here.
The blocks have the same form_id and form_token. Only the div id of the blocks are different.
Thanks in advance!
Comment #2
atrayu13 commentedI would like to add my voice to those having this problem.... if anyone has any idea how to fix this, i would greatly appreciate it!
Comment #3
number3 commentedYes, I'm having similar problems as well.
I have two newsletter blocks. When an unauthorized user subscribes to the second block the $tid passed is the taxonomy id of the first (default) newsletter and not the second one.
The printed forms are distinguished (meaning they are separate instances), however when the form gets validated/submitted, the first taxonomy id is submitted and used. So it will always send a confirmation e-mail for the wrong newsletter subscription.
I'm currently trying to fix the issue, but it would be nice if this bug was fixed by the authors.
Comment #4
mightyiam commentedCan this fix it? A bit hacky.
http://www.theenglishguy.co.uk/2006/07/25/xhtml-11-multiple-ids/
Comment #5
sutharsan commentedI agree this is a bit hacky. Did you try it?
I have no solution on this bug yet. I investigated it before but without result. I recognize the problem but looking at the frequency of request for it I postpone it to D6, in which I believe we can solve this problem.
Comment #6
mightyiam commentedI think what we are talking about is http://drupal.org/node/111719.
Comment #7
sutharsan commentedWhenever you have multiple subscription bocks on one page, simplenews always acts as if you subscribed/unsubscribed in the first newsletter block. It all comes back to the id of < form > not of the submit button. in D5 the form-id is generated by forms-api and is always equal to the form functionname. If one function generates multiple forms on the same page. At form submission there is no way to differentiate between the two forms because it is the same form (based on the id). D6 does have the possibility to route the form submission (http://drupal.org/node/144132#buttons).
Comment #8
atrayu13 commentedThank you all for the information.
Based on what you said, I put each newsletter block on it's own page, and that solved the problem.
It would be nice to be able to have all of the newsletter blocks on the same page, but this will work out just fine as well. as long as the module works.
Comment #9
tomx commentedDid someone solved this problem?
Comment #10
number3 commentedUnfortunately I wasn't able to fix it like I would have, I just made a work around it. The client I'm working for didn't want the blocks and suggested that I make a separate page to manage subscriptions to multiple newsletters. So I was kind of lucky they didn't want the blocks.
Comment #11
xen commentedI just got bitten by this, so I'll just add my thoughts...
#6: No, that's about id's, which doesn't actually affect form submission.
#7 You're on the right track, but I don't think the button routing is a solution as such.
As people has suggested, the problem is that both forms has the same form_id, which FAPI grabs the first form defined, and submits that. The problem isn't as much in the fact that it's the same form, as it is in the fact that the tid of the newsletter is embedded in the form as a '#type' => 'value', which make FAPI store it on the server and never get passed to the client.
So I though it fix it by changing it to a 'hidden' field instead, which should make FAPI grab it from the submission instead, and thereby allow the submit function to know what newsletter to subscribe to.
However, that didn't work for me, I can't figure out why, and I didn't have the time to work on it. Maybe someone else can try, and see if I was just being stupid.
Comment #12
sutharsan commentedNot that it will help you immediately, but I solved this problem for the Drupal 6 version of Simplenews. I got the solution form poll module. But poll module in Drupal 5 uses the nid from the url to identify the right form. So unfortunately that trick can not be used for the subscription block.
Comment #13
number3 commentedSutharsan, could you detail how you got the problem solved for Drupal 6? Thanks.
Comment #14
sutharsan commentedIn the block form the tid is stored in $form['#tid'] like this:
In the _submit function $tid is collected from $form['#tid'] like this:
This very same thing is not possible in Drupal 5 FAPI, but perhaps, number3, it is of some use to you.
Comment #15
sutharsan commentedThis problem has been fixed now in the 6.x-1.x-dev version. Please have a look.
The solution can not be back-ported to simplenews 5.x-1.x-dev since the solution has been made possibly by the change in forms API in Drupal 6.
Comment #16
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #17
sutharsan commentedBased on a new solution for Drupal 6 (http://drupal.org/node/273218) I was able to fix this bug in 5.x-1.x-dev too.
The patch committed and attached for reference.
Comment #18
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.