@colemanw @totten- the 'abstractAction' class doesn't implement that trait - it is changes to the AbstractAction class that I am experiencing as a regression.
It used to have a __call function in 5.39 but now it has uses the traitMagicGetterSetterTrait` instead - which has resulted in a change of behaviour
The issue turns out to be that calling getLanguage on 'any' api action that extended AbstractAction threw an API_Exception if the property was not defined. This was a known possibily, and caught.
However, the rewrite changed that to a different and uncaught exceptionCRM_Core_Exception`.
So, code that was happily calling getLanguage on all api requests was catching API_Exception`` & moving on if they implemented AbstractAction` but not a specific DAO action. This code now crashes because the thrown exception is no longer the same.
In the case of the code I'm dealing with I can work around it but the question becomes 'could it affect others'.
In general the AbstractAction class DOES rise to the level of a material change in my opinion. I was interacting with it in a supported hook civicrm_apiWrappers - so my instinct is that we should continue to throw an exception not fatal out when a missing property is accessed via a magic getter or setter
Previous function
/** * Magic function to provide automatic getter/setter for params. * * @param $name * @param $arguments * @return static|mixed * @throws \API_Exception */ public function __call($name, $arguments) { $param = lcfirst(substr($name, 3)); if (!$param || $param[0] == '_') { throw new \API_Exception('Unknown api parameter: ' . $name); } $mode = substr($name, 0, 3); if ($this->paramExists($param)) { switch ($mode) { case 'get': return $this->$param; case 'set': $this->$param = $arguments[0]; return $this; } } throw new \API_Exception('Unknown api parameter: ' . $name); }
I should probably note that we did lose quite a bit of time on this - I lost half a day but Elliot lost some time too - so in terms of 'is this something where it doesn't matter if the exception has changed' that might count for something