Uploaded image for project: 'FreePBX'
  1. FreePBX
  2. FREEPBX-23714 Update module Queue Priorties
  3. FREEPBX-23719

Undefined variable: dest_matches via ajax

    XMLWordPrintable

    Details

    • Type: Sub-Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 16.0.21.19
    • Fix Version/s: 16.0.21.19
    • Component/s: FreePBX Framework
    • Labels:
      None
    • ToDo:

      Description

      Calling \FreePBX::Destinations()->destinationUsageArray($dest) from the url config.php does not produce any error.
      But when calling it from ajax.php the following error occurs. This error occurs when the destination is not being used.
      As seen in the following log, ID 30 is being used in a destination and the error is not generated. But in ID 33 it is not being used and instead of returning the empty array the error occurs.

      Example debug config.php

      
      OUT > [2022-09-13 17:31:35] [dbug.DEBUG]: 2022-Sep-13 17:31:35        /usr/src/freepbx/queueprio/Queueprio.class.php:548
      OUT > [2022-09-13 17:31:35] [dbug.DEBUG]: ID: 30
      OUT > [2022-09-13 17:31:35] [dbug.DEBUG]: 2022-Sep-13 17:31:35        /usr/src/freepbx/queueprio/Queueprio.class.php:549
      OUT > [2022-09-13 17:31:35] [dbug.DEBUG]: Array
      (
          [text] =>  Used as Destination by 1 Object
          [tooltip] => Queue Priority: Prueba2<br />
      )
      
      OUT > [2022-09-13 17:31:35] [dbug.DEBUG]: 2022-Sep-13 17:31:35  /usr/src/freepbx/queueprio/Queueprio.class.php:548f
      OUT > [2022-09-13 17:31:35] [dbug.DEBUG]: ID: 33
      OUT > [2022-09-13 17:31:35] [dbug.DEBUG]: 2022-Sep-13 17:31:35        /usr/src/freepbx/queueprio/Queueprio.class.php:549
      OUT > [2022-09-13 17:31:35] [dbug.DEBUG]: Array
      (
      )
      

      Example debug ajax.php

      
      OUT > [2022-09-13 17:30:47] [dbug.DEBUG]: 2022-Sep-13 17:30:47  /usr/src/freepbx/queueprio/Queueprio.class.php:548
      OUT > [2022-09-13 17:30:47] [dbug.DEBUG]: ID: 30
      OUT > [2022-09-13 17:30:47] [dbug.DEBUG]: 2022-Sep-13 17:30:47        /usr/src/freepbx/queueprio/Queueprio.class.php:549
      OUT > [2022-09-13 17:30:47] [dbug.DEBUG]: Array
      (
          [text] => &nbsp;Used as Destination by 1 Object
          [tooltip] => Queue Priority: Prueba2<br />
      )
      
      OUT > [2022-09-13 17:30:47] [dbug.DEBUG]: 2022-Sep-13 17:30:47  /usr/src/freepbx/queueprio/Queueprio.class.php:548
      OUT > [2022-09-13 17:30:47] [dbug.DEBUG]: ID: 33
      OUT > [2022-09-13 17:30:47] [dbug.DEBUG]: 2022-Sep-13 17:30:47        /usr/src/freepbx/framework/amp_conf/htdocs/admin/libraries/BMO/Destinations.class.php:209
      OUT > [2022-09-13 17:30:47] [dbug.DEBUG]: Undefined variable: dest_matches
      OUT > [2022-09-13 17:30:47] [dbug.DEBUG]: 2022-Sep-13 17:30:47  /usr/src/freepbx/framework/amp_conf/htdocs/admin/libraries/BMO/Destinations.class.php:210
      OUT > [2022-09-13 17:30:47] [dbug.DEBUG]: #0 /usr/src/freepbx/framework/amp_conf/htdocs/admin/libraries/BMO/Destinations.class.php(97): Whoops\Run->handleError()
      #1 /usr/src/freepbx/framework/amp_conf/htdocs/admin/libraries/BMO/Destinations.class.php(248): FreePBX\Destinations->getAllInUseDestinations()
      #2 /usr/src/freepbx/queueprio/Queueprio.class.php(549): FreePBX\Destinations->destinationUsageArray()
      #3 /usr/src/freepbx/queueprio/Queueprio.class.php(671): FreePBX\modules\Queueprio->getPriority()
      #4 [internal function]: FreePBX\modules\Queueprio->destinations_getdestinfo()
      #5 /usr/src/freepbx/framework/amp_conf/htdocs/admin/libraries/BMO/Hooks.class.php(319): call_user_func_array()
      #6 /usr/src/freepbx/framework/amp_conf/htdocs/admin/libraries/BMO/Hooks.class.php(373): FreePBX\Hooks->executeCall()
      #7 /usr/src/freepbx/framework/amp_conf/htdocs/admin/libraries/BMO/Destinations.class.php(483): FreePBX\Hooks->processHooksByModule()
      #8 /usr/src/freepbx/framework/amp_conf/htdocs/admin/libraries/BMO/Destinations.class.php(226): FreePBX\Destinations->getModuleDestinationInfo()
      #9 /usr/src/freepbx/framework/amp_conf/htdocs/admin/libraries/BMO/Destinations.class.php(201): FreePBX\Destinations->getDestinationInfoByModule()
      #10 /usr/src/freepbx/framework/amp_conf/htdocs/admin/libraries/BMO/Destinations.class.php(125): FreePBX\Destinations->getDestinationsByModule()
      #11 /usr/src/freepbx/framework/amp_conf/htdocs/admin/libraries/BMO/Destinations.class.php(45): FreePBX\Destinations->getPopoversByModule()
      #12 /usr/src/freepbx/framework/amp_conf/htdocs/admin/libraries/BMO/View.class.php(730): FreePBX\Destinations->getAll()
      #13 /usr/src/freepbx/framework/amp_conf/htdocs/admin/helpers/freepbx_helpers.php(109): FreePBX\View->destinationDrawSelect()
      #14 /usr/src/freepbx/queueprio/Queueprio.class.php(234): drawselects()
      #15 /usr/src/freepbx/framework/amp_conf/htdocs/admin/libraries/BMO/Ajax.class.php(134): FreePBX\modules\Queueprio->ajaxHandler()
      #16 /usr/src/freepbx/framework/amp_conf/htdocs/admin/ajax.php(63): FreePBX\Ajax->doRequest()
      #17 {main}
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                vsc55 VSC55
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  NextupJiraPlusStatus

                  Error rendering 'slack.nextup.jira:nextup-jira-plus-status'. Please contact your Jira administrators.