contact form plugin within zenpage 'page'

I am trying setup the contact_form plugin within a zenpage 'page', I have `<?php printContactForm(); ?>` in the code block,
I fill in the fields and send but get this error:

Fatal error: Call to undefined function: getbarepagetitle() in /path to zenphoto install/themes/zenpage-default/pages.php on line 5

I am using zenphoto 1.2.1 [2635] zenpage 1.0.0 [2635]

Thanks
«1

Comments

  • acrylian Administrator, Developer
    I am sorry, I can't reproduce that. Please try reinstalling Zenpage, that function should be there.
  • I have reinstalled zenpage but still get the same error. I do have my zenphoto install in root, could that have anything to do with it? I have changed the RewriteBase to / in htaccess. Everything else seems to work fine so far.
  • did you activate the contact form plugin?
  • Yes, the plugin is activated and the form appears on the zenpage 'page', I get the error after the form is sent.
  • acrylian Administrator, Developer
    I am sorry, I did test that myself but it works for me. I don't see what the getBarePageTitle() function has to do with the contact form at all. What php version do you have? Also it would help to see the site itself.
  • Its php 4.4.4 and mysl server 5.0.51a and the page is at Contact Page I have the page 'published' for now but let me know when you have tried it so I can 'un-publish' it.

    Thanks
  • acrylian Administrator, Developer
    The contact form issue may be related to the usage of php sessions on your site, but I sadly still do not have any clue about it.
    The servers seems generally a little slow and I got once a mysql error for unknown reasons.

    Maybe one of my fellow devs does have any idea.
  • OK thanks for looking, I'll leave the contact page 'published' for now, in case anyone else has any idea, For what its worth I have ran contact forms before on this site and they ran fine. The previous 'incarnation' of the site also used wordpress with no issues.

    Later I'll try setting up the contact form on a non zenpage page and see if it works.

    Yes the servers do seem a little slow at the moment, I actually host which servage in Germany:-) I'm in the UK

    Also I noticed that on the contact form plugin options, if I omit certain fields they still appear on the form. I did see another thread about this from a few weeks ago, which gave the impression it was fixed?

    Thanks again, its been really good using zenpage other than this issue, just taking me a while copying everything over from the old version of the site!
  • acrylian Administrator, Developer
    The contact form is actually not that specials or complicated that it should cause these problems... I did not expect it to cause these problems... That missing function is part of zenpage. If that is there it has to be, too. Maybe you have a typo in pages.php? (Just a guess...:-))

    The contact form plugin has been fixed in the svn version. Although we generally don't recommend taking only parts from the svn it should work with that plugin I think.
  • I have not changed or added anything to pages.php in fact I had not even looked in it till just now!
  • I setup a separate contact page within the zenpage default theme. I then put a link in the normal content section of a new 'zenpage page' calling the contact.php in the theme. The form displayed, I was able to send it and I did not get the error.

    So I guess it must be something to do with my server and putting `<?php printContactForm(); ?>` code in the codeblock on the 'zenpage page'? You would know better than me:-)

    However I now have the problem that I received no email message from the form submission at the address I set in the contact_form options.

    I guess I better look to see if there are any threads on this:-(
  • acrylian Administrator, Developer
    Seems indeed so or it is a issue of php version, although I did not find any obvious.

    Regarding the email itself there is indeed sadly already another thread...: http://www.zenphoto.org/support/topic.php?id=4062&replies=14#post-24498
    That may also be server related since the server has to sent the mail. It seems that does not work on all servers.
  • Ok I'm back to this again:-) Still getting the original error even with the updated working form. So I have been playing around (with my limited knowledge) to figure this out.

    Is it correct that if codeblock 1 is empty codeblock 2 or 3 will not display code?
  • acrylian Administrator, Developer
    Welcome back..:-) No, actually the codeblocks should work even if one is empty.
  • Just to see what would happen I took `<?php printContactForm(); ?>` out of codeblock 1 and put it in codeblock 2 when I viewed the page no form appeared, put it back in codeblock 1 viewed page, form appears.
  • acrylian Administrator, Developer
    You of course have to add codeblock 2 to your theme, too. <?php printCodeblock(<number>); ?> the default theme has only codeblock 1 if I am right and even that not everywhere.
  • OK, I didn't realise that, (that codeblocks 2 & 3 were not in the theme by default), nothing to do with the error. Back to square one then...
  • Ok, does this mean anything: I load the zenpage page with the contact form, I just fill in one of the required fields 'Name', 'E-mail', 'Enter captcha' or 'Subject', and send it, the form refreshes with the message in red telling me to fill in the required fields. Thus the form reaches the next stage as it should. But if I only fill in the required field 'Message' and send it, I get the error message the same as when sending a correctly filled in form.
  • acrylian Administrator, Developer
    I am sorry, I have no idea currently. (Also the form now sends mails for me, they strangely do not arrive correctly...).
  • I'll continue to play around with it for now, perhaps I'll just have to stick with a custom contact page, which worked from the point of view of sending the messages but I did get other problems with that, Obviously the zenpage 'contact page' is a much more elegant solution if it worked.

    Has anyone else got the contact_form plugin form working or not working in a zenpage 'page'?

    By the way, I still have the omitted fields in the plugin options showing in the form even with the latest working contact_form.

    Thanks for all your help.
  • Sorry to start yet another issue with the contact_form but...
    I'm now setting up a custom page to try and get an active contact form working.
    To make the custom page I have taken a copy of the index.php from the zenpage_default template removed everything within the content_left 'div' and put in `<?php printContactForm(); ?>`.

    The form loads, I fill out the form, press send but when the page refreshes to confirm the sending of the message, the 'page menu' is missing from the sidebar, I press confirm, the message is sent OK but again when the page refreshes the 'page menu' is missing from the sidebar, only news articles, gallery, archive and rss menus are in the sidebar.
  • acrylian Administrator, Developer
    No problem. I of course want to have that working. Although I do not understand why that would happen. Also the contact form - even if I or my server have problems with sending the mail somehow - works fine within a codeblock in the zenpage default theme here.
  • With the original 'Fatal error' I have tried everything I can think of but I still get the error. I wonder if it could be to do with the zenphoto install being in root rather than an sub folder? I guess the only way for me to find out is put a fresh zenphoto/zenpage install in a sub folder.........

    I don't get the error on my local MAMP install
  • acrylian Administrator, Developer
    I really don't know why the function should be undefined nor can I reproduce it on my server. You could try to just remove that function with `strip_tags(getPageTitle())`.....

    Also actually it should not make any difference if Zenphoto is in the root or not. But you could try....
  • Sorry where do I put `strip_tags(getPageTitle())`
  • acrylian Administrator, Developer
    Replace `getBarePageTitle` with it.
  • Presume you mean in pages.php I did that and got: Fatal error: Call to undefined function: getpagetitle() in /path to my zenphoto install/themes/zenpage-default/pages.php on line 5

    Maybe I have it in the wrong place?

    Also tried a fresh install of zenphoto/zenpage in a sub folder everything default (even a new database for the test) just with the updated contact_form plugin and still got the same error

    I guess it must be something with my hosts setup but what?
  • acrylian Administrator, Developer
    Sorrry, yes, I mean pages.php.

    Something seems not right on your server I would just guess. That function has to be there, too. Especially since I can't reproduce it. It may be a php 4 issue, since I only work on php 5, but if I don't understand it.
  • According to my host adding AddType application/x-httpd-php5 .php to my root htaccess file enables me to run php 5 (but they don't recommend it?) so I did that and php info confirms I'm now running php 5.1.1

    sorry but I still get the same error....

    I guess I'll go back to trying the custom page and see if I can figure why the 'pages menu' disappears
  • A slight development regarding the fatal error: In contact_form plugin options I changed 'required' to 'show' on the 'message' field, then when I filled in the form and sent, it reached the 'commit' phase, however then when I 'commit' and send I get the fatal error.
Sign In or Register to comment.