[solved] contactform plugin not sending properly

Found a bug? Tell us!!
Post Reply
Dergln
Regular
Posts: 54
Joined: Thu Jun 23, 2011 8:18 pm
Location: Hessen
Contact:

[solved] contactform plugin not sending properly

Post by Dergln »

Hey,

the plugin works fine so far, but when it comes to actually sending it seems a search is being run instead.

Code: Select all

Die Wörter Ihrer Suchanfrage müssen länger als 3 Zeichen sein. Sie können versuchen, ein "*" an diese kurzen Wörter anzuhängen (z.B. s9y*) um die Beschränkung zu umgehen.
http://dergln.de/contact.html

The suggest plugin seems to work fine though. Didn't run into any problems with it.

One thing I discovered is that on the contact page the search form differs (pic 2) from the other sites (pic 1). Pic 3 shows the actual error message. FF error console also doesn't grep anything so I would assume it is some kind of "which form gets the *SEND* focus" problem ?

Greeting
Attachments
Clipboard01.png
Clipboard01.png (13.76 KiB) Viewed 8408 times
Clipboard02.png
Clipboard02.png (20.85 KiB) Viewed 8408 times
Clipboard03.png
Clipboard03.png (15.97 KiB) Viewed 8408 times
Last edited by Dergln on Wed Jul 13, 2011 1:41 pm, edited 2 times in total.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: contactform plugin not sending properly

Post by Timbalu »

Hi

First, I would try to clean this page naming problem, having
/pages/contact.html for the suggest plugin
and
/contact.html

Give them different names. Try with suggest.html or equal.

If this does not work, try and disable quicksearch plugin for a second to find out if the others work properly.

Maybe they just work fine, but only have this #feedback search error while conflicting with serendipity_quicksearch_plugin in plugin_internal.inc

Its funny, while contactform is sent by POST and quicksearch is a GET searchTerm. But I cant see any GET like /index.php?serendipity[action]=search&serendipity[fullentry]=1&serendipity[searchTerm]=test&serendipity[searchButton]=>

Maybe there is a bad directive in htaccess or unusual general config?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Dergln
Regular
Posts: 54
Joined: Thu Jun 23, 2011 8:18 pm
Location: Hessen
Contact:

Re: contactform plugin not sending properly

Post by Dergln »

Timbalu wrote:First, I would try to clean this page naming problem, having
/pages/contact.html for the suggest plugin
and
/contact.html

Give them different names. Try with suggest.html or equal.
I installed the suggest one just for testing. The error occured 1 or 2 days before already :)
edit: Just kicked it out so we can avoid any unforseen probs with that.
If this does not work, try and disable quicksearch plugin for a second to find out if the others work properly.
I forgot to tell:
No matter if the search plugin is installed or not the searchbar stays - and works in both cases. Also no 2nd searchbar appears when it's installed so I assumed it became some kind of "standard hardcoded feature" over the years ? Also doesn't affect my particular problem if I install or uninstall it.

