asipto / siremis

Web Admin Interface for Kamailio
http://www.siremis.org
99 stars 47 forks source link

PHP 7.2 errors #31

Closed ehosch closed 6 years ago

ehosch commented 6 years ago

Sorry, it wouldn't let me open the previous issue.

Thanks, for quick fix...now new error:

[2018-07-17 18:13:53 (GMT)] An exception occurred while executing this script:
Error message: #8192, The each() function is deprecated. This message will be suppressed on further calls
Script name and line number of error: /var/www/kamailio-5.1.0/openbiz/others/Zend/Cache/Backend.php:66

function: errorHandler ( 8192, "The each() function is deprecated. This message will be suppress...", "/var/www/kamailio-5.1.0/openbiz/others/Zend/Cache/Backend.php", 66, Array(1) ) @ /var/www/kamailio-5.1.0/openbiz/bin/sysheader.inc 117 
function: userErrorHandler ( 8192, "The each() function is deprecated. This message will be suppress...", "/var/www/kamailio-5.1.0/openbiz/others/Zend/Cache/Backend.php", 66, Array(1) ) @ 
function: each ( Array(7) ) @ /var/www/kamailio-5.1.0/openbiz/others/Zend/Cache/Backend.php 66 
function: __construct ( Array(7) ) @ /var/www/kamailio-5.1.0/openbiz/others/Zend/Cache/Backend/File.php 119 
function: __construct ( Array(7) ) @ /var/www/kamailio-5.1.0/openbiz/others/Zend/Cache.php 152 
function: _makeBackend ( "File", Array(7), False, False ) @ /var/www/kamailio-5.1.0/openbiz/others/Zend/Cache.php 93 
function: factory ( "Core", "File", Array(4), Array(7) ) @ /var/www/kamailio-5.1.0/openbiz/bin/service/cacheService.php 166 
function: init ( "menu.do.MenuTreeDO", "7200" ) @ /var/www/kamailio-5.1.0/openbiz/bin/data/BizDataObj_Lite.php 422 
function: _run_search ( Null ) @ /var/www/kamailio-5.1.0/openbiz/bin/data/BizDataObj_Lite.php 281 
function: directFetch ( "[PId]='System' AND [published] = 1" ) @ /var/www/kamailio-5.1.0/siremis/modules/menu/do/MenuTreeDO.php 59 
function: fetchTreeBySearchRule ( "[PId]='System'", "2", "[published] = 1" ) @ /var/www/kamailio-5.1.0/siremis/modules/menu/widget/MenuWidget.php 79 
function: fetchMenuTree ( ) @ /var/www/kamailio-5.1.0/siremis/modules/menu/widget/MenuWidget.php 93 
function: outputAttrs ( ) @ /var/www/kamailio-5.1.0/siremis/modules/menu/widget/MenuRenderer.php 54 
function: renderSmarty ( Object(MenuWidget), "/var/www/kamailio-5.1.0/siremis/modules/menu/template/sitemap_me..." ) @ /var/www/kamailio-5.1.0/siremis/modules/menu/widget/MenuRenderer.php 39 
function: render ( Object(MenuWidget) ) @ /var/www/kamailio-5.1.0/siremis/modules/menu/widget/MenuWidget.php 72 
function: renderHTML ( ) @ /var/www/kamailio-5.1.0/siremis/modules/menu/widget/MenuWidget.php 65 
function: render ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/ViewRenderer.php 83 
function: renderSmarty ( Object(EasyView), "/var/www/kamailio-5.1.0/siremis/themes/default/template/system_v..." ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/ViewRenderer.php 40 
function: render ( Object(EasyView) ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/EasyView.php 274 
function: _render ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/EasyView.php 237 
function: render ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/BizController.php 221 
function: renderView ( "system.view.GeneralDefaultView", "", "", Null, "" ) @ /var/www/kamailio-5.1.0/openbiz/bin/BizController.php 107 
function: dispatchRequest ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/BizController.php 32 
function: include_once ( "/var/www/kamailio-5.1.0/openbiz/bin/BizController.php" ) @ /var/www/kamailio-5.1.0/siremis/bin/controller.php 6 
function: include ( "/var/www/kamailio-5.1.0/siremis/bin/controller.php" ) @ /var/www/kamailio-5.1.0/siremis/bin/_forward.php 102 
function: include ( "/var/www/kamailio-5.1.0/siremis/bin/_forward.php" ) @ /var/www/kamailio-5.1.0/siremis/index.php 3

but the fix for that is

//        while (list($name, $value) = each($options))
    foreach( $options as $name => $value
    {
        $this->setOption($name, $value);
    }

Then there is a new error that I am not sure how to fix...

[2018-07-17 18:37:09 (GMT)] An exception occurred while executing this script:
Error message: #2, count(): Parameter must be an array or an object that implements Countable
Script name and line number of error: /var/www/kamailio-5.1.0/openbiz/bin/ErrorHandler.php:132

function: errorHandler ( 2, "count(): Parameter must be an array or an object that implements...", "/var/www/kamailio-5.1.0/openbiz/bin/ErrorHandler.php", 132, Array(4) ) @ /var/www/kamailio-5.1.0/openbiz/bin/sysheader.inc 117 
function: userErrorHandler ( 2, "count(): Parameter must be an array or an object that implements...", "/var/www/kamailio-5.1.0/openbiz/bin/ErrorHandler.php", 132, Array(4) ) @ /var/www/kamailio-5.1.0/openbiz/bin/ErrorHandler.php 132 
function: _errorBacktrace ( Array(22) ) @ /var/www/kamailio-5.1.0/openbiz/bin/ErrorHandler.php 75 
function: exceptionHandler ( Object(ParseError) ) @ /var/www/kamailio-5.1.0/openbiz/bin/sysheader.inc 128 
function: userExceptionHandler ( Object(ParseError) ) @
Please ask system administrator for help...

Thank you for your assistance

miconda commented 6 years ago

Pushed two commits, see how it goes now with the master.

ehosch commented 6 years ago

FYI, there is another each statement in the file openbiz/others/Zend/Cache/Core.php line 140

Now I can login, but I get a popup message on the siremis/system/general_default page

Unable to create object from class Openbiz.TableForm. TypeError: Cannot read property 'down' of null
miconda commented 6 years ago

I found couple of more places with each(), just pushed other commits, can you try again with latest master?

If you still get errors after login, look at the log files for your web server for error messages, they may have more details, or inside siremis/log/ folder.

ehosch commented 6 years ago

/siremis/themes/default/template/cpl/%%4E^4ED^4ED73EC1%%sitemap_menu.tpl.php:48

has "countable" error

miconda commented 6 years ago

Try to remove compiled templates:

rm -f siremis/themes/default/template/cpl/*.php

and see if persists.

ehosch commented 6 years ago

It is really close to working... image Getting the loading thing on a lot of pages... image Seems to be functional for the most part

ehosch commented 6 years ago

something keeps putting the theme php files back

miconda commented 6 years ago

It is ok to get that php back, I wanted to be deleted in case it was generated before last commits. Does it give the same error message? If yes, can you past the full log message, not only parts of it, as well as paste the line of error from the file (plus 3 before and after the error line)?

ehosch commented 6 years ago

This error keeps coming up on all pages...I can't tell the next error until it is fixed...

[2018-07-18 15:14:07 (GMT)] An exception occurred while executing this script:
Error message: #2, count(): Parameter must be an array or an object that implements Countable
Script name and line number of error: /var/www/kamailio-5.1.0/siremis/themes/default/template/cpl/%%4E^4ED^4ED73EC1%%sitemap_menu.tpl.php:48

function: errorHandler ( 2, "count(): Parameter must be an array or an object that implements...", "/var/www/kamailio-5.1.0/siremis/themes/default/template/cpl/%%4E...", 48, Array(9) ) @ /var/www/kamailio-5.1.0/openbiz/bin/sysheader.inc 117 
function: userErrorHandler ( 2, "count(): Parameter must be an array or an object that implements...", "/var/www/kamailio-5.1.0/siremis/themes/default/template/cpl/%%4E...", 48, Array(9) ) @ /var/www/kamailio-5.1.0/siremis/themes/default/template/cpl/%%4E^4ED^4ED73EC1%%sitemap_menu.tpl.php 48 
function: include ( "/var/www/kamailio-5.1.0/siremis/themes/default/template/cpl/%%4E..." ) @ /var/www/kamailio-5.1.0/openbiz/others/Smarty/libs/Smarty.class.php 1270 
function: fetch ( "/var/www/kamailio-5.1.0/siremis/themes/default/template/sitemap_..." ) @ /var/www/kamailio-5.1.0/siremis/modules/menu/widget/MenuRenderer.php 55 
function: renderSmarty ( Object(MenuWidget), "/var/www/kamailio-5.1.0/siremis/themes/default/template/sitemap_..." ) @ /var/www/kamailio-5.1.0/siremis/modules/menu/widget/MenuRenderer.php 39 
function: render ( Object(MenuWidget) ) @ /var/www/kamailio-5.1.0/siremis/modules/menu/widget/MenuWidget.php 72 
function: renderHTML ( ) @ /var/www/kamailio-5.1.0/siremis/modules/menu/widget/MenuWidget.php 65 
function: render ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/ViewRenderer.php 83 
function: renderSmarty ( Object(EasyView), "/var/www/kamailio-5.1.0/siremis/modules/sipadmin/template/view.t..." ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/ViewRenderer.php 40 
function: render ( Object(EasyView) ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/EasyView.php 274 
function: _render ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/EasyView.php 237 
function: render ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/BizController.php 221 
function: renderView ( "sipadmin.view.SipadminDefaultView", "", "", Null, "" ) @ /var/www/kamailio-5.1.0/openbiz/bin/BizController.php 107 
function: dispatchRequest ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/BizController.php 32 
function: include_once ( "/var/www/kamailio-5.1.0/openbiz/bin/BizController.php" ) @ /var/www/kamailio-5.1.0/siremis/bin/controller.php 6 
function: include ( "/var/www/kamailio-5.1.0/siremis/bin/controller.php" ) @ /var/www/kamailio-5.1.0/siremis/bin/_forward.php 102 
function: include ( "/var/www/kamailio-5.1.0/siremis/bin/_forward.php" ) @ /var/www/kamailio-5.1.0/siremis/index.php 3
Please ask system administrator for help...
git pull https://github.com/asipto/siremis
From https://github.com/asipto/siremis
 * branch            HEAD       -> FETCH_HEAD
Already up to date.
ehosch commented 6 years ago

I program in Visual Studio and don't know much about PHP. Sorry I can't be of more help.

miconda commented 6 years ago

Attach here the file /var/www/kamailio-5.1.0/siremis/themes/default/template/cpl/%%4E^4ED^4ED73EC1%%sitemap_menu.tpl.php

miconda commented 6 years ago

I pushed latest Smarty 2.6 from their git branch along with another check for array before using count().

Delete again the compiled templates:

rm -f siremis/themes/default/template/cpl/*.php

Then try again with latest master and if still errors, attach the php file giving the errors as instructed in my previous comment.

ehosch commented 6 years ago

sitemap_menu.tpl.php.txt

git pull https://github.com/asipto/siremis
remote: Counting objects: 19, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 19 (delta 13), reused 19 (delta 13), pack-reused 0
Unpacking objects: 100% (19/19), done.
From https://github.com/asipto/siremis
 * branch            HEAD       -> FETCH_HEAD
Updating 9fcae7e..40eea5d
Fast-forward
 openbiz/others/Smarty/README                       |  2 +-
 openbiz/others/Smarty/libs/Smarty.class.php        |  4 +--
 .../others/Smarty/libs/Smarty_Compiler.class.php   | 16 +++++-----
 openbiz/others/Smarty/libs/plugins/block.t.php     |  2 +-
 .../others/Smarty/libs/plugins/function.math.php   | 37 ++++++++++++----------
 5 files changed, 33 insertions(+), 28 deletions(-)
ehosch commented 6 years ago

It looks like the problem is in /siremis/themes/default/template/sitemap_menu.tpl line 31

ehosch commented 6 years ago

mycplfolder.zip

The error is the same as before.

ehosch commented 6 years ago

what command do i do to get the latest changes? when I delete folder and clone per install instructions, it seems I am not getting your latest changes?

Never mind I think the install process changes a file modified: siremis/bin/app.inc

miconda commented 6 years ago

Deleting and cloning again will fetch the latest version.

I just pushed another patch to change inside template files, doing a test for is arrary before using @count. Can you retry with latest master and see how far it goes this time?

ehosch commented 6 years ago

Two more files need to be changed...

siremis/themes/default/template/vertical_menu.tpl siremis/modules/help/template/widget_list.tpl.html vertical_menu.tpl.txt widget_list.tpl.html.txt

ehosch commented 6 years ago

Thank you for your help. The web interface looks great!!! Got an error accessing sip users:

[2018-07-22 18:37:16 (GMT)] An exception occurred while executing this script:
Error message: #2, Use of undefined constant admin - assumed 'admin' (this will throw an Error in a future version of PHP)
Script name and line number of error: /var/www/kamailio-5.1.0/openbiz/bin/Expression.php(329) : eval()'d code:1

function: errorHandler ( 2, "Use of undefined constant admin - assumed 'admin' (this will thr...", "/var/www/kamailio-5.1.0/openbiz/bin/Expression.php(329) : eval()...", 1, Array(7) ) @ /var/www/kamailio-5.1.0/openbiz/bin/sysheader.inc 117 
function: userErrorHandler ( 2, "Use of undefined constant admin - assumed 'admin' (this will thr...", "/var/www/kamailio-5.1.0/openbiz/bin/Expression.php(329) : eval()...", 1, Array(7) ) @ /var/www/kamailio-5.1.0/openbiz/bin/Expression.php(329) : eval()'d code 1 
function: eval ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/Expression.php 329 
function: evaluateExpression ( "[username]='{@profile:username}'", Object(SubscriberDO) ) @ /var/www/kamailio-5.1.0/openbiz/bin/data/private/BizDataObj_SQLHelper.php 318 
function: _ruleToSql ( Object(SubscriberDO), "[username]='{@profile:username}'" ) @ /var/www/kamailio-5.1.0/openbiz/bin/data/private/BizDataObj_SQLHelper.php 124 
function: buildQuerySQL ( Object(SubscriberDO) ) @ /var/www/kamailio-5.1.0/openbiz/bin/data/BizDataObj_Lite.php 403 
function: _run_search ( Array(2) ) @ /var/www/kamailio-5.1.0/openbiz/bin/data/BizDataObj_Lite.php 243 
function: fetch ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/EasyForm.php 690
function: fetchDataSet ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/FormRenderer.php 69 
function: renderSmarty ( Object(EasyForm), "/var/www/kamailio-5.1.0/siremis/modules/sipuser/template/grid.tp..." ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/FormRenderer.php 45 
function: render ( Object(EasyForm) ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/EasyForm.php 1648 
function: renderHTML ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/EasyForm.php 1538 
function: render ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/ViewRenderer.php 83 
function: renderSmarty ( Object(EasyView), "/var/www/kamailio-5.1.0/siremis/modules/sipuser/template/view_ta..." ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/ViewRenderer.php 40 
function: render ( Object(EasyView) ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/EasyView.php 274 
function: _render ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/easy/EasyView.php 237 
function: render ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/BizController.php 221 
function: renderView ( "sipuser.view.SubscriberListView", "", "", Null, "" ) @ /var/www/kamailio-5.1.0/openbiz/bin/BizController.php 107 
function: dispatchRequest ( ) @ /var/www/kamailio-5.1.0/openbiz/bin/BizController.php 32 
function: include_once ( "/var/www/kamailio-5.1.0/openbiz/bin/BizController.php" ) @ /var/www/kamailio-5.1.0/siremis/bin/controller.php 6 
function: include ( "/var/www/kamailio-5.1.0/siremis/bin/controller.php" ) @ /var/www/kamailio-5.1.0/siremis/bin/_forward.php 102 
function: include ( "/var/www/kamailio-5.1.0/siremis/bin/_forward.php" ) @ /var/www/kamailio-5.1.0/siremis/index.php 3
Please ask system administrator for help...
miconda commented 6 years ago

I pushed a commit trying to fix the last error you reported, but I am not sure it is the right one -- can you test and see if get all subscribers (sip users) when having more than one or there are other errors popping up.

If this works, it needs to be done in few other parts, but subscribers view should be ok (if that was the right fix).

miconda commented 6 years ago

I am closing this one, several related commits were pushed. If new issues pop up, then open a new bug report.