Yesterday I've installed this module: http://drupal.org/project/guestbook
And I've done so many changes in it by now... but about hour ago I've found a bug, that came with original module!

When you making a new record in guestbook as guest, there's two fields that not necessary to fill: "E-mail" and "Website". If you fill them both, or not fill them BOTH - everything goes just fine. But if you didn't fill just one of them, then new record doesn't goes to database on submit - it's just redirects you to the same guestbook page.

Please help! My 2 days work on costumizing this module goes to hell, because I can't fix the original problem. ;(

Comments

tjodolv’s picture

If this bug actually did come with the original module, you should report an issue on the module page. Beyond that, it's hard to help without the code. Can you post the code with your changes here, so that we could have a look?

Freakmeister’s picture

Sorry, didn't know that there's a report page about issues there. I'll report it, but it seems that I'll have to wait a long time... there's also 21 different bug reports. Maybe someone else can take a look on original code and try to figure out this?

Problem is not in my changes. I use original module 6.x-1.1 now with no changes in it and it buges. I've tryed to download last development release and it doesn't have this bug, but it have 2 more - you can't delete records and you cant comment them. I dont know php very good to find the problem in this huge code with bunch of functions. All I know that it happens on submit.

tjodolv’s picture

I just downloaded the 6.x-1.1 version and tested it. I can not reproduce your problems. Submitting an entry in the guestbook works for me.

I tried submitting with:

  • Just a name and a comment.
  • Name, email and comment.
  • Name, website and comment.
  • Name, email, website and comment.

Everything works fine for me. I can also delete entries and comment on them. I did not try the dev version, but 1.1 seems to work just fine as far as I can tell. Do you have any other modules - downloaded or custom - which might cause problems?

Also, it is generally not wise to modify modules. If the module is updated in the future, and you update, you will need to redo your custom modifications all over again. It is generally better to create a separate module which hooks into this module and adds your custom functionality. This way, it is also easier to maintain the changes when the original module (Guestbook, or any other) changes in the future. If the modifications you have done are only with the way the module looks or "feels", you should simply use the theme layer to make your modifications.

I also added this comment to the issue on the Guestbook issue tracker: #664558: "E-mail" and "Website" fields bug