Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

  1. Index
  2. » Archives
  3. » Plug-in: zem_contact_reborn

#616 2006-11-13 08:57:26

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

@rohner, I’m working on a new version (available for testing this week) which already includes a fix for this html escaping bug.

@jstubbs, can you give a detailed example/description the problem you have with foreign characters you have. I’d like to fix that.

Might as well post a list of bugs in the current version that should be fixed in the next one
  • text in the body of emails is no longer html-escaped, which matches the content type used (text/plain).
  • nonce-based anti-spam measure works now and also has better prevention of duplicate form submission.
  • to_form was parsed before the zem_contact form, making it impossible to let to_form base its output on anything entered by a visitor. By switching them around, you should be able to let the To address depend on something entered on the form (using it to select between pre-defined email addresses for example).
  • checking of the email address domain part would fail if checkmxrr wasn’t available and the domain itself didn’t have an A record (only an MX record). Fixed by either checking both or not checking at all. The MX check doesn’t work on windows hosts.
  • checkbox state is now remembered correctly if the form is displayed again upon error
  • subject is now properly mime-encoded if non-ascii characters were used.
  • separating showerrors and showinput should work now (fix taken from the development version by stuart/tranquillo)
  • zem_contact_submit tag can now also be a container tag, in which case it will automatically use the button element instead of an input element. This enables you to use any txp image tag inside the container.
  • selected attribute in select tag is now valid xhtml
  • use label of the radio tag in the email message instead (works better for non-usascii characters).
  • select tag now remembers previous input upon errors, even if it contains < > “ & characters
  • select tag strips newlines, carriage returns and tabs from the list attribute.
  • ignore ‘default’ when submitting a form (‘default’ is only used when displaying a new form).
  • reject invalid UTF-8 input
  • UTF-8 aware min/max checking (max check now gives error instead of truncating input)
  • automatic generation of name/id based on labels works now even if the labels don’t contain any us-ascii characters (i.e. Japanese).
  • multiple forms on a page are possible, even when using separate error and input parts.
  • more…

Last edited by ruud (2006-11-16 23:09:14)

Offline

#617 2006-11-13 13:36:48

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Plug-in: zem_contact_reborn

Hi Ruud, my first post on this subject was a year ago here

That post got a bit mangled, so I will explain it again briefly. There are 2 issues:

1. When using a select drop down box, if one of the words includes a foreign character, the form sometimes fails. If I change (which I have done) the foreign character to the HTML entity instead, then the form works

2. The resulting email sent by the form includes the HTML entities, which makes the email difficult to read

Hope that explains it! Thanks.

If you are creating/updating this plugin, can we start a new thread for it?

Also, it may be a good idea from a user perspective to remove the article send portion of zem_contact_reborn – I would think for most people just the form working well is enough. Just a thought.

Offline

#618 2006-11-13 13:44:51

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,421
Website GitHub Mastodon

Re: Plug-in: zem_contact_reborn

Ah, it’s christmas time…

My two major suggestions for zem_contact I wanted to throw in the ring are:

  1. Get rid of the single instance data store ($zem_contact_form[]) and allow more than one form per URL.
  2. Using the value of label (which is the default behaviour) as a name for the sent data items fails for int’l non-ASCII labels, so a little dumbDown() would be nice. Or even a more robust way of naming the form elements caring for longish label texts.

Offline

#619 2006-11-13 14:29:49

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

wet:
More than one form per URL can probably be done by doing an md5sum of the zem_contact attributes (excluding showerror and showinput) and $thing. If that md5sum is sent in a hidden field, it should be easy to check which form was used. Doesn’t even require an extra attribute. It just works ;)

What do you propose we use instead of $zem_contact_form[]? Having all form data available in a global variable makes it easy for other plugins to make use of it.

The label-to-name conversion already removes invalid characters. If the name is nothing but invalid characters, I’m using a base64 encoded label which is a valid name (if trailing = are removed).

Last edited by ruud (2006-11-13 14:41:54)

Offline

#620 2006-11-13 14:39:37

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

jstubbs:

1. When using a select drop down box, if one of the words includes a foreign character, the form sometimes fails. If I change (which I have done) the foreign character to the HTML entity instead, then the form works

  • How does the form fail. Does it give an error. or something else?
  • You say it fails sometimes. Is there a difference between the times when it fails and when it doesn’t. Does that depend on what you enter in the form or do you get different results (works / fails) with the same form input?
  • Does this happen in specific browsers?
  • Can you provide an example form that shows this faulty behaviour? (feel free to email me)

Last edited by ruud (2006-11-13 14:44:05)

Offline

#621 2006-11-13 18:26:26

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,421
Website GitHub Mastodon

Re: Plug-in: zem_contact_reborn

ruud wrote:

What do you propose we use instead of $zem_contact_form[]?

Though I’m not sure if I understand your question properly I’ll try to explain what bothers me: I think this global var inhibits the use of more than one form per URL, as it will mix all form elements in all forms used on one single page into one big global array. This will be confusing for the mail recipients.

A thought: Make $zem_contact a multidimensional array with one dimension being a human-readable “form identifier” (md5 won’t fit as it means nothing for an e-mail recipient). This form identifier is passed to zem_contact as an attribute value and defaults to a reasonable default for pages with just one form. On pages with more than one form its up to the user to differentiate the various forms:

