Download & Extend

Undefined indexes in guestbook_form_entry_form_submit()

Project:Guestbook
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

As anonym user I tried to add a site guestbook entry:

Notice: Undefined index: anonemail guestbook_form_entry_form_submit() in function (/home/o2981/web/go-na.hu/new2/profiles/media_dev/modules/guestbook/guestbook.module row 625).
Notice: Undefined index: anonwebsite guestbook_form_entry_form_submit() in function (/home/o2981/web/go-na.hu/new2/profiles/media_dev/modules/guestbook/guestbook.module row 626).

I realyzed that the issue disappers if I enable the following fields in the guestbook configuration:

"Anonymous poster fields
E-mail
Website
Additional information that anonymous posters may supply."

Comments

#1

Any workaround to not force anonymous user to give email/webpage detail?

#2

I think this bug simply has been around since at least 6.x-2.0. It has been reported early in the Guestbook D7 cycle by @Michèle in #1014194: Port Guestbook to Drupal 7.
Can't do a patch right now, but I will later unless somebody else beats me to it.

#3

Status:active» needs review

This patch should fix the bug and preserve D6 behavior.
Please test. Those of you that don't have git available can try something like "patch -p1 < ~/guestbook-error-message-1386136-3.patch".

AttachmentSize
guestbook-error-message-1386136-3.patch 1.41 KB

#4

Works fine, thanks!

#5

Guestbook should follow the implementation of core's Comment module with regard to this.

This should also be backported to D6.

AttachmentSize
guestbook.anonymous-fields.5.patch 2.61 KB

#6

#5 allows to dramatically simplify the form submit handlers. Didn't notice that earlier.

#7

Yeah, #5 is just what the doctor ordered. Let's commit this in a day or two.

#8

Title:Error message» Undefined indexes in guestbook_form_entry_form_submit()
Version:7.x-2.x-dev» 6.x-2.x-dev

Pushed #5 to 7.x-2.x. Here's a patch for 6.x-2x.

AttachmentSize
guestbook.anonymous-fields.8.patch 2.7 KB

#9

Status:needs review» reviewed & tested by the community

Thanks!

#10

Status:reviewed & tested by the community» fixed

Thanks all! Pushed to 6.x-2.x.

A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.

#11

Status:fixed» closed (fixed)

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

nobody click here