Skip to content

[FIX] Tiki Shoutbox: Uncaught ArgumentCountError

SKB-TECH requested to merge SKB-TECH/tiki:Fix-Uncaught_ArgumentCountError into master

Related issue

Issue Resolved:

  • Fatal error: Uncaught ArgumentCountError: Too few arguments to function ShoutboxLib::{closure}(), 1 passed and exactly 2 expected in /home/tiki-themes/public_html/lib/shoutbox/shoutboxlib.php:60 Stack trace: #0 [internal function]: ShoutboxLib->{closure}() #1 /home/tiki-themes/public_html/lib/shoutbox/shoutboxlib.php(62): preg_replace_callback() #2 /home/tiki-themes/public_html/tiki-shoutbox.php(125): ShoutboxLib->list_shoutbox() #3 {main} thrown in /home/tiki-themes/public_html/lib/shoutbox/shoutboxlib.php on line 60

Solution:

  • The problematic code seems to be in the preg_replace_callback function where the closure expects two arguments ($m and $wrap_at), but only one argument ($m) is passed
  • To resolve this, I modified the closure to remove the second argument $wrap_at, as the closure can only take the matching array ($m).

Related task: https://avan.tech/item93833

Edited by Baraka Kinywa

Merge request reports

Loading