<txp:zem_contact formid="subscribe-newsletter">[... form elements ...]</txp:zem_contact>[...]
<txp:zem_contact formid="order-message">[... form elements...]</txp:zem_contact>

Am I getting through?

Last edited by wet (2006-11-13 18:26:44)

Offline

#622 2006-11-14 02:56:20

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Plug-in: zem_contact_reborn

Ruud,

Will get an example up for you later today. Would you like a form setup on one of my sites, or shall I send you a form in text file for you to use on your own install?

Offline

#623 2006-11-14 07:47:17

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

jstubs: send it in email. That’s easier for me to test without flooding you with test emails ;)

wet:
Even though a page can contain multiple forms, you can only submit one at a time, so if ZCR (zem_contact_reborn) recognizes which form is being submitted, ZCR can abort form processing at the very beginning if it’s the wrong form. This prevents the wrong form from filling the zem_contact_form variable. No multi-dimensional array is needed.

This leaves the question on how to recognize which form ZCR should process. You suggest an extra attribute. The approach I want to take is to recognize this automatically. The md5 hash would not be shown to the email recipient. Same as the nonce, which also isn’t visible to end users.

Offline

#624 2006-11-14 07:49:35

wet
Developer Emeritus
From: Vöcklabruck, Austria
Registered: 2005-06-06
Posts: 3,421
Website GitHub Mastodon

Re: Plug-in: zem_contact_reborn

ruud wrote:

The approach I want to take is to recognize this automatically.

Ah, now I understand. Definitely a better approach.

Offline

#625 2006-11-17 23:57:29

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

Those who want to test, grab a copy here and let me know if you find bugs that need fixing.
If no bugs are found, I’ll do a proper announcement in a new topic after the weekend:
zem_contact_reborn
zem_contact_lang

See page 62 of this topic for the list of bugs that this version aims to fix.

PS. this version works in both 4.0.3 and 4.0.4
PPS. Destry: the name stays ‘zem_contact_reborn’

Last edited by ruud (2006-11-26 21:36:05)

Offline

#626 2006-11-18 00:09:03

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,912
Website

Re: Plug-in: zem_contact_reborn

ruud wrote:

I’ll do a proper announcement in a new topic after the weekend

At last (a new thread)…

So, does this call for a new name too, like zem_contact_reincarnation?

Last edited by Destry (2006-11-18 00:09:30)

Offline

#627 2006-11-18 00:15:04

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Plug-in: zem_contact_reborn

Ruud,
I’m not exactly sure what you’re needing testing on as I haven’t followed the latest bugs?
I am so blind! I’ll look through those bugs :)
I do see that the name and email ids were changed so it broke my styling. I don’t know if that was intentional or not. I have an id on the name input as id=“qWW91ciBOYW1l” (for instance)

What else do you need checking against?

All the error stuff seems to be working.

Here’s the setup I have:

<code> <div class=“comments-wrapper”>
<txp:zem_contact to=“myemail@gmail.com” thanks_form=“contact_thanks” >
<p><txp:zem_contact_select label=“Deliver To” selected=“AnnMarie Schultz – Admin.” list=”,AnnMarie Schultz – Admin./Bookkeeper,Geoff Bradford – Lead Pastor,Steve Huber – Pastor of Church Planting, Steve Lutz – Pastor of Campus Ministry, David Braud – Director of Music and Arts, Nick – Intern, Christine Edwin – Finances, Mercy Team” break=”“ /></p>
<p><txp:zem_contact_text label=“Your Name” break=”“ /></p>
<p><txp:zem_contact_email label=“Your Email” break=”“ /></p>
<p><txp:zem_contact_textarea label=“Message” break=”“ /></p>
<p><txp:zem_contact_submit label=“Send” break=”“ /></p>
</txp:zem_contact> </div>
</code>

:)

Matthew

Last edited by ma_smith (2006-11-18 00:15:46)


Offline

#628 2006-11-18 00:29:15

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: Plug-in: zem_contact_reborn

If you want to use the name for styling, you should explicitly set a name instead of relying on the method used to transform the label to a name. The old label->style transform didn’t always generate a valid name so I had to change it. And as it turns out, some browsers treat name/id as case-insensitive so it’ll probably change to lower-case in the final version.

Hmm… bug found: all forms have the same ID -> changing to class (to allow multiple forms per page).

Last edited by ruud (2006-11-18 00:40:08)

Offline

#629 2006-11-18 00:53:50

squaredeye
Member
From: Greenville, SC
Registered: 2005-07-31
Posts: 1,495
Website

Re: Plug-in: zem_contact_reborn

Ruud,
What are the qualifications for receiving the error: The form was already submitted, please fill out a new form.?


Offline

#630 2006-11-18 09:04:11

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Plug-in: zem_contact_reborn

Ruud, testing seems to be going ok so far. Have not tried yet with foreign characters but will do so later.

After updating the plugin on various sites, then going to test the forms, I do get a lot of “we do not accept spam thank you” messages. If I wait 5 minutes or so, then enter the same data, the form submits. The data entered is usually my name and email along with a test message, nothing special.

FYI.

Offline

  1. Index
  2. » Archives
  3. » Plug-in: zem_contact_reborn

Board footer

Powered by FluxBB