PhantomVl / sccp_manager

SCCP Manager
35 stars 19 forks source link

Error adding new phone: Use of undefined constant model - assumed 'model' (this will throw an Error in a future version of PHP) #74

Closed DJUnreal closed 4 years ago

DJUnreal commented 4 years ago

When trying to add a new phone (navigating to "SCCP Phone Manager -> SCCP Phone -> Add Device Phone"), I get the following error:

/var/www/html/admin/modules/sccp_manager/views/formShow.php

        if (empty($child->class)) {
            $child->class = 'form-control';
        }
        if ($child['type'] == 'SDM') {
            if (empty($model_list)) {
                $model_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("HWDevice");
            }
            $select_opt= $model_list;
        }
        if ($child['type'] == 'SDMS') {
            if (empty($model_list)) {
                $model_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("HWSipDevice");
            }
            $select_opt= $model_list;
        }
        if ($child['type'] == 'SDE') {
            if (empty($extension_list)) {
                $extension_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("HWextension");
                $extension_list[]=array(model=>'NONE', vendor=>'CISCO', dns=>'0');
            }
            $select_opt= $extension_list;
        }
        if ($child['type'] == 'SDD') {
            if (empty($device_list)) {
                $device_list = \FreePBX::Sccp_manager()->dbinterface->get_db_SccpTableData("SccpDevice");
                $device_list[]=array(name=>'NONE', description=>'No Device');
            }
            $select_opt = $device_list;
        }

        echo '<!-- Begin '.$child->label.' -->';

        ?>
        <div class="element-container">
           <div class="row"> <div class="form-group"> 

                   <div class="col-md-3">
                        <label class="control-label" for="<?php echo $res_id; ?>"><?php echo _($child->label);?></label>
                        <i class="fa fa-question-circle fpbx-help-icon" data-for="<?php echo $res_id; ?>"></i>
Arguments
"Use of undefined constant model - assumed 'model' (this will throw an Error in a future version of PHP)"

referring to line 675 of formShow.php

Is this something I've done wrong? It looks like a PHP error rather than a config error, but I can't be sure. PHP 7.3, latest version of sccp_manager as of this morning.

PhantomVl commented 4 years ago

Fix

DJUnreal commented 4 years ago

Unfortunately even after cleanly installing the newest version (removed the local folder and did a fresh git clone, then installed it again manually via the UI), I see the same error when I try to add a new phone. Looks like the fix didn't quite fix it :(

PhantomVl commented 4 years ago

I made a few changes, maybe this will solve the problem. A complete reinstall is not required. cd /var/www/html/admin/modules/sccp_manager/ git fetch git pull

DJUnreal commented 4 years ago

Perfect, that's fixed it! Thanks!