Error while saving post

Phoca Guestbook - creating guestbooks in Joomla! CMS
minosk
Phoca Member
Phoca Member
Posts: 13
Joined: 08 Mar 2011, 19:34

Error while saving post

Post by minosk »

Hi!!

I have a problem. I made a new joomla 1.6.1 installation with a Phoca Guestbook 2.0.0 RC in order to test its new features.
I'm receiving the error message "Error while saving post" while posting to the guestbook.
At the beginning I thought it was a captcha problem, but the problem stil exists even after deactivating the captcha.

Can you please help me??
Thank you in advance for your help and your great work!!!!

PS1: About the new feature "Display Form: Display/Hide". I have tried to set it to Hide and it works fine. But if you give something wrong inside the form and the verification fails, then the form is automaticaly hidding, which makes all the error messages invisible to the user.
PS2: Please add some customization to the ReCaptcha (color or even internationalization!!)
hkingman
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 08 Mar 2011, 05:26

Re: Error while saving post

Post by hkingman »

Same problem here... I installed 2.0.0RC on a 1.6.0. When I try to post, I get
Message

* Error while saving post
Looking in the language file, this is the text for "COM_PHOCAGUESTBOOK_ERROR_SAVE_ITEM'"

Grepping around in the source, it seems this is called only in controllers/phocaguestbook.php, on line 516:

Code: Select all

503                         if ($model->store($post2)) {
504                                 // Send mail to admin or super admin or user
505 
506                                 if ((int)$tmpl['send_mail'] > 0) {
507                                         PhocaGuestbookControllerPhocaGuestbook::sendPhocaGuestbookMail((int)$tmpl['send_mail'], $post2, $uri->toString(), $tmpl);
508                                 }
509 
510                                 if ($post2['published'] == 0) {
511                                         $msg = JText::_( 'COM_PHOCAGUESTBOOK_SUCCESS_SAVE_ITEM' ). ". " .JText::_( 'COM_PHOCAGUESTBOOK_REVIEW_MESSAGE' );
512                                 } else {
513                                         $msg = JText::_( 'COM_PHOCAGUESTBOOK_SUCCESS_SAVE_ITEM' );
514                                 }
515                         } else {
516                                 $msg = JText::_( 'COM_PHOCAGUESTBOOK_ERROR_SAVE_ITEM' );
517                         }
So, maybe something in the Post2 array is wrong, or something in the store function in /models/guestbook.php?

I will keep investigating...
hkingman
Phoca Newbie
Phoca Newbie
Posts: 8
Joined: 08 Mar 2011, 05:26

[SOLVED] Re: Error while saving post

Post by hkingman »

The problem was solved for me by re-enabling the title field in the settings. Apparently (big surprise here) your form must have all the fields that your guestbook model requires. And while the settings gives you the option of omitting the title field, I don't see any way to edit a guestbook such that the title field is not required. Hence the error.

Hope it helps someone.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48739
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Error while saving post

Post by Jan »

Hi, this can be set in parameters:

- displayed and not required
- displayed and required
- not displayed (automatically not required)

Jan
If you find Phoca extensions useful, please support the project
Post Reply