Skip to content

Commit

Permalink
Merge branch '2023.11' into 2024.11
Browse files Browse the repository at this point in the history
  • Loading branch information
gitlabci committed Jan 31, 2024
2 parents 08404b7 + 093358a commit c421b96
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions tine20/Tinebase/Controller/Record/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -1761,7 +1761,7 @@ protected function _setSystemNotes($_updatedRecord, $_systemNoteType = Tinebase_
protected function _inspectBeforeUpdate($_record, $_oldRecord)
{
if (null !== ($mc = $_record::getConfiguration())) {
foreach ($mc->{Tinebase_ModelConfiguration_Const::CONTROLLER_HOOK_BEFORE_UPDATE} as $hook) {
foreach ($mc->getControllerHooksBeforeUpdate() as $hook) {
if (count($hook) > 2) {
$params = array_slice($hook, 2);
$hook = array_slice($hook, 0, 2);
Expand All @@ -1772,7 +1772,7 @@ protected function _inspectBeforeUpdate($_record, $_oldRecord)
call_user_func_array($hook, array_merge($params, [$_record, $_oldRecord]));
} else {
if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(
__METHOD__ . '::' . __LINE__ . ' hook is not callable: ' . print_r($hook, true));
__METHOD__ . '::' . __LINE__ . ' Hook is not callable: ' . print_r($hook, true));
}
}
}
Expand Down
19 changes: 9 additions & 10 deletions tine20/Tinebase/ModelConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,14 +407,6 @@ class Tinebase_ModelConfiguration extends Tinebase_ModelConfiguration_Const {
*/
protected $_controllerHookBeforeUpdate = [];

/**
* FIXME do we need both?? this might be needed because php 8.2 deprecates dynamic props
* FIXME adding this breaks Sales_Document_JsonTest::testOfferBoilerplates
*
* @var array
*/
// public $controllerHookBeforeUpdate = [];

protected $_jsonFacadeFields = [];

/**
Expand Down Expand Up @@ -2555,14 +2547,21 @@ public static function resolveRecordsPropertiesForRecordSet(Tinebase_Record_Reco
*
* @return array
*/
public function getVirtualFields() {
public function getVirtualFields()
{
return $this->_virtualFields;
}

public function hasField($_field) {
public function hasField($_field)
{
return isset($this->_fields[$_field]);
}

public function getControllerHooksBeforeUpdate(): array
{
return $this->_controllerHookBeforeUpdate;
}

/**
* reset cache vars
*/
Expand Down
2 changes: 1 addition & 1 deletion tine20/Tinebase/ModelConfiguration/Const.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Tinebase_ModelConfiguration_Const {
public const CONFIG = 'config';
public const CONTROLLER = 'controller';
public const CONTROLLER_CLASS_NAME = 'controllerClassName';
public const CONTROLLER_HOOK_BEFORE_UPDATE = 'controllerHookBeforeUpdate';
public const CONTROLLER_HOOK_BEFORE_UPDATE = '_controllerHookBeforeUpdate';
public const CONVERTERS = 'converters';
public const COLUMNS = 'columns';
public const COPY_OMIT = 'copyOmit';
Expand Down

0 comments on commit c421b96

Please sign in to comment.