Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2024-10-08 02:03:44

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

[Solved] Possible file_download_link issue

TXP-dev latest, PHP 8.3.*
Create an article and add a reference to a (downloadable) file:

test 1

Some text: <txp:file_download_link id="1" />

This works correctly, it outputs a plain text path to a file with id=1: http://txpdev.local/index.php?s=file_download&id=1

test 2

 Testing something: <txp:file_download_link id="1">
    <txp:file_download_name />
    [<txp:file_download_size format="mb" decimals="2" />]
</txp:file_download_link>

This docs example too works correctly, it outputs a link to the downloadable file: <a href="http://txpdev.local/index.php?s=file_download&id=1">name of file […]

Test 3

View or download <a href="<txp:file_download_link id="1" />">the file</a> end test.

This fails or goes bonkers. Parsing errors at the closing "" in id="1": the closing quote is converted to a curly closing (U+201D) and the link eats every thing after it, until the next tag with some attributes. Output:

<a href="http://txpdev.local/index.php?s=file_download&amp;id=1“>the file</a> end test</p>

<p>Another line for testing.</p>

If I wrap that link in an inline notextile modifier (==) then it works fine.

Bug, weakness or misunderstanding on my part?

Last edited by phiw13 (2024-10-08 10:39:18)


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

Offline

#2 2024-10-08 08:53:52

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

Re: [Solved] Possible file_download_link issue

phiw13 wrote #337970:

If I wrap that link in an inline notextile modifier (==) then it works fine.

I would not look any further, it must be Textile at work. I guess the result would be the same for any tag:

View or download <a href="<txp:variable name="test" />">the file</a>

first results in

<p>View or download <a href="<txp:variable name="test" />«&gt;the file</a></p>

and then <txp:variable name="test" /> is processed.

Textile leaves proper XML tags alone, but these ‘imbricated’ txp constructions do not respect XML syntax.

Offline

#3 2024-10-08 10:38:58

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

Re: [Solved] Possible file_download_link issue

Ok, I see; thanks.

I guess that was a case of over enthusiastic expectation… notextile. works fine.

PS. I don’t even have a real use case for that particular construct atm.


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