Same goes for the RSS Feed and RSS Comment that don't even appear as plugins in the standard installation, therefore I set them to display:none in the template css.
Timbalu wrote:Maybe there is a bad directive in htaccess or unusual general config?
Options -Multiviews (doesn't seem to affect it)
RewriteCond %{HTTP_HOST} ^www\.dergln\.de$ [NC] (error appeared before kicking www. out)
RewriteRule ^(.*)$ http://dergln.de/$1 [L,R=301] (error appeared before kicking www. out)

# DIE SPAM FAGS [cannot be cause of error]
order allow,deny
allow from all
deny from .pl
deny from .cn
deny from .ru
# BOOM! HEADSHOT! [/cannot be cause of error]

-> rest = standard s9y
See attachment for complete .htacess

edit2:
It can be accessed by either the custom permalink or by index.php?serendipity[subpage]=contactform.
seems to be outdated too. At least I just see the frontpage after loading it.
Attachments
htaccess.txt
(2.25 KiB) Downloaded 312 times
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: contactform plugin not sending properly

Post by Timbalu »

Dergln wrote:No matter if the search plugin is installed or not the searchbar stays - and works in both cases. Also no 2nd searchbar appears when it's installed so I assumed it became some kind of "standard hardcoded feature" over the years ? Also doesn't affect my particular problem if I install or uninstall it.

Same goes for the RSS Feed and RSS Comment that don't even appear as plugins in the standard installation, therefore I set them to display:none in the template css.
I think its not the contactform plugin causing the problem.
We should concentrate to the search thing.
What does the *.tpl look like in the sidebar search section?
Quicksearch class is coded in plugin_internal.inc.php and SEARCH_TOO_SHORT content message comes from genpage.inc
Dergln wrote:It can be accessed by either the custom permalink or by index.php?serendipity[subpage]=contactform.
seems to be outdated too. At least I just see the frontpage after loading it.
This may be part of your problem.
What does the contactform config say in: URL shorthand name (Backwards compatibility) ?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: contactform plugin not sending properly

Post by Timbalu »

My RewriteRules look slightly different to yours...?!

Code: Select all

# BEGIN s9y
ErrorDocument 404 /index.php
DirectoryIndex /index.php
php_value session.use_trans_sid 0
php_value register_globals off

RewriteEngine On
RewriteBase /
RewriteRule ^(archives/([0-9]+)-[0-9a-z\.\_!;,\+\-]+\.html) index.php?/$1 [NC,L,QSA]
RewriteRule ^(authors/([0-9]+)-[0-9a-z\.\_!;,\+\-]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(feeds/authors/([0-9]+)-[0-9a-z\.\_!;,\+\-]+\.rss) index.php?/$1 [NC,L,QSA]
RewriteRule ^(categories/([0-9;]+)-[0-9a-z\.\_!;,\+\-]+) index.php?/$1 [NC,L,QSA]
RewriteRule ^archives([/A-Za-z0-9]+)\.html index.php?url=/archives/$1.html [NC,L,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,NC,QSA]
RewriteRule ^feeds/(.*) index.php?url=/feeds/$1 [L,QSA]
RewriteRule ^unsubscribe/(.*)/([0-9]+) index.php?url=/unsubscribe/$1/$2 [L,QSA]
RewriteRule ^approve/(.*)/(.*)/([0-9]+) index.php?url=approve/$1/$2/$3 [L,QSA]
RewriteRule ^delete/(.*)/(.*)/([0-9]+) index.php?url=delete/$1/$2/$3 [L,QSA]
RewriteRule ^(admin|entries)(/.+)? index.php?url=admin/ [L,QSA]
RewriteRule ^archive/? index.php?url=/archive [L,QSA]
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(plugin|plugin)/(.*) index.php?url=$1/$2 [L,QSA]
RewriteRule ^search/(.*) index.php?url=/search/$1 [L,QSA]
RewriteRule ^(serendipity\.css|serendipity_admin\.css) index.php?url=/$1 [L,QSA]
RewriteRule ^index\.(html?|php.+) index.php?url=index.html [L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Dergln
Regular
Posts: 54
Joined: Thu Jun 23, 2011 8:18 pm
Location: Hessen
Contact:

Re: contactform plugin not sending properly

Post by Dergln »

Timbalu wrote: What does the *.tpl look like in the sidebar search section?

Code: Select all

<div id="search">
                <h2>{$CONST.QUICKSEARCH}</h2>

                <form id="searchform" name="searchform" action="{$serendipityHTTPPath}{$serendipityIndexFile}" method="get">
                    <input type="hidden" name="serendipity[action]" value="search" />
                    <input class="text" type="text" name="serendipity[searchTerm]" id="serendipityQuickSearchTermField" value="" />
                    <input class="submit" type="image" name="serendipity[searchButton]" src="{$serendipityHTTPPath}templates/{$template}/img/icons/search.gif" value="{$CONST.QUICKSEARCH}" />
                </form>
                {serendipity_hookPlugin hook="quicksearch_plugin" hookAll="true"}
            </div><!-- /search -->
I just kicked it out of the index.tpl and the contactform works. So you were definitely right about the contact plugin not being the problem.
Timbalu wrote: This may be part of your problem.
What does the contactform config say in: URL shorthand name (Backwards compatibility) ?
What's the use of it ? Never configured anything like that before. ATM it's "contact", tried stuff like /contact.html before but it didn't seem to do anything. But that might of course just be because I don't know what it SHOULD do ;)
Timbalu wrote:My RewriteRules look slightly different to yours...?!
Maybe some plugins alter the basic ones. I myself did not.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: contactform plugin not sending properly

Post by Timbalu »

The small search field has

Code: Select all

<div id="search">
<h2>Suche</h2>
<input type="hidden" value="search" name="serendipity[action]">
<input id="serendipityQuickSearchTermField" class="text" type="text" value="" name="serendipity[searchTerm]">
<input class="submit" type="image" value="Suche" src="/templates/base/img/icons/search.gif" name="serendipity[searchButton]">
</div>
missing the <form ... /form>,
while the big one has it set

Code: Select all

<div id="search">
<h2>Suche</h2>
<form id="searchform" method="get" action="/index.php" name="searchform">
<input type="hidden" value="search" name="serendipity[action]">
<input id="serendipityQuickSearchTermField" class="text" type="text" value="" name="serendipity[searchTerm]">
<input class="submit" type="image" value="Suche" src="/templates/base/img/icons/search.gif" name="serendipity[searchButton]">
</form>
</div>
So I think the missing form part is the problem causing the SEARCH_TOO_SHORT error, when sending contactform data. But I am still not able to tell you, why you have no form in there...


with http://dergln.de/index.php?serendipity[subpage]=contact
you can reach your contactform to work with systems not using mod-rewrite.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: contactform plugin not sending properly

Post by Timbalu »

I think I found the main reason....
Back to start.... :wink:
The contactform is missing the closing </form> element!
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Dergln
Regular
Posts: 54
Joined: Thu Jun 23, 2011 8:18 pm
Location: Hessen
Contact:

Re: contactform plugin not sending properly

Post by Dergln »

So I think the missing form part is the problem causing the SEARCH_TOO_SHORT error, when sending contactform data. But I am still not able to tell you, why you have no form in there...
Interesting: You only get that "without form"-code when you select the search field.
If you look at the code of the whole page you see that the correct code is listed and there is no sign of another code.
Why does this even differ ? I must admit I'm not much into Webdesign over the experienced basics, but it makes no sense to me. Shouldn't the *whole* code not include the small part displayed on a page ??? *confused* :?

I also just added the search plugin 2 times to the sidebar. Nothing appears nowhere...
Told s9 to check files (just for fun) and NOW I get told plugin_internal.inc.php and genpage.inc are broken. Upped them, check is ok again (size didn't even differ 1 bit).

Still no effect. Somehow the search plugin doesn't get implemented at all - is it just an abandoned piece of code just hanging around in the standard plugins that gets ignored anyway because of the hardcoded one ?
with http://dergln.de/index.php?serendipity[subpage]=contact
you can reach your contactform to work with systems not using mod-rewrite.
Thanks for explaining :)

edit:
Timbalu wrote:I think I found the main reason....
Back to start.... :wink:
The contactform is missing the closing </form> element!
will instantly look into this :D
Dergln
Regular
Posts: 54
Joined: Thu Jun 23, 2011 8:18 pm
Location: Hessen
Contact:

Re: contactform plugin not sending properly

Post by Dergln »

Dergln wrote:
Timbalu wrote:I think I found the main reason....
Back to start.... :wink:
The contactform is missing the closing </form> element!
will instantly look into this :D
I can't seem to find the reason for this.
plugin_contactform.tpl has </form> included...
<div class="serendipityCommentForm">
<a id="serendipity_CommentForm"></a>
<form id="serendipity_comment" action="{$commentform_action}#feedback" method="post">
<div>
<input type="hidden" name="serendipity[subpage]" value="{$commentform_sname}" />
<input type="hidden" name="serendipity[commentform]" value="true" />
</div>
<table border="0" width="100%" cellpadding="3">
<tr>
<td class="serendipity_commentsLabel"><label for="serendipity_commentform_name">{$CONST.NAME}</label></td>
<td class="serendipity_commentsValue"><input type="text" id="serendipity_commentform_name" name="serendipity[name]" value="{$commentform_name}" size="30" /></td>
</tr>

<tr>
<td class="serendipity_commentsLabel"><label for="serendipity_commentform_email">{$CONST.EMAIL}</label></td>
<td class="serendipity_commentsValue"><input type="text" id="serendipity_commentform_email" name="serendipity[email]" value="{$commentform_email}" /></td>
</tr>

<tr>
<td class="serendipity_commentsLabel"><label for="serendipity_commentform_url">{$CONST.HOMEPAGE}</label></td>
<td class="serendipity_commentsValue"><input type="text" id="serendipity_commentform_url" name="serendipity[url]" value="{$commentform_url}" /></td>
</tr>

<tr>
<td class="serendipity_commentsLabel"><label for="serendipity_commentform_comment">{$plugin_contactform_message}</label></td>
<td class="serendipity_commentsValue">
<textarea rows="10" cols="40" id="serendipity_commentform_comment" name="serendipity[comment]">{$commentform_data}</textarea><br />
<!-- This is where the spamblock/Captcha plugin is called -->
{serendipity_hookPlugin hook="frontend_comment" data=$commentform_entry}
</td>
</tr>

<tr>
<td>&#160;</td>
<td><input type="submit" name="serendipity[submit]" value="{$CONST.SUBMIT_COMMENT}" /></td>
</tr>
</table>
</form>
</div>
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: contactform plugin not sending properly

Post by Timbalu »

Yes, I expect it does.... but the one shown on your page is different, it might come from commentform.tpl
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Dergln
Regular
Posts: 54
Joined: Thu Jun 23, 2011 8:18 pm
Location: Hessen
Contact:

Re: contactform plugin not sending properly

Post by Dergln »

looks normal to me.
Attachments

[The extension tpl has been deactivated and can no longer be displayed.]

Dergln
Regular
Posts: 54
Joined: Thu Jun 23, 2011 8:18 pm
Location: Hessen
Contact:

Re: contactform plugin not sending properly

Post by Dergln »

BAM!

works :mrgreen:

The plugin.contactform.tpl of the plugin was ok, the one of the template was were "</form>" was missing.

Affected template is "base". Who puts the fix up on the server ? Garv ?

And of course: Thanks for the great help 8)
Last edited by Dergln on Wed Jul 13, 2011 1:45 pm, edited 1 time in total.
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: contactform plugin not sending properly

Post by Timbalu »

It looks like we are getting near it....
I see, the tpl has the closing form element, but this is your delivered source code

Code: Select all

<!-- ENTRIES START -->
    <div id="formsblock" class="clearfix">
    <h3 class="hi">Kontaktformular</h3>


    <div><p>*** ZURZEIT BUGGY ***</p>
<p>*** BITTE SOLANGE EMAIL AUS IMPRESSUM BENUTZEN - DANKE :) ***</p>

