Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#301 2021-07-26 16:34:40

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 573
Website GitHub

Re: com_connect - form and contact mailer

Thanks Stef,

I’ve just found out: If you set break to a value, the default attribute is parted by this break value. So the default value is somewhere handled as list and then outputted after a whole list-array-split-join process.

Offline

#302 2021-07-26 16:40:18

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

Re: com_connect - form and contact mailer

Ah yeah. Might be because empty break is being treated as “default list separator” which is comma.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#303 2021-07-26 16:55:02

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 573
Website GitHub

Re: com_connect - form and contact mailer

Hm, but where is this applied on the default attribute?

Offline

#304 2021-07-26 16:57:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

Re: com_connect - form and contact mailer

trenc wrote #331146:

Hm, but where is this applied on the default attribute?

Probably in core’s atts handler, although it might be in the plugin’s lAtts().

If memory serves, it depends what’s passed in. If we pass null it might use the default but if we pass in "" then it might use it verbatim. Or perhaps vice versa. I’d have to refresh my memory. Or Oleg might chime in.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#305 2021-07-26 17:01:30

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 573
Website GitHub

Re: com_connect - form and contact mailer

Ah yes,
if I set the break attribute directly in the plugin code to null will do as workaround.

Offline

#306 2021-07-26 17:43:04

etc
Developer
Registered: 2010-11-11
Posts: 5,157
Website GitHub

Re: com_connect - form and contact mailer

Bloke wrote #331147:

Probably in core’s atts handler, although it might be in the plugin’s lAtts().

Rather the latter, since com_connect_lAtts() does not handle the global break introduced recently.

Offline

#307 2021-07-26 20:42:20

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,436
Website GitHub

Re: com_connect - form and contact mailer

etc wrote #331149:

Rather the latter, since com_connect_lAtts() does not handle the global break introduced recently.

In which case the plugin needs fixing to do so.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#308 2021-08-01 06:11:17

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,162
Website

Re: com_connect - form and contact mailer

Textpattern 4.8.7 / PHP 8.0.2
Latest version of the plugin: 4.7.0+ (PHP file downloaded from Github)

Issue: email subject line failure.

It appears something is not parsed correctly when trying to generate a custom subject line with a form (nearly verbatim from the help file). The “subject” <select /> tag outputs correctly when used in the body of the email.

<txp:php>
    global $com_connect_form;
    echo 'Contact [site name] - ' . $com_connect_form['Subject'];
</txp:php>

Output: Contact [site name] - array.

In debug mode, we get the whole error report inserted in the subject line (see below) – complete with entities etc.

<txp:com_connect_select break="" class="" label="Subject" name="subject">
<txp:com_connect_option class="" label="{Select one}" selected />
<txp:com_connect_option class="" label="Some" value="Some" />
<txp:com_connect_option class="" label="Thing" value="Thing" />
<txp:com_connect_option class="" label="Or other" value="Or other" />
</txp:com_connect_select>

Debug mode output (copied from raw source of message):

Subject: <pre dir="auto">Tag error: <b>&lt;txp:php&gt;     global $com_connect_form;     echo &#039;Contact [site name] - &#039; . $com_connect_form[&#039;Subject&#039;]; &lt;/txp:php&gt;</b> -> <b> Warning: Array to string conversion while parsing form <strong>contact_subject</strong> on page <strong>default</strong></b></pre> <pre class="backtrace" dir="ltr"><code>textpattern/publish/taghandlers.php:4365 eval() php() textpattern/vendors/Textpattern/Tag/Registry.php:140 call_user_func() textpattern/lib/txplib_publish.php:544 Textpattern\Tag\Registry-&gt;process() textpattern/lib/txplib_publish.php:406 processTags() textpattern/lib/txplib_misc.php:3414 parse() textpattern/plugins/com_connect/com_connect.php:227 parse_form() com_connect() textpattern/vendors/Textpattern/Tag/Registry.php:140 call_user_func() textpattern/lib/txplib_publish.php:544 Textpattern\Tag\Registry-&gt;process()</code></pre>Contact [site name] - Array

Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#309 2021-08-01 19:30:33

etc
Developer
Registered: 2010-11-11
Posts: 5,157
Website GitHub

Re: com_connect - form and contact mailer

Bloke wrote #331150:

In which case the plugin needs fixing to do so.

Maybe done, but needs someone to test.

Offline

#310 2021-08-02 05:37:47

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,162
Website

Re: com_connect - form and contact mailer

etc wrote #331183:

Maybe done, but needs someone to test.

hmmm… as I am messing with a contact form, a quick test. Odd this:

Input:

<txp:com_connect_select break="" class="" label="Subject" name="subject">
...
<txp:com_connect_option class="" label="Something" value="Something" />
...
</txp:com_connect_select>

expected output:

<option value="Something" label="Something">Something</option>

actual output:

Something<br />
<option value="Something" label="Something">Something</option>

Note the loose Something<br /> at the start of line.


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#311 2021-08-02 07:26:44

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,081
Website GitHub Mastodon Twitter

Re: com_connect - form and contact mailer

What kind of output does <txp:com_connect_option class="" label="" value="Something" /> return?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#312 2021-08-02 07:43:49

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,162
Website

Re: com_connect - form and contact mailer

colak wrote #331185:

What kind of output does <txp:com_connect_option class="" label="" value="Something" /> return?

Output in both my working copy and the most recent patched version (Olegs patch):

<option value="Something"></option>

(when you click/tap open the select, it shows a blank line, as expected given the outputted HTML)


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

Board footer

Powered by FluxBB