Howdy, I've been maintaining a third party Telegrambot plugin which was working for me up to 1 .15 of osTicket.
I just upgraded to 1.18.x and am encountering a strange problem I can't seem to wrap my head around.

When I run the plugin from CLI I am met with the following error:

PHP Fatal error: Uncaught Error: Undefined constant "INCLUDE_DIR" in /var/www/html/osTicket/upload/include/plugins/telegrambot/telegrambot.php:3
Stack trace:
#0 {main}
thrown in /var/www/html/osTicket/upload/include/plugins/telegrambot/telegrambot.php on line 3

Now I know that INCLUDE_DIR is defined in bootstrap.php as follows:

#Get real path for root dir ---linux and windows
$here = dirname(__FILE__);
$here = ($h = realpath($here)) ? $h : $here;
define('ROOT_DIR',str_replace('\\', '/', $here.'/'));
unset($here); unset($h);
define('INCLUDE_DIR', ROOT_DIR . 'include/');

Has something changed in 1.18 that would inhibit a plugin from being able to utilize the variable INCLUDE_DIR?

The Telegrambot plugin just grabs some classes via the require_once expression at the start of the script.

require_once(INCLUDE_DIR.'class.signal.php');
require_once(INCLUDE_DIR.'class.plugin.php');
require_once('config.php');

I know it is a third-party app, and as far as I know the dev has since abandoned it: https://github.com/drtomasso
If anyone is around who has also encountered the same issue since upgrading to 1.18.x and has some tips or tricks, I would be much obliged.

Thank you!

    Pietro_Aretino

    In 1.17.x we added multi-instance plugins. These are instantiated differently than old plugins. You can look at the new builds of the plugins to see the changes made and update the custom one to fit the new changes.

    Cheers.

      2 months later
      Write a Reply...