Skip to content

Commit eda2c2c

Browse files
HLeithnerrichard67
andauthored
[5.0] b/c plugin for deprecation (#40664)
* Add compatibility plugin and move classmap * remove classmap from unit tests * Use namespace for html helper tests * PoC for Table::getInstance JTable prefix * Revert cache plugin change * PoC HTMLHelper correct namespace * revert drone change * Activate the plugin by default on new installations * Fix system plugins ordering in base.sql * Add insert of extension to update SQL * Add to core plugins in ExtensionHelper * Replace JTable references, revert Table::getInstance logic * Add Table::getInstance JTable logic including explanation * Cleanup plugin * Disable again for new installations * Activate B/C plugin on new installation * Initialise the Extension table with the real database object * Support custom database object on language load * Fix wrong function usage * Add renamed non PascalCase table aliases and fix occurrence * Disable plugin on new installations again --------- Co-authored-by: Richard Fath <[email protected]>
1 parent 99072de commit eda2c2c

File tree

96 files changed

+443
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+443
-231
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
DROP TABLE IF EXISTS `#__utf8_conversion`;
2+
3+
INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) VALUES
4+
(0, 'plg_system_compat', 'plugin', 'compat', 'system', 0, 1, 1, 0, 1, '', '{"classes_aliases":"1"}', '', 0, 0);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
DROP TABLE IF EXISTS "#__utf8_conversion";
2+
3+
INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES
4+
(0, 'plg_system_compat', 'plugin', 'compat', 'system', 0, 1, 1, 0, 1, '', '{"classes_aliases":"1"}', '', 0, 0);

administrator/components/com_associations/src/Model/AssociationsModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ protected function getListQuery()
395395
$baselevel = 1;
396396

397397
if ($categoryId = $this->getState('filter.category_id')) {
398-
$categoryTable = Table::getInstance('Category', 'JTable');
398+
$categoryTable = Table::getInstance('Category', '\\Joomla\\CMS\\Table\\');
399399
$categoryTable->load($categoryId);
400400
$baselevel = (int) $categoryTable->level;
401401

administrator/components/com_banners/src/Model/BannerModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ protected function canDelete($record)
164164
* for alias and title to use the batch move and copy methods
165165
*
166166
* @param integer $categoryId The target category id
167-
* @param Table $table The JTable within which move or copy is taking place
167+
* @param Table $table The \Joomla\CMS\Table\Table within which move or copy is taking place
168168
*
169169
* @return void
170170
*

administrator/components/com_banners/src/Table/BannerTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function check()
160160
/**
161161
* Overloaded bind function
162162
*
163-
* @param mixed $array An associative array or object to bind to the \JTable instance.
163+
* @param mixed $array An associative array or object to bind to the \Joomla\CMS\Table\Table instance.
164164
* @param mixed $ignore An optional array or space separated list of properties to ignore while binding.
165165
*
166166
* @return boolean True on success

administrator/components/com_categories/src/Controller/AjaxController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function fetchAssociations()
6464

6565
// Add the title to each of the associated records
6666
Table::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/tables');
67-
$categoryTable = Table::getInstance('Category', 'JTable');
67+
$categoryTable = Table::getInstance('Category', '\\Joomla\\CMS\\Table\\');
6868

6969
foreach ($associations as $lang => $association) {
7070
$categoryTable->load($association->id);

administrator/components/com_contact/src/Model/ContactsModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ protected function getListQuery()
323323
// Case: Using both categories filter and by level filter
324324
if (count($categoryId)) {
325325
$categoryId = ArrayHelper::toInteger($categoryId);
326-
$categoryTable = Table::getInstance('Category', 'JTable');
326+
$categoryTable = Table::getInstance('Category', '\\Joomla\\CMS\\Table\\');
327327
$subCatItemsWhere = [];
328328

329329
// @todo: Convert to prepared statement

administrator/components/com_contact/src/Table/ContactTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ public function store($updateNulls = true)
140140
*
141141
* @return boolean True on success, false on failure
142142
*
143-
* @see \JTable::check
143+
* @see \Joomla\CMS\Table\Table::check
144144
* @since 1.5
145145
*/
146146
public function check()

administrator/components/com_content/src/Controller/AjaxController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function fetchAssociations()
6161
unset($associations[$excludeLang]);
6262

6363
// Add the title to each of the associated records
64-
$contentTable = Table::getInstance('Content', 'JTable');
64+
$contentTable = Table::getInstance('Content', '\\Joomla\\CMS\\Table\\');
6565

6666
foreach ($associations as $lang => $association) {
6767
$contentTable->load($association->id);

administrator/components/com_content/src/Model/ArticlesModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ protected function getListQuery()
394394
// Case: Using both categories filter and by level filter
395395
if (count($categoryId)) {
396396
$categoryId = ArrayHelper::toInteger($categoryId);
397-
$categoryTable = Table::getInstance('Category', 'JTable');
397+
$categoryTable = Table::getInstance('Category', '\\Joomla\\CMS\\Table\\');
398398
$subCatItemsWhere = [];
399399

400400
foreach ($categoryId as $key => $filter_catid) {

0 commit comments

Comments
 (0)