Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2020-05-01 12:01:09

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,328
Website

Re: txt_quote_single_close left after <txp:yield escape="textile" />

etc wrote #322778:

I’m out of luck trying to reproduce it. A plugin is loaded from cache, but everything still works fine in my dev setup (it’s 4.8.1-dev though).

That’s odd. Maybe it’s something else, or a combination of factors. Did you try with com_connect, btw? That triggers it for me on 4.8.1-dev.

Edit: although it’s not a clean build of 4.8.1… it’s full of junk. This is the same site that misbehaves with smd_tags, while a clean install works fine with it. So, uhh, dunno.

Last edited by Bloke (2020-05-01 12:07:54)


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

#22 2020-05-01 13:03:10

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,328
Website

Re: txt_quote_single_close left after <txp:yield escape="textile" />

Nope. Confirmed on a clean build. In fact, in this case it doesn’t matter if the article is set to parse Textile or Leave Text Untouched. I still get the erroneous txt_quote_single_open showing up when used directly inside parse().

This is weird. Steps to reproduce:

1) Install 4.8.1-dev
2) Make a form called ‘test’ with this content:

<txp:php>
echo parse('<txp:yield escape="textile" />');
echo gTxt('txt_quote_single_open');
</txp:php>

3) Create an article and put this content in it:

Some *bold* text.

FORM CONTENT:
<txp::test>
O'key 'doc' !
</txp::test>

ARTICLE CONTENT:
==<txp:php>
echo("O'keys 'doc' !").br;
echo gTxt('txt_quote_single_open');
</txp:php>== 

4) Create a directory somewhere to house plugins cache, drop com_connect.php in there.
5) Visit prefs panel and give it the location of your plugin cache dir above.
6) View the article on the front end.

Expected:

Some bold text.

FORM CONTENT:


O’key ‘doc’ !
‘

ARTICLE CONTENT:
O'keys 'doc' !
‘

Actual:



Some bold text.

FORM CONTENT:


O’key ‘doc’ !
txt_quote_single_open

ARTICLE CONTENT:
O'keys 'doc' !
txt_quote_single_open

7) Remove the com_connect.php plugin or rename its extension, or take out the plugin_cache_dir pref.
8) Refresh the article on the front end. Result: correct interpretation of the quote character inside parse().
9) Reinstate the com_connect.php plugin / plugin_cache_dir pref
10) Edit article to Leave Text Untouched
11) Refresh the article again on the front end.
12) Result the Form content is also not parsed correctly and outputs txt_quote_single_opendoctxt_quote_single_close.

*scratches head* Baffled.

Last edited by Bloke (2020-05-01 13:06:10)


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

#23 2020-05-01 14:16:37

etc
Developer
Registered: 2010-11-11
Posts: 3,651
Website

Re: txt_quote_single_close left after <txp:yield escape="textile" />

Removing $plugin['textpack'] from plugins code seems to fix the problem. Weirdo

Offline

#24 2020-05-01 14:45:00

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,328
Website

Re: txt_quote_single_close left after <txp:yield escape="textile" />

etc wrote #322781:

Removing $plugin['textpack'] from plugins code seems to fix the problem. Weirdo

So it’s a Textpack import issue. Hmmm. That means either the realtime Textpack merge routine is bunked (probably) or plugin load. My money’s on the former, since a) I wrote it, and b) if it was the latter then the effect would probably be noticed after regular plugin install, which is not the case here. Drat.


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

#25 2020-05-01 14:57:33

etc
Developer
Registered: 2010-11-11
Posts: 3,651
Website

Re: txt_quote_single_close left after <txp:yield escape="textile" />

Nope, I’m guilty too. There are two problems with cache-loaded plugins:

  1. they can populate text strings before core which then considers the task is ‘done’
  2. if forced (via load_lang()), core replaces the whole pack with the db one, dumping all previously loaded strings, unless they are saved in (deprecated) global $textarray.

There is no problem as long as no cache plugin contains textpacks.

Time for 4.8.1..

Offline

#26 2020-05-01 15:31:20

etc
Developer
Registered: 2010-11-11
Posts: 3,651
Website

Re: txt_quote_single_close left after <txp:yield escape="textile" />

I have committed a quick patch, please test. Sorry for the hassle.

Offline

#27 2020-05-01 15:53:39

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 7,905
Website

Re: txt_quote_single_close left after <txp:yield escape="textile" />

david@druna.cz wrote #322777:

Thanks for the fast reaction, looking forward to a bugfix :)

One last observation (which is probably what you mentioned) – with the following code inside an article (textile enabled, which shouldn’t make a difference in this case)

<txp:variable name="abc" value="O'key 'doc' !" />...

the following gets displayed

O’key txt_quote_single_opendoctxt_quote_single_close !...

I think that has to do with "O'key 'doc' !", where the single opening and closing of the quotes are not recognised. Try "O&#x27;key 'doc' !".


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
I do my best editing after I click on the submit button.

Offline

#28 2020-05-01 17:01:08

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,328
Website

Re: txt_quote_single_close left after <txp:yield escape="textile" />

etc wrote #322784:

I have committed a quick patch, please test. Sorry for the hassle.

That has certainly fixed it, nice one. Will do more testing later.

Soooo, do we un-deprecate $textarray?


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

#29 2020-05-01 19:16:55

etc
Developer
Registered: 2010-11-11
Posts: 3,651
Website

Re: txt_quote_single_close left after <txp:yield escape="textile" />

Bloke wrote #322786:

Soooo, do we un-deprecate $textarray?

Not publicly, we are a serious cms!

There is another small issue with textile: we seem to use Netcarver’s parser when saving an article, but textile in escape calls its Textpattern extension. The difference is mainly quotes: 'quote_single_open' => '&#8216;' in the former vs 'quote_single_open' => gTxt('txt_quote_single_open') in the latter. (How) should we fix it?

Offline

#30 2020-05-01 21:43:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,328
Website

Re: txt_quote_single_close left after <txp:yield escape="textile" />

etc wrote #322787:

we seem to use Netcarver’s parser when saving an article, but textile in escape calls its Textpattern extension… (How) should we fix it?

I guess we should be consistent. I presume the entire reason we use gTxt() is to allow for l10n variations in quoting schemes, so it makes sense to use that version.

Any backwards compatibility issues if we swap the call out? Guess there might be some, but if it’s only swapping quotes out and only affects articles that are saved – and using gTxt() will result in more accurate results for international visitors – then I don’t see anyone complaining about the move.


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

Board footer

Powered by FluxBB