<p>Jede Anfrage wird so bald wie möglich beantwortet - meistens noch am selben Tag.</p></div>

<!-- This whole commentform style, including field names is needed -->
<!-- for Captchas. The spamblock plugin relies on the field names  -->
<!-- [name], [email], [url], [comment]!                            -->

    <div class="serendipityCommentForm">
        <a id="serendipity_CommentForm"></a>
        <form id="commentform" action="http://dergln.de/index.php#feedback" method="post">
        <div>
            <input type="hidden" name="serendipity[subpage]" value="/contact.html" />
            <input type="hidden" name="serendipity[commentform]" value="true" />

        </div>
        <p><input type="text" id="serendipity_commentform_name" name="serendipity[name]" value="" size="40" />
           <label for="serendipity_commentform_name">Name</label></p>
        <p><input type="text" id="serendipity_commentform_email" name="serendipity[email]" value="" size="40" />
           <label for="serendipity_commentform_email">E-Mail</label></p>
        <p><input type="text" id="serendipity_commentform_url" name="serendipity[url]" value="" size="40" />
           <label for="serendipity_commentform_url">Homepage</label></p>

        <p><textarea rows="10" cols="60" id="serendipity_commentform_comment" name="serendipity[comment]"></textarea></p>
        <div class="serendipity_commentDirection serendipity_comment_spamblock">Die angegebene E-Mail-Adresse wird nicht dargestellt, sondern nur für eventuelle Benachrichtigungen verwendet.</div><input type="hidden" name="serendipity[token]" value="a08157c8b67f89f82422a8cd5eddc13e" />

        <p><input class="floatl" id="submit" type="submit" name="serendipity[submit]" value="Kommentar abschicken" /></p>
    </div>
</div>

            
    <div class="serendipity_entryFooter clearfix" style="text-align: center">
            
    
    </div>

<!-- ENTRIES END -->
which, you see, is missing the one.
You should investigate why. It looks like a mix between plugin_contactform.tpl (the upper first part) and the commentform.tpl (starting with <p>)

I see you found the one.
Is base an official template?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Dergln
Regular
Posts: 54
Joined: Thu Jun 23, 2011 8:18 pm
Location: Hessen
Contact:

Re: contactform plugin not sending properly

Post by Dergln »

Timbalu wrote:Is base an official template?
With over two weeks that memory has been kicked out of my brain - sorry :)

For I did not find it in the templates I would assume it's not :)

Then we'll just set this as fixed and that's it. Thanks again ;)
Post Reply