diff --git a/administrator/components/com_finder/src/Indexer/Taxonomy.php b/administrator/components/com_finder/src/Indexer/Taxonomy.php index 5091a21b92d4a..eaecd1b29d692 100644 --- a/administrator/components/com_finder/src/Indexer/Taxonomy.php +++ b/administrator/components/com_finder/src/Indexer/Taxonomy.php @@ -13,6 +13,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\Tree\NodeInterface; use Joomla\Component\Finder\Administrator\Table\MapTable; +use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -256,7 +257,7 @@ protected static function storeNode($node, $parentId) $nodeTable->rebuildPath($nodeTable->id); // Add the node to the cache. - static::$nodes[$parentId . ':' . $nodeTable->title] = (object) $nodeTable->getProperties(); + static::$nodes[$parentId . ':' . $nodeTable->title] = (object) ArrayHelper::fromObject($nodeTable, false); return static::$nodes[$parentId . ':' . $nodeTable->title]->id; } diff --git a/administrator/components/com_finder/src/Table/MapTable.php b/administrator/components/com_finder/src/Table/MapTable.php index 5586fb818f8e6..85a82100f319a 100644 --- a/administrator/components/com_finder/src/Table/MapTable.php +++ b/administrator/components/com_finder/src/Table/MapTable.php @@ -16,6 +16,7 @@ use Joomla\CMS\Table\Nested; use Joomla\Database\DatabaseInterface; use Joomla\Event\DispatcherInterface; +use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -72,7 +73,7 @@ public function check() $this->alias = ApplicationHelper::stringURLSafe($this->title, $this->language); if (trim($this->alias) == '') { - $this->alias = md5(serialize($this->getProperties())); + $this->alias = md5(serialize(ArrayHelper::fromObject($this, false))); } return true; diff --git a/administrator/components/com_guidedtours/src/Model/TourModel.php b/administrator/components/com_guidedtours/src/Model/TourModel.php index 11363b2a8e504..c3341d78f714e 100644 --- a/administrator/components/com_guidedtours/src/Model/TourModel.php +++ b/administrator/components/com_guidedtours/src/Model/TourModel.php @@ -221,7 +221,7 @@ public function getItem($pk = null) } // Convert to an object before adding other data. - $properties = $table->getProperties(1); + $properties = ArrayHelper::fromObject($table, false); $item = ArrayHelper::toObject($properties); if (property_exists($item, 'params')) { diff --git a/administrator/components/com_languages/src/Model/LanguageModel.php b/administrator/components/com_languages/src/Model/LanguageModel.php index 5ae98e8ac1828..b2f691ce75e2c 100644 --- a/administrator/components/com_languages/src/Model/LanguageModel.php +++ b/administrator/components/com_languages/src/Model/LanguageModel.php @@ -129,7 +129,7 @@ public function getItem($langId = null) $table->access = (int) Factory::getApplication()->get('access'); } - $properties = $table->getProperties(1); + $properties = ArrayHelper::fromObject($table, false); $value = ArrayHelper::toObject($properties); return $value; diff --git a/administrator/components/com_mails/src/Model/TemplateModel.php b/administrator/components/com_mails/src/Model/TemplateModel.php index 6251622911d5b..9c857fd7abd1b 100644 --- a/administrator/components/com_mails/src/Model/TemplateModel.php +++ b/administrator/components/com_mails/src/Model/TemplateModel.php @@ -163,7 +163,7 @@ public function getItem($pk = null) } // Convert to an object before adding other data. - $properties = $table->getProperties(1); + $properties = ArrayHelper::fromObject($table, false); $item = ArrayHelper::toObject($properties); if (property_exists($item, 'params')) { @@ -209,7 +209,7 @@ public function getMaster($pk = null) } // Convert to an object before adding other data. - $properties = $table->getProperties(1); + $properties = ArrayHelper::fromObject($table, false); $item = ArrayHelper::toObject($properties); if (property_exists($item, 'params')) { diff --git a/administrator/components/com_menus/src/Model/ItemModel.php b/administrator/components/com_menus/src/Model/ItemModel.php index eef5669297967..29659dae5e338 100644 --- a/administrator/components/com_menus/src/Model/ItemModel.php +++ b/administrator/components/com_menus/src/Model/ItemModel.php @@ -715,7 +715,7 @@ public function getItem($pk = null) $this->setState('item.type', $table->type); // Convert to the \Joomla\CMS\Object\CMSObject before adding the params. - $properties = $table->getProperties(1); + $properties = ArrayHelper::fromObject($table, false); $result = ArrayHelper::toObject($properties); // Convert the params field to an array. @@ -1024,7 +1024,7 @@ protected function getMenuType($menutype) $table->load(['menutype' => $menutype]); - return (object) $table->getProperties(); + return (object) ArrayHelper::fromObject($table, false); } /** diff --git a/administrator/components/com_menus/src/Model/MenuModel.php b/administrator/components/com_menus/src/Model/MenuModel.php index 958949cde8053..6db90d499df32 100644 --- a/administrator/components/com_menus/src/Model/MenuModel.php +++ b/administrator/components/com_menus/src/Model/MenuModel.php @@ -145,7 +145,7 @@ public function getItem($itemId = null) return false; } - $properties = $table->getProperties(1); + $properties = ArrayHelper::fromObject($table, false); $value = ArrayHelper::toObject($properties); return $value; diff --git a/administrator/components/com_modules/src/Model/ModuleModel.php b/administrator/components/com_modules/src/Model/ModuleModel.php index 4c5cbbd775bb0..1432fbda01d23 100644 --- a/administrator/components/com_modules/src/Model/ModuleModel.php +++ b/administrator/components/com_modules/src/Model/ModuleModel.php @@ -704,7 +704,7 @@ public function getItem($pk = null) } // Convert to an object before adding other data. - $properties = $table->getProperties(1); + $properties = ArrayHelper::fromObject($table, false); $this->_cache[$pk] = ArrayHelper::toObject($properties); // Convert the params field to an array. diff --git a/administrator/components/com_plugins/src/Model/PluginModel.php b/administrator/components/com_plugins/src/Model/PluginModel.php index 5a4f9bb16d1ec..92cfcb07e3e29 100644 --- a/administrator/components/com_plugins/src/Model/PluginModel.php +++ b/administrator/components/com_plugins/src/Model/PluginModel.php @@ -174,7 +174,7 @@ public function getItem($pk = null) } // Convert to an object before adding other data. - $properties = $table->getProperties(1); + $properties = ArrayHelper::fromObject($table, false); $this->_cache[$cacheId] = ArrayHelper::toObject($properties); // Convert the params field to an array. diff --git a/administrator/components/com_users/src/Model/GroupModel.php b/administrator/components/com_users/src/Model/GroupModel.php index 17ca3f701cc55..82e4932014d70 100644 --- a/administrator/components/com_users/src/Model/GroupModel.php +++ b/administrator/components/com_users/src/Model/GroupModel.php @@ -277,7 +277,7 @@ public function delete(&$pks) if ($allow) { // Fire the before delete event. $beforeDeleteEvent = new UserGroupBeforeDeleteEvent($this->event_before_delete, [ - 'data' => $table->getProperties(), // @TODO: Remove data argument in Joomla 6, see UserGroupBeforeDeleteEvent + 'data' => ArrayHelper::fromObject($table, false), // @TODO: Remove data argument in Joomla 6, see UserGroupBeforeDeleteEvent 'context' => $context, 'subject' => $table, ]); @@ -297,7 +297,7 @@ public function delete(&$pks) // Trigger the after delete event. $dispatcher->dispatch($this->event_after_delete, new UserGroupAfterDeleteEvent($this->event_after_delete, [ - 'data' => $table->getProperties(), // @TODO: Remove data argument in Joomla 6, see UserGroupAfterDeleteEvent + 'data' => ArrayHelper::fromObject($table, false), // @TODO: Remove data argument in Joomla 6, see UserGroupAfterDeleteEvent 'deletingResult' => true, // @TODO: Remove deletingResult argument in Joomla 6, see UserGroupAfterDeleteEvent 'errorMessage' => $this->getError(), // @TODO: Remove errorMessage argument in Joomla 6, see UserGroupAfterDeleteEvent 'context' => $context, diff --git a/administrator/components/com_users/src/Model/UserModel.php b/administrator/components/com_users/src/Model/UserModel.php index 878c64d2324ce..5482a9e4e00db 100644 --- a/administrator/components/com_users/src/Model/UserModel.php +++ b/administrator/components/com_users/src/Model/UserModel.php @@ -353,7 +353,7 @@ public function delete(&$pks) $dispatcher->dispatch( $this->event_before_delete, new BeforeDeleteEvent($this->event_before_delete, [ - 'subject' => $table->getProperties(), + 'subject' => ArrayHelper::fromObject($table, false), ]) ); @@ -423,7 +423,7 @@ public function block(&$pks, $value = 1) unset($pks[$i]); Factory::getApplication()->enqueueMessage(Text::_('COM_USERS_USERS_ERROR_CANNOT_BLOCK_SELF'), 'error'); } elseif ($table->load($pk)) { - $old = $table->getProperties(); + $old = ArrayHelper::fromObject($table, false); $allow = $user->authorise('core.edit.state', 'com_users'); // Don't allow non-super-admin to delete a super admin @@ -457,7 +457,7 @@ public function block(&$pks, $value = 1) new BeforeSaveEvent($this->event_before_save, [ 'subject' => $old, 'isNew' => false, - 'data' => $table->getProperties(), + 'data' => ArrayHelper::fromObject($table, false), ]) )->getArgument('result', []); @@ -479,7 +479,7 @@ public function block(&$pks, $value = 1) // Trigger the after save event $dispatcher->dispatch($this->event_after_save, new AfterSaveEvent($this->event_after_save, [ - 'subject' => $table->getProperties(), + 'subject' => ArrayHelper::fromObject($table, false), 'isNew' => false, 'savingResult' => true, 'errorMessage' => null, @@ -584,7 +584,7 @@ public function activate(&$pks) // Activate and send the notification email foreach ($pks as $i => $pk) { if ($table->load($pk)) { - $prevUserData = $table->getProperties(); + $prevUserData = ArrayHelper::fromObject($table, false); $allow = $user->authorise('core.edit.state', 'com_users'); // Don't allow non-super-admin to edit the active status of a super admin @@ -616,7 +616,7 @@ public function activate(&$pks) new BeforeSaveEvent($this->event_before_save, [ 'subject' => $prevUserData, 'isNew' => false, - 'data' => $table->getProperties(), + 'data' => ArrayHelper::fromObject($table, false), ]) )->getArgument('result', []); @@ -635,7 +635,7 @@ public function activate(&$pks) // Fire the after save event $dispatcher->dispatch($this->event_after_save, new AfterSaveEvent($this->event_after_save, [ - 'subject' => $table->getProperties(), + 'subject' => ArrayHelper::fromObject($table, false), 'isNew' => false, 'savingResult' => true, 'errorMessage' => null, diff --git a/administrator/components/com_workflow/src/Model/StagesModel.php b/administrator/components/com_workflow/src/Model/StagesModel.php index 8a600e5cd225a..651358b525488 100644 --- a/administrator/components/com_workflow/src/Model/StagesModel.php +++ b/administrator/components/com_workflow/src/Model/StagesModel.php @@ -17,6 +17,7 @@ use Joomla\CMS\MVC\Model\ListModel; use Joomla\Database\ParameterType; use Joomla\Database\QueryInterface; +use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -201,7 +202,7 @@ public function getWorkflow() $table->load($workflowId); } - return (object) $table->getProperties(); + return (object) ArrayHelper::fromObject($table, false); } /** diff --git a/administrator/components/com_workflow/src/Model/TransitionModel.php b/administrator/components/com_workflow/src/Model/TransitionModel.php index 448625d4dc658..9242a22b3920f 100644 --- a/administrator/components/com_workflow/src/Model/TransitionModel.php +++ b/administrator/components/com_workflow/src/Model/TransitionModel.php @@ -17,6 +17,7 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\Registry\Registry; use Joomla\String\StringHelper; +use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -298,7 +299,7 @@ public function getWorkflow() $workflow->load($workflow_id); - return (object) $workflow->getProperties(); + return (object) ArrayHelper::fromObject($workflow, false); } /** diff --git a/administrator/components/com_workflow/src/Model/TransitionsModel.php b/administrator/components/com_workflow/src/Model/TransitionsModel.php index 68c8349e55c0a..142081d9ce105 100644 --- a/administrator/components/com_workflow/src/Model/TransitionsModel.php +++ b/administrator/components/com_workflow/src/Model/TransitionsModel.php @@ -16,6 +16,7 @@ use Joomla\CMS\MVC\Model\ListModel; use Joomla\Database\ParameterType; use Joomla\Database\QueryInterface; +use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -246,6 +247,6 @@ public function getWorkflow() $table->load($workflowId); } - return (object) $table->getProperties(); + return (object) ArrayHelper::fromObject($table, false); } } diff --git a/components/com_contact/src/Model/FormModel.php b/components/com_contact/src/Model/FormModel.php index 9ea86cd1b9f01..280d88320a1b2 100644 --- a/components/com_contact/src/Model/FormModel.php +++ b/components/com_contact/src/Model/FormModel.php @@ -105,7 +105,7 @@ public function getItem($itemId = null) return false; } - $properties = $table->getProperties(); + $properties = ArrayHelper::fromObject($table, false); $value = ArrayHelper::toObject($properties); // Convert field to Registry. diff --git a/components/com_content/src/Model/FormModel.php b/components/com_content/src/Model/FormModel.php index 35933a855684e..3d1d28440f5e9 100644 --- a/components/com_content/src/Model/FormModel.php +++ b/components/com_content/src/Model/FormModel.php @@ -98,7 +98,7 @@ public function getItem($itemId = null) return false; } - $properties = $table->getProperties(1); + $properties = ArrayHelper::fromObject($table, false); $value = ArrayHelper::toObject($properties); // Convert attrib field to Registry. diff --git a/components/com_tags/src/Model/TagModel.php b/components/com_tags/src/Model/TagModel.php index 8fe1181846741..d11e9d437cc8b 100644 --- a/components/com_tags/src/Model/TagModel.php +++ b/components/com_tags/src/Model/TagModel.php @@ -294,7 +294,7 @@ public function getItem($pk = null) } // Convert the Table to a clean object. - $properties = $table->getProperties(1); + $properties = ArrayHelper::fromObject($table, false); $this->item[] = ArrayHelper::toObject($properties); } catch (\RuntimeException $e) { $this->setError($e->getMessage()); diff --git a/libraries/src/Table/Table.php b/libraries/src/Table/Table.php index c3864603ad58d..a2b6998f71108 100644 --- a/libraries/src/Table/Table.php +++ b/libraries/src/Table/Table.php @@ -26,6 +26,7 @@ use Joomla\Event\DispatcherInterface; use Joomla\Filesystem\Path; use Joomla\String\StringHelper; +use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -45,7 +46,6 @@ abstract class Table extends \stdClass implements TableInterface, DispatcherAwar use LegacyErrorHandlingTrait; use LegacyPropertyManagementTrait; - /** * Include paths for searching for Table classes. * @@ -728,7 +728,7 @@ public function bind($src, $ignore = []) } // Bind the source value, excluding the ignored fields. - foreach ($this->getProperties() as $k => $v) { + foreach (ArrayHelper::fromObject($this, false) as $k => $v) { // Only process fields not in the ignore array. if (!\in_array($k, $ignore)) { if (\array_key_exists($k, $src)) { @@ -816,7 +816,7 @@ public function load($keys = null, $reset = true) $query = $db->createQuery() ->select('*') ->from($db->quoteName($this->_tbl)); - $fields = array_keys($this->getProperties()); + $fields = array_keys(ArrayHelper::fromObject($this, false)); foreach ($keys as $field => $value) { // Check that $field is in the table. diff --git a/libraries/src/User/User.php b/libraries/src/User/User.php index b34a4bb9bb20b..2057efe7b3563 100644 --- a/libraries/src/User/User.php +++ b/libraries/src/User/User.php @@ -879,7 +879,7 @@ public function load($id) } // Assuming all is well at this point let's bind the data - foreach ($table->getProperties() as $key => $value) { + foreach (ArrayHelper::fromObject($table, false) as $key => $value) { $this->$key = $value; } diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index ce04d526a0c2b..48d42c81821eb 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1742,16 +1742,6 @@ parameters: count: 2 path: administrator/components/com_finder/src/Indexer/Taxonomy.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 1 - path: administrator/components/com_finder/src/Indexer/Taxonomy.php - - message: ''' #^Call to deprecated method getUser\(\) of class Joomla\\CMS\\Factory\: @@ -1968,16 +1958,6 @@ parameters: count: 2 path: administrator/components/com_finder/src/Table/FilterTable.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 1 - path: administrator/components/com_finder/src/Table/MapTable.php - - message: ''' #^Call to deprecated method setError\(\) of class Joomla\\CMS\\Table\\Table\: @@ -2107,16 +2087,6 @@ parameters: count: 7 path: administrator/components/com_guidedtours/src/Model/TourModel.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 1 - path: administrator/components/com_guidedtours/src/Model/TourModel.php - - message: ''' #^Call to deprecated method setError\(\) of class Joomla\\CMS\\MVC\\Model\\BaseModel\: @@ -2767,16 +2737,6 @@ parameters: count: 6 path: administrator/components/com_languages/src/Model/LanguageModel.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 1 - path: administrator/components/com_languages/src/Model/LanguageModel.php - - message: ''' #^Call to deprecated method setError\(\) of class Joomla\\CMS\\MVC\\Model\\BaseModel\: @@ -3087,16 +3047,6 @@ parameters: count: 8 path: administrator/components/com_mails/src/Model/TemplateModel.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 2 - path: administrator/components/com_mails/src/Model/TemplateModel.php - - message: ''' #^Call to deprecated method setError\(\) of class Joomla\\CMS\\MVC\\Model\\BaseModel\: @@ -3381,16 +3331,6 @@ parameters: count: 1 path: administrator/components/com_menus/src/Model/ItemModel.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 2 - path: administrator/components/com_menus/src/Model/ItemModel.php - - message: ''' #^Call to deprecated method setError\(\) of class Joomla\\CMS\\MVC\\Model\\BaseModel\: @@ -3437,16 +3377,6 @@ parameters: count: 1 path: administrator/components/com_menus/src/Model/MenuModel.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 1 - path: administrator/components/com_menus/src/Model/MenuModel.php - - message: ''' #^Call to deprecated method setError\(\) of class Joomla\\CMS\\MVC\\Model\\BaseModel\: @@ -3782,16 +3712,6 @@ parameters: count: 1 path: administrator/components/com_modules/src/Model/ModuleModel.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 1 - path: administrator/components/com_modules/src/Model/ModuleModel.php - - message: ''' #^Call to deprecated method setError\(\) of class Joomla\\CMS\\MVC\\Model\\BaseModel\: @@ -4068,16 +3988,6 @@ parameters: count: 1 path: administrator/components/com_plugins/src/Model/PluginModel.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 1 - path: administrator/components/com_plugins/src/Model/PluginModel.php - - message: ''' #^Call to deprecated method getLanguage\(\) of class Joomla\\CMS\\Factory\: @@ -5156,16 +5066,6 @@ parameters: count: 1 path: administrator/components/com_users/src/Model/GroupModel.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 2 - path: administrator/components/com_users/src/Model/GroupModel.php - - message: ''' #^Call to deprecated method setError\(\) of class Joomla\\CMS\\MVC\\Model\\BaseModel\: @@ -5311,16 +5211,6 @@ parameters: count: 1 path: administrator/components/com_users/src/Model/UserModel.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 7 - path: administrator/components/com_users/src/Model/UserModel.php - - message: ''' #^Call to deprecated method setError\(\) of class Joomla\\CMS\\MVC\\Model\\BaseModel\: @@ -5597,36 +5487,6 @@ parameters: count: 2 path: administrator/components/com_workflow/src/Model/StageModel.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 1 - path: administrator/components/com_workflow/src/Model/StagesModel.php - - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 1 - path: administrator/components/com_workflow/src/Model/TransitionModel.php - - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 1 - path: administrator/components/com_workflow/src/Model/TransitionsModel.php - - message: ''' #^Call to deprecated method setError\(\) of class Joomla\\CMS\\MVC\\Model\\BaseModel\: @@ -6407,16 +6267,6 @@ parameters: count: 2 path: components/com_content/src/Model/FormModel.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 1 - path: components/com_content/src/Model/FormModel.php - - message: ''' #^Call to deprecated method setError\(\) of class Joomla\\CMS\\MVC\\Model\\BaseModel\: @@ -6936,16 +6786,6 @@ parameters: count: 1 path: components/com_tags/src/Helper/RouteHelper.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 1 - path: components/com_tags/src/Model/TagModel.php - - message: ''' #^Call to deprecated method setError\(\) of class Joomla\\CMS\\MVC\\Model\\BaseModel\: @@ -11458,17 +11298,6 @@ parameters: count: 1 path: libraries/src/MVC/Model/BaseModel.php - - - message: ''' - #^Usage of deprecated trait Joomla\\CMS\\Object\\LegacyPropertyManagementTrait in class Joomla\\CMS\\MVC\\Model\\BaseModel\: - 4\.3\.0 will be removed in 7\.0 - Will be removed without replacement - Create proper setter functions for the individual properties or use a \\Joomla\\Registry\\Registry$# - ''' - identifier: traitUse.deprecatedTrait - count: 1 - path: libraries/src/MVC/Model/BaseModel.php - - message: ''' #^Call to deprecated method getError\(\) of class Joomla\\CMS\\Table\\Table\: @@ -11523,17 +11352,6 @@ parameters: count: 1 path: libraries/src/MVC/View/AbstractView.php - - - message: ''' - #^Usage of deprecated trait Joomla\\CMS\\Object\\LegacyPropertyManagementTrait in class Joomla\\CMS\\MVC\\View\\AbstractView\: - 4\.3\.0 will be removed in 7\.0 - Will be removed without replacement - Create proper setter functions for the individual properties or use a \\Joomla\\Registry\\Registry$# - ''' - identifier: traitUse.deprecatedTrait - count: 1 - path: libraries/src/MVC/View/AbstractView.php - - message: '#^Access to an undefined property Joomla\\CMS\\MVC\\View\\CategoriesView\:\:\$maxLevelcat\.$#' identifier: property.notFound @@ -12305,16 +12123,6 @@ parameters: count: 3 path: libraries/src/Table/Table.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 2 - path: libraries/src/Table/Table.php - - message: ''' #^Call to deprecated method setError\(\) of class Joomla\\CMS\\Table\\Table\: @@ -12669,16 +12477,6 @@ parameters: count: 2 path: libraries/src/User/User.php - - - message: ''' - #^Call to deprecated method getProperties\(\) of class Joomla\\CMS\\Table\\Table\: - 4\.3\.0 will be removed in 7\.0 - Create a proper getter function for the property$# - ''' - identifier: method.deprecated - count: 1 - path: libraries/src/User/User.php - - message: ''' #^Call to deprecated method getUser\(\) of class Joomla\\CMS\\Factory\: diff --git a/plugins/content/joomla/src/Extension/Joomla.php b/plugins/content/joomla/src/Extension/Joomla.php index 5b70804c996a0..69f78a1fd0dc4 100644 --- a/plugins/content/joomla/src/Extension/Joomla.php +++ b/plugins/content/joomla/src/Extension/Joomla.php @@ -744,7 +744,7 @@ private function canDeleteCategories($data) $table = $tableInfo[$extension]['table_name']; // See if this category has any content items - $count = $this->countItemsInCategory($table, $data->get('id')); + $count = $this->countItemsInCategory($table, $data->id); // Return false if db error if ($count === false) { @@ -752,7 +752,7 @@ private function canDeleteCategories($data) } else { // Show error if items are found in the category if ($count > 0) { - $msg = Text::sprintf('COM_CATEGORIES_DELETE_NOT_ALLOWED', $data->get('title')) + $msg = Text::sprintf('COM_CATEGORIES_DELETE_NOT_ALLOWED', $data->title) . ' ' . Text::plural('COM_CATEGORIES_N_ITEMS_ASSIGNED', $count); $this->getApplication()->enqueueMessage($msg, 'error'); $result = false; @@ -760,12 +760,12 @@ private function canDeleteCategories($data) // Check for items in any child categories (if it is a leaf, there are no child categories) if (!$data->isLeaf()) { - $count = $this->countItemsInChildren($table, $data->get('id'), $data); + $count = $this->countItemsInChildren($table, $data->id, $data); if ($count === false) { $result = false; } elseif ($count > 0) { - $msg = Text::sprintf('COM_CATEGORIES_DELETE_NOT_ALLOWED', $data->get('title')) + $msg = Text::sprintf('COM_CATEGORIES_DELETE_NOT_ALLOWED', $data->title) . ' ' . Text::plural('COM_CATEGORIES_HAS_SUBCATEGORY_ITEMS', $count); $this->getApplication()->enqueueMessage($msg, 'error'); $result = false; diff --git a/tests/Integration/Libraries/Cms/Table/TableTest.php b/tests/Integration/Libraries/Cms/Table/TableTest.php index 9937ab281a166..abef0abf7a68d 100644 --- a/tests/Integration/Libraries/Cms/Table/TableTest.php +++ b/tests/Integration/Libraries/Cms/Table/TableTest.php @@ -209,7 +209,11 @@ public function testBindJSONEncodesFields() ], ]; - $this->object->set('_jsonEncode', ['params']); + $reflection = new \ReflectionClass($this->object); + $reflection_property = $reflection->getProperty('_jsonEncode'); + $reflection_property->setAccessible(true); + + $reflection_property->setValue($this->object, ['params']); $this->object->bind($data);