5 / 6
Apr 2020

Dear Developers,
for some time in my system I get the following error

Class ‘EGroupware\Api\Etemplate\Widget\Select’ not found

after about one hour of work.

in this case the backtrace was the following:

PHP message: An error happened (Error): Class 'EGroupware\Api\Etemplate\Widget\Select' not found
PHP message: #0 /var/www/egroupware/api/src/Etemplate/Widget.php(359): include_once()
PHP message: #1 /var/www/egroupware/api/src/Etemplate/Widget.php(1052): EGroupware\Api\Etemplate\Widget::scanForWidgets()
PHP message: #2 /var/www/egroupware/api/src/autoload.php(50): require_once('/var/www/egroup...')
PHP message: #3 [internal function]: {closure}('EGroupware\\Api\\...')
PHP message: #4 /var/www/egroupware/api/src/Etemplate/Widget/Select.php(28): spl_autoload_call('EGroupware\\Api\\...')
PHP message: #5 /var/www/egroupware/api/src/autoload.php(50): require_once('/var/www/egroup...')
PHP message: #6 [internal function]: {closure}('EGroupware\\Api\\...')
PHP message: #7 /var/www/egroupware/infolog/inc/class.infolog_bo.inc.php(2428): spl_autoload_call('EGroupware\\Api\\...')
PHP message: #8 /var/www/egroupware/infolog/inc/class.infolog_bo.inc.php(381): infolog_bo->getReadItems()
PHP message: #9 /var/www/egroupware/api/src/Link.php(1776): infolog_bo->__construct()
PHP message: #10 /var/www/egroupware/api/src/Link.php(1735): EGroupware\Api\Link::exec('infolog.infolog...', Array)
PHP message: #11 /var/www/egroupware/api/src/Vfs/Links/StreamWrapper.php(116): EGroupware\Api\Link::file_access('infolog', 'd2', 1, 'd0/d1/d9/d7/d3/...', 65)
PHP message: #12 /var/www/egroupware/api/src/Vfs/Links/StreamWrapper.php(162): EGroupware\Api\Vfs\Links\StreamWrapper::check_extended_acl('achelper.digits...', 4)
PHP message: #13 /var/www/egroupware/achelper/src/Vfs/Digits/StreamWrapper.php(218): EGroupware\Api\Vfs\Links\StreamWrapper->url_stat('achelper.digits...', 0)
PHP message: #14 [internal function]: EGroupware\Achelper\Vfs\Digits\StreamWrapper->url_stat('achelper.digits...', 0)
PHP message: #15 /var/www/egroupware/api/src/Vfs/StreamWrapper.php(806): stat('achelper.digits...')
PHP message: #16 [internal function]: EGroupware\Api\Vfs\StreamWrapper->url_stat('vfs://default/w...', 2)PHP m

When somebody logs out and in into the server again, then the error is gone…

I think the error it is related to finding the widgets when the Api\Cache has expired:

But I don’t know what I can do to fix it…

Any hint is appreciated!

Thanks and
BR
Alex

  • created

    Apr '20
  • last reply

    Apr '20
  • 5

    replies

  • 1.3k

    views

  • 2

    users

  • 2

    links

I seen this error a couple of times, if the cache is not working or too small.

The error is a side-effect as autoloading the widgets requires a certain order.

Ralf

I seen this error a couple of times, if the cache is not working or too small.

The error is a side-effect as autoloading the widgets requires a certain order.

Ralf

What is that and what for is it called in that call-stack.
If it’s some kind of hook, maybe it would be easier to make it a static function to not run infolog_bo constructor, as that could be the problem here.

Ralf

Dear @RalfBecker,

I think you found the problem, I have the following code in getReadItems()

//Read Unread
function getReadItems( $user_id = null ) {
if ( !$user_id )
$user_id = $this->user;

    $ids = array();
  $apps = array_keys(Etemplate\Widget\Select::app_options('installed'));

  //asig: check for user id, because fuction is running also in setup via construct and there we have no user, so sq breakes
  //also check that infolog should be installed
  
  If ($user_id && in_array('infolog', $apps)){
  	$sql = "SELECT entry_id FROM ac_infolog_read WHERE user_id=$user_id ";
  	$this->so->db->query( $sql );
  	while ( $row = $this->so->db->row(true) ){
  		$ids[] = $row['entry_id'];
  	}
  }

    return $ids;
}

This code is quite old, 3 years at least, and I never noticed this behaviour before…

What would be the correct/better way to call this static function:

Etemplate\Widget\Select::app_options(‘installed’)

Thank you once again!
Alex