From 26ba8a8f49ca0339547e31e3fc5acd1f016ec460 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20Sch=C3=BCle?=
Date: Wed, 3 Jan 2024 11:03:45 +0100
Subject: [PATCH 1/3] tweak(php8.2): add some more property definitions
to prevent "Creation of dynamic property ... is deprecated"
---
tests/tine20/Tinebase/FileSystem/PreviewTest.php | 2 ++
tests/tine20/Tinebase/Group/ActiveDirectoryTest.php | 3 ++-
tests/tine20/Tinebase/ImageHelperTest.php | 2 ++
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/tests/tine20/Tinebase/FileSystem/PreviewTest.php b/tests/tine20/Tinebase/FileSystem/PreviewTest.php
index 78249f3f378..e36af371f63 100644
--- a/tests/tine20/Tinebase/FileSystem/PreviewTest.php
+++ b/tests/tine20/Tinebase/FileSystem/PreviewTest.php
@@ -32,6 +32,8 @@ class Tinebase_FileSystem_PreviewTest extends TestCase
protected $_rmDir = array();
+ protected $_oldQuota;
+
protected function setUp(): void
{
if (empty(Tinebase_Core::getConfig()->filesdir)) {
diff --git a/tests/tine20/Tinebase/Group/ActiveDirectoryTest.php b/tests/tine20/Tinebase/Group/ActiveDirectoryTest.php
index 96e217e9bff..80ea522e3e1 100644
--- a/tests/tine20/Tinebase/Group/ActiveDirectoryTest.php
+++ b/tests/tine20/Tinebase/Group/ActiveDirectoryTest.php
@@ -28,7 +28,8 @@ class Tinebase_Group_ActiveDirectoryTest extends \PHPUnit\Framework\TestCase
protected $groupObjectGUID = '0cbadcc5-72f7-4a2d-8858-7ba6c80e6c15';
protected $userObjectGUID = '0cbadcc5-72f7-4a2d-8858-7ba6c80e6c16';
protected $groupBaseFilter = 'objectclass=group';
-
+ protected $_groupAD;
+
/**
* Sets up the fixture.
* This method is called before a test is executed.
diff --git a/tests/tine20/Tinebase/ImageHelperTest.php b/tests/tine20/Tinebase/ImageHelperTest.php
index ced7c75c4b1..38d1f7b6b76 100644
--- a/tests/tine20/Tinebase/ImageHelperTest.php
+++ b/tests/tine20/Tinebase/ImageHelperTest.php
@@ -30,6 +30,8 @@ class Tinebase_ImageHelperTest extends \PHPUnit\Framework\TestCase
protected $_testImage;
+ protected $_testImageData;
+
/**
* Runs the test methods of this class.
*
From 2169a503f206b4f5949ee232317230136ef677bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20Sch=C3=BCle?=
Date: Wed, 3 Jan 2024 11:05:53 +0100
Subject: [PATCH 2/3] tweak(php8.2): replace utf8_decode
... it's deprecated
see https://php.watch/versions/8.2/utf8_encode-utf8_decode-deprecated
---
tine20/DFCom/Model/DeviceResponse.php | 2 +-
tine20/Tinebase/Import/Abstract.php | 2 +-
tine20/Tinebase/User/PasswordPolicy.php | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tine20/DFCom/Model/DeviceResponse.php b/tine20/DFCom/Model/DeviceResponse.php
index f78604bbfac..18220411d5c 100644
--- a/tine20/DFCom/Model/DeviceResponse.php
+++ b/tine20/DFCom/Model/DeviceResponse.php
@@ -149,7 +149,7 @@ public function triggerEventChain($name)
*/
public function displayMessage($message, $duration=5, $beep=self::BEEP_SHORTLONG, $font=self::FONT_STANDARD)
{
- $this->_responseData['df_msg'] = implode(',', [rawurlencode(utf8_decode($message)), $duration, $beep, $font]);
+ $this->_responseData['df_msg'] = implode(',', [rawurlencode(Tinebase_Helper::mbConvertTo($message)), $duration, $beep, $font]);
return $this;
}
diff --git a/tine20/Tinebase/Import/Abstract.php b/tine20/Tinebase/Import/Abstract.php
index d89eafb30ac..2efe2c4d7a7 100644
--- a/tine20/Tinebase/Import/Abstract.php
+++ b/tine20/Tinebase/Import/Abstract.php
@@ -108,7 +108,7 @@ public static function createFromDefinition(
public function importFile($_filename, $_clientRecordData = array())
{
if (preg_match('/^win/i', PHP_OS)) {
- $_filename = utf8_decode($_filename);
+ $_filename = Tinebase_Helper::mbConvertTo($_filename);
}
if (! file_exists($_filename)) {
throw new Tinebase_Exception_NotFound("File $_filename not found.");
diff --git a/tine20/Tinebase/User/PasswordPolicy.php b/tine20/Tinebase/User/PasswordPolicy.php
index 723ea7fcb31..8a5174540ac 100644
--- a/tine20/Tinebase/User/PasswordPolicy.php
+++ b/tine20/Tinebase/User/PasswordPolicy.php
@@ -170,7 +170,7 @@ protected static function _testPolicy($password, $configKey, $regex = null)
$minLength = $configValue;
if ($minLength > 0) {
$reduced = ($regex) ? preg_replace($regex, '', $password) : $password;
- $charCount = strlen(utf8_decode((string)$reduced));
+ $charCount = strlen(Tinebase_Helper::mbConvertTo((string)$reduced));
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
. ' Found ' . $charCount . '/' . $minLength . ' chars for ' . $configKey /*. ': ' . $reduced */);
From 5c466c39fbce00f669cb3ac51c7cd94753772c2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20Sch=C3=BCle?=
Date: Thu, 4 Jan 2024 14:52:33 +0100
Subject: [PATCH 3/3] tweak(php8.2): add/fix some more property definitions
to prevent "Creation of dynamic property ... is deprecated"
---
tests/tine20/Tinebase/User/LdapTest.php | 2 +
.../Setup/Backend/Schema/Index/Abstract.php | 66 ++-----------------
tine20/Setup/Backend/Schema/Index/Mysql.php | 10 +--
tine20/Setup/Backend/Schema/Index/Xml.php | 3 +-
tine20/Tinebase/Group/Ldap.php | 2 +
tine20/Tinebase/ModelConfiguration.php | 8 +++
6 files changed, 22 insertions(+), 69 deletions(-)
diff --git a/tests/tine20/Tinebase/User/LdapTest.php b/tests/tine20/Tinebase/User/LdapTest.php
index 19cf7e16601..49832d0b1a2 100644
--- a/tests/tine20/Tinebase/User/LdapTest.php
+++ b/tests/tine20/Tinebase/User/LdapTest.php
@@ -20,6 +20,8 @@ class Tinebase_User_LdapTest extends TestCase
* @var Tinebase_User_LDAP
*/
protected $_backend = NULL;
+
+ protected $objects;
/**
* Sets up the fixture.
diff --git a/tine20/Setup/Backend/Schema/Index/Abstract.php b/tine20/Setup/Backend/Schema/Index/Abstract.php
index 16676a69ba9..4bfcbc4d129 100644
--- a/tine20/Setup/Backend/Schema/Index/Abstract.php
+++ b/tine20/Setup/Backend/Schema/Index/Abstract.php
@@ -4,11 +4,10 @@
*
* @package Setup
* @license http://www.gnu.org/licenses/agpl.html
- * @copyright Copyright (c) 2008 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @copyright Copyright (c) 2008-2024 Metaways Infosystems GmbH (http://www.metaways.de)
* @author Matthias Greiling
*/
-
abstract class Setup_Backend_Schema_Index_Abstract extends Setup_Backend_Schema_Abstract
{
@@ -59,14 +58,14 @@ abstract class Setup_Backend_Schema_Index_Abstract extends Setup_Backend_Schema_
*
* @var string
*/
- public $referencetable;
+ public $referenceTable;
/**
* name of referenced table field/column of foreign key
*
* @var string
*/
- public $referencefield;
+ public $referenceField;
/**
* defines behaviour of foreign key
@@ -88,66 +87,13 @@ abstract class Setup_Backend_Schema_Index_Abstract extends Setup_Backend_Schema_
* @var integer
*/
public $length = NULL;
-
+
+ public $fulltext;
+
abstract protected function _setIndex($_declaration);
public function setForeignKey($_foreign)
{
$this->foreign = 'true';
}
-
-//
-// /**
-// * set index from declaration
-// * @param stdClass $_declaration
-// * NOT IMPLEMENTED YET
-// */
-// public function addIndex($_definition)
-// {
-// foreach ($this->declaration['index'] as $index) {
-// if ($index->field['name'] == $_definition['COLUMN_NAME']) {
-// if ($_definition['CONSTRAINT_NAME'] == 'PRIMARY') {
-// $index->setName($_definition['COLUMN_NAME']);
-// } else {
-// $index->setName($_definition['CONSTRAINT_NAME']);
-// }
-// }
-// }
-// }
-//
-// /**
-// * set index from declaration
-// * @param stdClass $_declaration
-// * NOT IMPLEMENTED YET
-// */
-// public function setIndex($_definition)
-// {
-// foreach ($this->declaration['index'] as $index) {
-// if ($index->field['name'] == $_definition['COLUMN_NAME']) {
-// if ($_definition['CONSTRAINT_NAME'] == 'PRIMARY') {
-// $index->setName($_definition['COLUMN_NAME']);
-// } else {
-// $index->setName($_definition['CONSTRAINT_NAME']);
-// }
-// }
-// }
-// }
-//
-// /**
-// * set index from declaration
-// * @param stdClass $_declaration
-// * NOT IMPLEMENTED YET
-// */
-// public function setForeign($_definition)
-// {
-// foreach ($this->declaration['index'] as $index) {
-// //// auto shutup by cweiss: echo "" . substr($_definition['CONSTRAINT_NAME'], strlen(SQL_TABLE_PREFIX)) . "/" .$index->field->name. "
";
-//
-// //if ($index->field->name == substr($_definition['CONSTRAINT_NAME'], strlen(SQL_TABLE_PREFIX)))
-// //{
-// $index->setForeignKey($_definition);
-// //}
-// }
-// }
-
}
diff --git a/tine20/Setup/Backend/Schema/Index/Mysql.php b/tine20/Setup/Backend/Schema/Index/Mysql.php
index ff5aee5f793..b018c9e40c5 100644
--- a/tine20/Setup/Backend/Schema/Index/Mysql.php
+++ b/tine20/Setup/Backend/Schema/Index/Mysql.php
@@ -4,11 +4,10 @@
*
* @package Setup
* @license http://www.gnu.org/licenses/agpl.html
- * @copyright Copyright (c) 2008 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @copyright Copyright (c) 2008-2024 Metaways Infosystems GmbH (http://www.metaways.de)
* @author Matthias Greiling
*/
-
class Setup_Backend_Schema_Index_Mysql extends Setup_Backend_Schema_Index_Abstract
{
@@ -20,13 +19,10 @@ public function __construct($_declaration)
public function setForeignKey($_declaration)
{
parent::setForeignKey($_declaration);
- $this->referencetable = substr($_declaration['REFERENCED_TABLE_NAME'], strlen(SQL_TABLE_PREFIX));
- $this->referencefield = $_declaration['REFERENCED_COLUMN_NAME'];
-// $this->referenceOnDelete;
-// $this->referenceOnUpdate;
+ $this->referenceTable = substr($_declaration['REFERENCED_TABLE_NAME'], strlen(SQL_TABLE_PREFIX));
+ $this->referenceField = $_declaration['REFERENCED_COLUMN_NAME'];
}
-
/**
* set Setup_Backend_Schema_Table from a given database query
*
diff --git a/tine20/Setup/Backend/Schema/Index/Xml.php b/tine20/Setup/Backend/Schema/Index/Xml.php
index 3fd30afbec4..a4f39ff7315 100644
--- a/tine20/Setup/Backend/Schema/Index/Xml.php
+++ b/tine20/Setup/Backend/Schema/Index/Xml.php
@@ -4,11 +4,10 @@
*
* @package Setup
* @license http://www.gnu.org/licenses/agpl.html AGPL3
- * @copyright Copyright (c) 2008 Metaways Infosystems GmbH (http://www.metaways.de)
+ * @copyright Copyright (c) 2008-2024 Metaways Infosystems GmbH (http://www.metaways.de)
* @author Matthias Greiling
*/
-
class Setup_Backend_Schema_Index_Xml extends Setup_Backend_Schema_Index_Abstract
{
/**
diff --git a/tine20/Tinebase/Group/Ldap.php b/tine20/Tinebase/Group/Ldap.php
index 0628f1d0c83..4e592d9fbc3 100644
--- a/tine20/Tinebase/Group/Ldap.php
+++ b/tine20/Tinebase/Group/Ldap.php
@@ -85,6 +85,8 @@ class Tinebase_Group_Ldap extends Tinebase_Group_Sql implements Tinebase_Group_I
protected $_isReadOnlyBackend = false;
protected $_isDisabledBackend = false;
+
+ protected $_baseDn;
/**
* the constructor
diff --git a/tine20/Tinebase/ModelConfiguration.php b/tine20/Tinebase/ModelConfiguration.php
index 0aaf1336127..c8f1f38eba6 100644
--- a/tine20/Tinebase/ModelConfiguration.php
+++ b/tine20/Tinebase/ModelConfiguration.php
@@ -406,6 +406,14 @@ 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 = [];
/**