warning undefined key "calculated"

Hi,

I have created a custom scheduler, which runs fine, but it gives me the following warning:

Warning [2]: Undefined array key "calculated" over /var/www/html/include/Expressions/DependencyManager.php op regel 188

I feel like this is a bug, but maybe anyone here has an explanation?

The scheduler runs the following code:

$bean = BeanFactory::retrieveBean('Quotes', "ed55fc4e-b3cc-11ef-94ac-0242ac120007");
$bean->quote_stage = 'Concept offerte';
$bean->projectcode_c = '123746';
$bean->save();

Performing a postman request to the REST API setting the same values does not result in any warnings. Any idea why this warning occurs?

Looking in the source code of Sugar I get to this line of code:

if (!empty($def['required']) && isset($def['required_formula']) && !$def['calculated']) {

...

}

I would expect either the sugar code has to be changed to:

&& (!array_key_exists('calculated', $def) || !$def['calculated'])

OR we have to figure out why $def['calculated'] is not being set.

I am running version 13.0.3

Update: running the same code on another module, does not give the same error, so it is related to the quote module. Maybe it has something to do with calculations of totals of quote line items or something?

Kind regards,

Stijn

Parents
  • Hello  ,

    I suspect that this is the issue behind the warning that you are seeing

     #92699 ( portal.sugarondemand.com/ )

    This issue arises because certain E_NOTICE warnings that were previously suppressed in SugarCronJobs::executeJob() under PHP 7 are now being treated as E_WARNING in PHP 8.
    As a result, these warnings are no longer ignored and are displayed during execution, causing the Warning that you see in the log. 

    This issue was fixed, you should be able to get an hotfix via support case. 
    Let us know if that prevents the warnings to show. 

    Cheers, 

    André 

Reply
  • Hello  ,

    I suspect that this is the issue behind the warning that you are seeing

     #92699 ( portal.sugarondemand.com/ )

    This issue arises because certain E_NOTICE warnings that were previously suppressed in SugarCronJobs::executeJob() under PHP 7 are now being treated as E_WARNING in PHP 8.
    As a result, these warnings are no longer ignored and are displayed during execution, causing the Warning that you see in the log. 

    This issue was fixed, you should be able to get an hotfix via support case. 
    Let us know if that prevents the warnings to show. 

    Cheers, 

    André 

Children