Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-10-19 10:13:38

quiris
New Member
Registered: 2015-12-31
Posts: 8

Too few arguments to function file_download_link(), 0 passed in

After upgrading Textpattern to 4.6.2 running on PHP 7.1.7 I see on site: http://old.kuratorium.kielce.pl/bip/informacje-nieudostepnione such error:

Fatal error:  Uncaught ArgumentCountError: Too few arguments to function file_download_link(), 0 passed in /bip/textpattern/publish/taghandlers.php(4344) : eval()'d code on line 1 and at least 1 expected in /bip/textpattern/publish/taghandlers.php:4794
Stack trace:
#0 /bip/textpattern/publish/taghandlers.php(4344) : eval()'d code(1): file_download_link()
#1 /bip/textpattern/publish/taghandlers.php(4344): eval()
#2 [internal function]: php(Array, 'echo file_downl...')
#3 /bip/textpattern/vendors/Textpattern/Tag/Registry.php(83): call_user_func('php', Array, 'echo file_downl...')
#4 /bip/textpattern/lib/txplib_publish.php(514): Textpattern\Tag\Registry->process('php', Array, 'echo file_downl...')
#5 /bip/textpattern/lib/txplib_publish.php(463): processTags('php', '', 'echo file_downl...')
#6 /bip/textpattern/lib/txplib_misc.php(4415): parse('<txp:text item=...')
#7 /bip/textpattern/publish/taghandlers.php(4780): parse_form('files')
#8 [internal function]: file_download(Array, NULL)
#9 /bip/textpattern/vendors/Textpattern/Tag in /bip/textpattern/publish/taghandlers.php on line 4794

Could you help me?

In that article I have such code placed: <txp:file_download id=“3” />. After removing it the error disappears.

Last edited by quiris (2017-10-19 10:19:01)

Offline

#2 2017-10-19 10:18:53

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

Re: Too few arguments to function file_download_link(), 0 passed in

Hi quiris

could you check if anything appears in your diagnostics?


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

Offline

#3 2017-10-19 10:21:19

quiris
New Member
Registered: 2015-12-31
Posts: 8

Re: Too few arguments to function file_download_link(), 0 passed in

colak wrote #307451:

Hi quiris

could you check if anything appears in your diagnostics?

Diagnostics
Pre-flight check
All checks passed!

Offline

#4 2017-10-19 10:23:08

quiris
New Member
Registered: 2015-12-31
Posts: 8

Re: Too few arguments to function file_download_link(), 0 passed in

Textpattern version: 4.6.2 (8412e32468526e075446b881d13bd9ce)
PHP version: 7.1.7
Locale: en_GB.UTF-8
PHP server API: ucgi10
RFC 2616 headers: 
Admin-side theme: hive 4.6.2

Last edited by quiris (2017-10-19 12:49:59)

Offline

#5 2017-10-19 12:34:39

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: Too few arguments to function file_download_link(), 0 passed in


aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

#6 2017-10-19 12:49:16

quiris
New Member
Registered: 2015-12-31
Posts: 8

Re: Too few arguments to function file_download_link(), 0 passed in

makss wrote #307457:

Turn off textile

Ok. It works now. But why Textpattern does not allow mix Textile and txp markup now?

Offline

#7 2017-10-19 12:58:25

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

Re: Too few arguments to function file_download_link(), 0 passed in

quiris wrote #307458:

Ok. It works now. But why Textpattern does not allow mix Textile and txp markup now?

Good catch Makss. It does but in some cases you may need to escape textile. You can wrap the txp tags in double equals. ie ==<txp:tag />==


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

Offline

#8 2017-10-19 13:00:22

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

Re: Too few arguments to function file_download_link(), 0 passed in

quiris wrote #307458:

why Textpattern does not allow mix Textile and txp markup now?

It does. It just depends on the type of markup whether you need to ‘escape’ it by either turning off Textile processing entirely, or selectively turning it off for certain markup by using a few spaces before the tag, surrounding it by ==, or put notextile. <your tag here>.

As for the reason behind the behaviour now, it could be any number of:

  • Changes to the Textile parser in recent versions.
  • Changes to the Textpattern parser in 4.6.2.
  • Changes to the way errors are reported in Textpattern.

In general it’s safer to escape all Textpattern tags if you use them in articles, or offload their usage to Pages/Forms.

EDIT: colak beat me to it.

Last edited by Bloke (2017-10-19 13:00:48)


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

#9 2017-10-19 13:10:26

quiris
New Member
Registered: 2015-12-31
Posts: 8

Re: Too few arguments to function file_download_link(), 0 passed in

Thank you for all you great helpful answers but I have on a different page similar problem, but I think the source of the problem is related to upm_file plugin:

<b>Fatal error</b>:  Uncaught ArgumentCountError: Too few arguments to function file_download_link(), 0 passed in /bip/textpattern/publish/taghandlers.php(4337) : eval()'d code on line 1 and at least 1 expected in /bip/textpattern/publish/taghandlers.php:4794
Stack trace:
#0 /bip/textpattern/publish/taghandlers.php(4337) : eval()'d code(1): file_download_link()
#1 /bip/textpattern/publish/taghandlers.php(4337): eval()
#2 [internal function]: php(Array, 'echo file_downl...')
#3 /bip/textpattern/vendors/Textpattern/Tag/Registry.php(83): call_user_func('php', Array, 'echo file_downl...')
#4 /bip/textpattern/lib/txplib_publish.php(514): Textpattern\Tag\Registry-&gt;process('php', Array, 'echo file_downl...')
#5 /bip/textpattern/lib/txplib_publish.php(463): processTags('php', '', 'echo file_downl...')
#6 /bip/textpattern/lib/txplib_misc.php(1782) : eval()'d code(87): parse('&lt;a href=&quot;&lt;txp:p...')
#7 [internal function]: upm_article_file_list(Array, NULL)
#8 /bip/textpattern/vendors/Textpattern/Tag/Registry.php(83): call_user_func('upm_arti in <b>/bip/textpattern/publish/taghandlers.php</b> on line <b>4794</b><br />

old.kuratorium.kielce.pl/bip/218/zarzadzenie-nr-4-2011

Could you help me with this case?

Last edited by quiris (2017-10-19 13:13:15)

Offline

#10 2017-10-19 19:32:31

makss
Plugin Author
From: Ukraine
Registered: 2008-10-21
Posts: 355
Website

Re: Too few arguments to function file_download_link(), 0 passed in

Note the html characters in the line: &quot;&lt;txp:p.... This should not be, it’s probably textile, you need to get used to it a little. ;-)

#6 /bip/textpattern/lib/txplib_misc.php(1782) : eval()'d code(87): parse('&lt;a href=&quot;&lt;txp:p...')

aks_cron : Cron inside Textpattern | aks_article : extended article_custom tag
aks_cache : cache for TxP | aks_dragdrop : Drag&Drop categories (article, link, image, file)

Offline

Board footer

Powered by FluxBB