PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function themes_submenu()


(Bidya Lamsal) #1

I have freshly installed playSMS version 1.4. on centos 7 machine. Installation is OK, no issues, playsmsd also running but while browsing i got below error message, please suggest

[root@localhost httpd]# playsmsd check
PLAYSMSD_CONF = /etc/playsmsd.conf
PLAYSMS_PATH = /var/www/html/playsms
PLAYSMS_LIB = /var/lib/playsms
PLAYSMS_BIN = /usr/local/bin
PLAYSMS_LOG = /var/log/playsms
DAEMON_SLEEP = 1
ERROR_REPORTING = E_ALL ^ (E_NOTICE | E_WARNING)
IS_RUNNING = 1
PIDS schedule = 3766
PIDS ratesmsd = 3768
PIDS dlrssmsd = 3770
PIDS recvsmsd = 3772
PIDS sendsmsd = 3774
[root@localhost httpd]#

http://localhost/index.php?app=main&inc=core_auth&route=login

PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function themes_submenu(), 0 passed in /var/www/html/playsms/plugin/themes/common/fn.php on line 23 and exactly 1 expected in /var/www/html/playsms/plugin/core/themes/fn.php:39\nStack trace:\n#0 /var/www/html/playsms/plugin/themes/common/fn.php(23): themes_submenu()\n#1 /var/www/html/playsms/lib/fn_core.php(192): common_hook_themes_apply(’<table width=‘1…’)\n#2 /var/www/html/playsms/plugin/core/themes/fn.php(32): core_hook(‘common’, ‘themes_apply’, Array)\n#3 /var/www/html/playsms/inc/app/main.php(39): themes_apply(’<table width=‘1…’)\n#4 /var/www/html/playsms/index.php(34): include(’/var/www/html/p…’)\n#5 {main}\n thrown in /var/www/html/playsms/plugin/core/themes/fn.php on line 39


(Rui Brito Da Silva) #2

Hello!

Have same situation here!

PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function themes_submenu(), 0 passed in /var /www/html/playsms/plugin/themes/common/fn.php on line 23 and exactly 1 expected in /var/www/html/playsms/plugin/core/themes/fn.php:39\nStack trace:\n#0 /var/www/html/playsms/plugin/themes/common/fn.php(23): themes_submenu()\n#1 /var/www/html/playsms/lib/fn_core.php(192): common_hook_themes_apply(’<table width=‘1…’)\n#2 /var/www/html/playsms/plugin/core/themes/fn.php(32): core_hook(‘common’, ‘themes_apply’, Array)\n#3 /var/www/html/playsms/inc/app/main.php(39): themes_apply(’<table width=‘1…’)\n#4 /var/www/html/playsms/index.php(34): include(’/var/www/html/p…’)\n#5 {main}\n thrown in /var/www/html/playsms/plugin/core/themes/fn.php on line 39


(Rodrigo Sze) #3

I also have same issue… no news about it yet???


(Arjun Dev) #4

re-install php properly as mentioned in tutorial


(Mapiiiaji) #5

I use (https://github.com/antonraharja/playSMS/blob/master/INSTALL.md) this instruction for installation, but received similar error as mentioned above. Are you have any ideas?
I have:
Centos 7.5 x64
Apache 2.4.33
php php-mysql php-cli php-mbstring php-gb php-gettext (all is have 7.2.6 version)
First, I have mysql version 5.7.22 and upgrade it to 8.0.11


(Arjun Dev) #6

The tutorial you followed works 100%, as I you have php error, may be issue in in php. Any way follow this tutorial also ’ https://antonraharja.com/2016/08/22/playsms-1-4-on-centos-7-2-with-mariadb-5-5-50/

If you are not able to run playsms after following this tutorial, then give me root access of your system, I will do for you.


(Mapiiiaji) #8

Arjun thanks for answer. I ready provide you access to my server. If you use Telegram or Skype, give me your credentials and I send you test sms. Else, send me please your e-mail address and I send you temporary login credentials.


(Michel Benjamin) #9

I had the same issue
Solved it by editing playsms\plugin\themes\common\fn.php
Line 22

‘THEMES_SUBMENU’ => themes_submenu(),

should be

‘THEMES_SUBMENU’ => themes_submenu($content),


(Mapiiiaji) #10

Michel thank u for your answer. but I reinstall php (7.2 ==> 7.0) and mysql (8.0 ==> 5.7) and service successful runned.


(Michel Benjamin) #11

You mean you downgraded PHP and MySQL ?
Are you sure this is a good idea ?


(Mapiiiaji) #12

Yes. I know, this is not good idea. But I don’t otherwise solve this problem(


(Mapiiiaji) #13

Michel big thanks for your answer. Upgrade php and change that file and all successful run! Thank u again bro


(Michel Benjamin) #14

You’re welcome.

By the way, i run into a problem with the function gateway_select_smsc()

It requires 2 arguments, not 1

So for instance in playsms/plugin/feature/sms_board/sms_board.php
Line 183
$select_reply_smsc = “

” . _(‘SMSC’) . “ ” . gateway_select_smsc(‘smsc’) . “ ”;

should be

$select_reply_smsc = “

” . _(‘SMSC’) . “ ” . gateway_select_smsc(‘smsc’,’’) . “ ”;

Hope this helps


(Mapiiiaji) #15

Thank you for your answers. I’ll fix it right now. You know, I have faced such a problem: via the command line SMS is sent, but through playsms is not sent.


(Mapiiiaji) #16

Is it double quote Michel?


(Michel Benjamin) #17

Yes, double quotes
It must be 2 arguments


(Michel Benjamin) #18

Sorry, i meant 2 single quotes


(Mapiiiaji) #19

Thank you. I fixed it.


(Michel Benjamin) #20

Thinking of it,
gateway_select_smsc(‘smsc’, false)
or
gateway_select_smsc(‘smsc’, null)
will work as well

Good luck


(Mapiiiaji) #21

Thank you very much.