diff --git a/.drone.yml b/.drone.yml index 99680ef2936c6..93e1a53c18ee9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -392,7 +392,7 @@ steps: - rclone delete nightly:/home/devj/public_html/nightlies/ --include "Joomla_$MINORVERSION.*" - rclone delete nightly:/home/devj/public_html/cache/com_content/ - rclone copy ./transfer/ nightly:/home/devj/public_html/nightlies/ - - curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla 5.1](https://developer.joomla.org/nightly-builds.html) successfully built."}' $MATTERMOST_NIGHTLY_HOOK + - curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla 5.2](https://developer.joomla.org/nightly-builds.html) successfully built."}' $MATTERMOST_NIGHTLY_HOOK - name: buildfailure image: joomlaprojects/docker-images:packager @@ -400,12 +400,11 @@ steps: MATTERMOST_NIGHTLY_HOOK: from_secret: mattermost_nightly_hook commands: - - curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla 5.1](https://developer.joomla.org/nightly-builds.html) FAILED to built."}' $MATTERMOST_NIGHTLY_HOOK + - curl -i -X POST -H 'Content-Type:application/json' -d '{"text":"Nightly Build for [Joomla 5.2](https://developer.joomla.org/nightly-builds.html) FAILED to built."}' $MATTERMOST_NIGHTLY_HOOK when: status: - failure - trigger: event: - cron @@ -415,6 +414,6 @@ trigger: --- kind: signature -hmac: 96994db51bcdf4b618f2b45fded770b4240977209559ce64e9f47c032648d9a1 +hmac: bd41423d85abadb875c8fc911f87596ead88b62d26fabf6a283737c5a7b4c5b9 ... diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index eb65c17eb65ff..0ba0c000bc816 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,19 +1,18 @@ Contributing to the Joomla! CMS™ =============== -You are welcome to submit a contribution for review and possible inclusion in the Joomla! CMS but, before it will be accepted, we ask that you follow these simple steps: +You are welcome to submit a contribution for review and possible inclusion in the Joomla! CMS but, before it will be accepted, we ask that you follow these simple guidelines: -1) Open an issue on our [Issue Tracker](https://issues.joomla.org/) or here on GitHub. If you can, please provide a fix and create a pull request (PR) instead; this will automatically create an issue for you so you do not have to create an issue if you are creating a pull request. +* If you have a feature request, then please open a discussion to define the feature request and discuss possible solutions. Discussions can be converted into issues when the request is defined sufficiently that a developer can start coding the feature. In this process you will get feedback from the maintainers, if the feature is something for the Joomla core distribution or not. -2) Follow the [Joomla! Coding Standards](https://developer.joomla.org/coding-standards.html). +* If you have found a bug, open an issue on our [Issue Tracker](https://issues.joomla.org/) or here on GitHub. If you can, please provide a fix and create a pull request (PR) instead; this will automatically create an issue for you so you do not have to create an issue, if you are creating a pull request. -3) When filing an issue or opening a PR, please include a clear title and description. The title should be a short summary of an issue and, if possible, should include a reference to an open issue. For example, `Invalid Query in com_admin (Ref #1234)` would be sufficient. All issues and PRs should include a description with as much detail as possible. - If it is a PR, include what the issue is, what the PR is addressing, testing instructions and environmental information (PHP version, database driver and version, and other data you can retrieve from your site's system information view) in case the issue is specific to certain environments. If additional information is needed, please be prepared to provide it as our community members review your submission. +* Follow the [Joomla! Coding Standards](https://manual.joomla.org/docs/get-started/codestyle) for code contributions. -4) Report security issues to the Joomla! Security Strike Team (JSST) at security@joomla.org or use the [JSST contact form](https://developer.joomla.org/contact-security-team.html). Please do not use the public tracker for security issues. +* When filing an issue or opening a Pull Request(PR), please include a clear title and description. The title should be a short summary of the issue. For example, `Invalid Query in com_admin`. All issues and PRs should include a description with as much detail as possible. If it is a PR, include what the issue is, what the PR is addressing, testing instructions and environmental information (PHP version, database driver and version, and other data you can retrieve from your site's system information view) in case the issue is specific to certain environments. If additional information is needed, please be prepared to provide it as our community members review your submission. -5) If you have a feature request, then please open a discussion to define the feature request and discuss possible solutions. Discussions can be converted into issues when the request is defined sufficiently that a developer can start coding the feature. In this process you will get feedback from the maintainers, if the feature is something for the Joomla core distribution or not. +* Report security issues to the Joomla! Security Strike Team (JSST) at security@joomla.org or use the [JSST contact form](https://developer.joomla.org/contact-security-team.html). Please do not use the public tracker for security issues. Find [here](https://github.com/joomla/joomla-cms?tab=security-ov-file#readme) more information about the [Security Policies and Procedures](https://github.com/joomla/joomla-cms?tab=security-ov-file#readme). -Please be patient as not all items will be tested immediately (remember, all bug testing for the Joomla! CMS is done by volunteers) and be receptive to feedback about your code. +Please be patient as not all items will be viewed or tested immediately (remember, all bug testing for the Joomla! CMS is done by volunteers) and be receptive to feedback about your code. #### Branches While 4.4 is in maintenance mode, ie we are still fixing bugs, PRs should be made to the `4.4-dev` branch. Merged bugfixes will be upmerged into the current 5.x branch. If a bug is only in the 5.x series the PR should be made to the current 5.x branch (currently 5.1). diff --git a/README.md b/README.md index b120f5fdbdf9b..02afa95cda298 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,21 @@ Joomla! CMS™ ==================== +The Joomla! 5.2 branch is under heavy development and not all links in this document are available yet +------------------------------------------------------------------------------------------------------ + Build Status ---------------------- + | Drone-CI | AppVeyor | PHP | Node | npm | |------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|---------------------------------------------------------------------------------| -| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg?branch=5.1-dev)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/5.1-dev?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [![PHP](https://img.shields.io/badge/PHP-V8.1.0-green)](https://www.php.net/) | [![node-lts](https://img.shields.io/badge/Node-V18.0-green)](https://nodejs.org/en/) | [![npm](https://img.shields.io/badge/npm-v9.6.7-green)](https://nodejs.org/en/) | +| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg?branch=5.2-dev)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/5.2-dev?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [![PHP](https://img.shields.io/badge/PHP-V8.1.0-green)](https://www.php.net/) | [![node-lts](https://img.shields.io/badge/Node-V18.0-green)](https://nodejs.org/en/) | [![npm](https://img.shields.io/badge/npm-v9.6.7-green)](https://nodejs.org/en/) | Overview --------------------- * This is the source of Joomla! 5.x. * Joomla's [Official website](https://www.joomla.org). -* Joomla! 5.1 [version history](https://docs.joomla.org/Special:MyLanguage/Joomla_5.1_version_history). -* Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/5.1-dev). +* Joomla! 5.2 [version history](https://docs.joomla.org/Special:MyLanguage/Joomla_5.2_version_history). +* Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/5.2-dev). What is Joomla? --------------------- @@ -45,9 +48,9 @@ git clone https://github.com/joomla/joomla-cms.git ```bash cd joomla-cms ``` -- Go to the 5.1-dev branch: +- Go to the 5.2-dev branch: ```bash -git checkout 5.1-dev +git checkout 5.2-dev ``` - Install all the needed composer packages: ```bash diff --git a/README.txt b/README.txt index a55712c2aba9d..65007eade1214 100644 --- a/README.txt +++ b/README.txt @@ -1,10 +1,13 @@ Joomla! CMS™ +The Joomla! 5.2 branch is under heavy development and not all links in this document are available yet +------------------------------------------------------------------------------------------------------ + 1- Overview * This is a Joomla! 5.x installation/upgrade package. * Joomla! Official site: https://www.joomla.org - * Joomla! 5.1 version history - https://docs.joomla.org/Special:MyLanguage/Joomla_5.1_version_history - * Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/5.1-dev + * Joomla! 5.2 version history - https://docs.joomla.org/Special:MyLanguage/Joomla_5.2_version_history + * Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/5.2-dev 2- What is Joomla? * Joomla! is a Content Management System (CMS) which enables you to build websites and powerful online applications. diff --git a/administrator/components/com_actionlogs/src/Model/ActionlogsModel.php b/administrator/components/com_actionlogs/src/Model/ActionlogsModel.php index 4ce6d9e0427b0..0dc3ce23761ff 100644 --- a/administrator/components/com_actionlogs/src/Model/ActionlogsModel.php +++ b/administrator/components/com_actionlogs/src/Model/ActionlogsModel.php @@ -18,8 +18,8 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\ListModel; use Joomla\Database\DatabaseIterator; -use Joomla\Database\DatabaseQuery; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects @@ -79,7 +79,7 @@ protected function populateState($ordering = 'a.id', $direction = 'desc') /** * Build an SQL query to load the list data. * - * @return DatabaseQuery + * @return QueryInterface * * @since 3.9.0 * @@ -298,7 +298,7 @@ public function getLogDataAsIterator($pks = null) * * @param integer[]|null $pks An optional array of log record IDs to load * - * @return DatabaseQuery + * @return QueryInterface * * @since 3.9.0 */ diff --git a/administrator/components/com_actionlogs/tmpl/actionlogs/default.php b/administrator/components/com_actionlogs/tmpl/actionlogs/default.php index d0e868c38dc3d..e0f9d0bf806b1 100644 --- a/administrator/components/com_actionlogs/tmpl/actionlogs/default.php +++ b/administrator/components/com_actionlogs/tmpl/actionlogs/default.php @@ -23,7 +23,7 @@ $listDirn = $this->escape($this->state->get('list.direction')); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('table.columns') ->useScript('multiselect') diff --git a/administrator/components/com_admin/script.php b/administrator/components/com_admin/script.php index 8932fd19a54db..cc6fc488affa0 100644 --- a/administrator/components/com_admin/script.php +++ b/administrator/components/com_admin/script.php @@ -3002,7 +3002,7 @@ private function migrateTinymceConfiguration(): bool /** * setup Guided Tours Unique Identifiers * - * @return boolean True on success + * @return void * * @since 5.0.0 */ diff --git a/administrator/components/com_admin/tmpl/help/default.php b/administrator/components/com_admin/tmpl/help/default.php index 69480f7d90311..14e0a81b9833f 100644 --- a/administrator/components/com_admin/tmpl/help/default.php +++ b/administrator/components/com_admin/tmpl/help/default.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Admin\Administrator\View\Help\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_admin.admin-help'); ?> diff --git a/administrator/components/com_associations/src/Model/AssociationsModel.php b/administrator/components/com_associations/src/Model/AssociationsModel.php index 1c9756a3aed34..1f22e6130cd30 100644 --- a/administrator/components/com_associations/src/Model/AssociationsModel.php +++ b/administrator/components/com_associations/src/Model/AssociationsModel.php @@ -18,6 +18,7 @@ use Joomla\Component\Associations\Administrator\Helper\AssociationsHelper; use Joomla\Database\Exception\ExecutionFailureException; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -152,7 +153,7 @@ protected function getStoreId($id = '') /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery|boolean + * @return QueryInterface|boolean * * @since 3.7.0 */ diff --git a/administrator/components/com_associations/tmpl/association/edit.php b/administrator/components/com_associations/tmpl/association/edit.php index 9928dfcfc4513..efbe432ed63df 100644 --- a/administrator/components/com_associations/tmpl/association/edit.php +++ b/administrator/components/com_associations/tmpl/association/edit.php @@ -18,7 +18,7 @@ /** @var HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate') ->usePreset('com_associations.sidebyside') diff --git a/administrator/components/com_associations/tmpl/associations/default.php b/administrator/components/com_associations/tmpl/associations/default.php index 1c4f69aea404e..01a8f1ad29579 100644 --- a/administrator/components/com_associations/tmpl/associations/default.php +++ b/administrator/components/com_associations/tmpl/associations/default.php @@ -19,7 +19,7 @@ /** @var Joomla\Component\Associations\Administrator\View\Associations\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_associations.admin-associations-default') ->useScript('table.columns') ->useScript('multiselect'); diff --git a/administrator/components/com_associations/tmpl/associations/modal.php b/administrator/components/com_associations/tmpl/associations/modal.php index 0a92bc991945f..8db50389fc743 100644 --- a/administrator/components/com_associations/tmpl/associations/modal.php +++ b/administrator/components/com_associations/tmpl/associations/modal.php @@ -27,7 +27,7 @@ } /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('multiselect') ->useScript('com_associations.admin-associations-modal'); @@ -43,7 +43,7 @@ 2 => 'icon-folder', ]; -$this->document->addScriptOptions('associations-modal', ['func' => $function]); +$this->getDocument()->addScriptOptions('associations-modal', ['func' => $function]); ?>
diff --git a/administrator/components/com_banners/src/Model/BannersModel.php b/administrator/components/com_banners/src/Model/BannersModel.php index 4b8dd96ff3572..22e57080999e9 100644 --- a/administrator/components/com_banners/src/Model/BannersModel.php +++ b/administrator/components/com_banners/src/Model/BannersModel.php @@ -14,6 +14,7 @@ use Joomla\CMS\MVC\Model\ListModel; use Joomla\CMS\Table\Table; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -94,7 +95,7 @@ public function &getCategoryOrders() /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 1.6 */ diff --git a/administrator/components/com_banners/src/Model/ClientsModel.php b/administrator/components/com_banners/src/Model/ClientsModel.php index b21ed9840cf55..c78f011b5bcd2 100644 --- a/administrator/components/com_banners/src/Model/ClientsModel.php +++ b/administrator/components/com_banners/src/Model/ClientsModel.php @@ -13,6 +13,7 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\MVC\Model\ListModel; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -94,7 +95,7 @@ protected function getStoreId($id = '') /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface */ protected function getListQuery() { diff --git a/administrator/components/com_banners/src/Model/TracksModel.php b/administrator/components/com_banners/src/Model/TracksModel.php index 074f5eb2fa361..bc820a86e8d7d 100644 --- a/administrator/components/com_banners/src/Model/TracksModel.php +++ b/administrator/components/com_banners/src/Model/TracksModel.php @@ -16,6 +16,7 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\ListModel; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Filesystem\File; use Joomla\Filesystem\Folder; use Joomla\String\StringHelper; @@ -87,7 +88,7 @@ protected function populateState($ordering = 'b.name', $direction = 'asc') /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 1.6 */ diff --git a/administrator/components/com_banners/tmpl/banner/edit.php b/administrator/components/com_banners/tmpl/banner/edit.php index bf94c3d9beeca..9ee378083f9c2 100644 --- a/administrator/components/com_banners/tmpl/banner/edit.php +++ b/administrator/components/com_banners/tmpl/banner/edit.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Banners\Administrator\View\Banner\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate') ->useScript('com_banners.admin-banner-edit'); diff --git a/administrator/components/com_banners/tmpl/banners/default.php b/administrator/components/com_banners/tmpl/banners/default.php index bda322fb40d58..7b24a58ff792c 100644 --- a/administrator/components/com_banners/tmpl/banners/default.php +++ b/administrator/components/com_banners/tmpl/banners/default.php @@ -20,12 +20,12 @@ /** @var \Joomla\Component\Banners\Administrator\View\Banners\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); $user = $this->getCurrentUser(); -$userId = $user->get('id'); +$userId = $user->id; $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'a.ordering'; diff --git a/administrator/components/com_banners/tmpl/client/edit.php b/administrator/components/com_banners/tmpl/client/edit.php index 557714e88039f..f7eec3482db98 100644 --- a/administrator/components/com_banners/tmpl/client/edit.php +++ b/administrator/components/com_banners/tmpl/client/edit.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Banners\Administrator\View\Client\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); diff --git a/administrator/components/com_banners/tmpl/clients/default.php b/administrator/components/com_banners/tmpl/clients/default.php index 7d47f26e5afe4..36e8899c727ad 100644 --- a/administrator/components/com_banners/tmpl/clients/default.php +++ b/administrator/components/com_banners/tmpl/clients/default.php @@ -32,7 +32,7 @@ ]; $user = $this->getCurrentUser(); -$userId = $user->get('id'); +$userId = $user->id; $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $params = $this->state->get('params') ?? new Registry(); @@ -107,7 +107,7 @@ items as $i => $item) : $canCreate = $user->authorise('core.create', 'com_banners'); $canEdit = $user->authorise('core.edit', 'com_banners'); - $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || is_null($item->checked_out); + $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || is_null($item->checked_out); $canChange = $user->authorise('core.edit.state', 'com_banners') && $canCheckin; ?> diff --git a/administrator/components/com_banners/tmpl/download/default.php b/administrator/components/com_banners/tmpl/download/default.php index 1c39cc0bcef41..f221b5b51c12b 100644 --- a/administrator/components/com_banners/tmpl/download/default.php +++ b/administrator/components/com_banners/tmpl/download/default.php @@ -16,7 +16,7 @@ /** @var \Joomla\Component\Banners\Administrator\View\Download\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('form.validate'); ?> diff --git a/administrator/components/com_banners/tmpl/tracks/default.php b/administrator/components/com_banners/tmpl/tracks/default.php index 06cf0d8950bc0..12c8c26b79dce 100644 --- a/administrator/components/com_banners/tmpl/tracks/default.php +++ b/administrator/components/com_banners/tmpl/tracks/default.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Banners\Administrator\View\Tracks\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns'); /** @var \Joomla\Component\Banners\Administrator\View\Tracks\HtmlView $this */ diff --git a/administrator/components/com_cache/tmpl/cache/default.php b/administrator/components/com_cache/tmpl/cache/default.php index 9abca8e95e8ff..77ae9c5836892 100644 --- a/administrator/components/com_cache/tmpl/cache/default.php +++ b/administrator/components/com_cache/tmpl/cache/default.php @@ -21,7 +21,7 @@ $listDirn = $this->escape($this->state->get('list.direction')); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('table.columns') ->useScript('multiselect') diff --git a/administrator/components/com_categories/src/Model/CategoriesModel.php b/administrator/components/com_categories/src/Model/CategoriesModel.php index 0478d443b6ba6..5b9477225a92e 100644 --- a/administrator/components/com_categories/src/Model/CategoriesModel.php +++ b/administrator/components/com_categories/src/Model/CategoriesModel.php @@ -17,8 +17,8 @@ use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; use Joomla\CMS\Table\Table; -use Joomla\Database\DatabaseQuery; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects @@ -156,7 +156,7 @@ protected function getStoreId($id = '') /** * Method to get a database query to list categories. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 1.6 */ @@ -493,7 +493,7 @@ public function countItems(&$items, $extension) /** * Manipulate the query to be used to evaluate if this is an Empty State to provide specific conditions for this extension. * - * @return DatabaseQuery + * @return QueryInterface * * @since 4.0.0 */ diff --git a/administrator/components/com_categories/src/Model/CategoryModel.php b/administrator/components/com_categories/src/Model/CategoryModel.php index 6e586b745332e..a4e854f59e993 100644 --- a/administrator/components/com_categories/src/Model/CategoryModel.php +++ b/administrator/components/com_categories/src/Model/CategoryModel.php @@ -752,6 +752,8 @@ public function publish(&$pks, $value = 1) return true; } + + return false; } /** diff --git a/administrator/components/com_categories/tmpl/categories/default.php b/administrator/components/com_categories/tmpl/categories/default.php index 2be9770945515..0c8d3e62bad27 100644 --- a/administrator/components/com_categories/tmpl/categories/default.php +++ b/administrator/components/com_categories/tmpl/categories/default.php @@ -21,12 +21,12 @@ /** @var \Joomla\Component\Categories\Administrator\View\Categories\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); $user = $this->getCurrentUser(); -$userId = $user->get('id'); +$userId = $user->id; $extension = $this->escape($this->state->get('filter.extension')); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); diff --git a/administrator/components/com_categories/tmpl/categories/modal.php b/administrator/components/com_categories/tmpl/categories/modal.php index 4da24d598dd45..cc0b2800ceaca 100644 --- a/administrator/components/com_categories/tmpl/categories/modal.php +++ b/administrator/components/com_categories/tmpl/categories/modal.php @@ -28,7 +28,7 @@ } /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('core') ->useScript('modal-content-select'); diff --git a/administrator/components/com_categories/tmpl/category/edit.php b/administrator/components/com_categories/tmpl/category/edit.php index 9f9c3d6aa9103..ba228c05ecad5 100644 --- a/administrator/components/com_categories/tmpl/category/edit.php +++ b/administrator/components/com_categories/tmpl/category/edit.php @@ -21,7 +21,7 @@ /** @var \Joomla\Component\Categories\Administrator\View\Category\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); diff --git a/administrator/components/com_categories/tmpl/category/modal.php b/administrator/components/com_categories/tmpl/category/modal.php index 7143183627162..aa7019e45d4df 100644 --- a/administrator/components/com_categories/tmpl/category/modal.php +++ b/administrator/components/com_categories/tmpl/category/modal.php @@ -14,7 +14,7 @@ ?>
- document->getToolbar('toolbar')->render(); ?> + getDocument()->getToolbar('toolbar')->render(); ?>
setLayout('edit'); ?> diff --git a/administrator/components/com_categories/tmpl/category/modalreturn.php b/administrator/components/com_categories/tmpl/category/modalreturn.php index e4f82b4af7870..29b34b1485960 100644 --- a/administrator/components/com_categories/tmpl/category/modalreturn.php +++ b/administrator/components/com_categories/tmpl/category/modalreturn.php @@ -27,11 +27,11 @@ // Add Content select script /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('modal-content-select'); // The data for Content select script -$this->document->addScriptOptions('content-select-on-load', $data, false); +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); ?> diff --git a/administrator/components/com_checkin/tmpl/checkin/default.php b/administrator/components/com_checkin/tmpl/checkin/default.php index 3a8632af67691..4067943b59336 100644 --- a/administrator/components/com_checkin/tmpl/checkin/default.php +++ b/administrator/components/com_checkin/tmpl/checkin/default.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Checkin\Administrator\View\Checkin\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('multiselect'); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_config/src/Model/ApplicationModel.php b/administrator/components/com_config/src/Model/ApplicationModel.php index bd62fdd71b1ff..7f382e0349f9e 100644 --- a/administrator/components/com_config/src/Model/ApplicationModel.php +++ b/administrator/components/com_config/src/Model/ApplicationModel.php @@ -374,7 +374,7 @@ public function save($data) // Check that we aren't removing our Super User permission // Need to get groups from database, since they might have changed - $myGroups = Access::getGroupsByUser($this->getCurrentUser()->get('id')); + $myGroups = Access::getGroupsByUser($this->getCurrentUser()->id); $myRules = $rules->getData(); $hasSuperAdmin = $myRules['core.admin']->allow($myGroups); diff --git a/administrator/components/com_config/tmpl/application/default.php b/administrator/components/com_config/tmpl/application/default.php index fac3c715c5618..9ae86ea05fb60 100644 --- a/administrator/components/com_config/tmpl/application/default.php +++ b/administrator/components/com_config/tmpl/application/default.php @@ -17,7 +17,7 @@ /** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); diff --git a/administrator/components/com_config/tmpl/application/default_mail.php b/administrator/components/com_config/tmpl/application/default_mail.php index 2612fbe341fda..227afdad44baa 100644 --- a/administrator/components/com_config/tmpl/application/default_mail.php +++ b/administrator/components/com_config/tmpl/application/default_mail.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Config\Administrator\View\Application\HtmlView $this */ HTMLHelper::_('form.csrf'); -$this->document->getWebAssetManager() +$this->getDocument()->getWebAssetManager() ->useScript('webcomponent.field-send-test-mail'); // Load JavaScript message titles diff --git a/administrator/components/com_config/tmpl/component/default.php b/administrator/components/com_config/tmpl/component/default.php index ad1e926e2752f..0ffc394ad285b 100644 --- a/administrator/components/com_config/tmpl/component/default.php +++ b/administrator/components/com_config/tmpl/component/default.php @@ -27,7 +27,7 @@ Text::script('MESSAGE'); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('form.validate') ->useScript('keepalive'); diff --git a/administrator/components/com_contact/src/Model/ContactsModel.php b/administrator/components/com_contact/src/Model/ContactsModel.php index 784614b1803e0..7e21db9143c2f 100644 --- a/administrator/components/com_contact/src/Model/ContactsModel.php +++ b/administrator/components/com_contact/src/Model/ContactsModel.php @@ -15,6 +15,7 @@ use Joomla\CMS\MVC\Model\ListModel; use Joomla\CMS\Table\Table; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects @@ -135,7 +136,7 @@ protected function getStoreId($id = '') /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 1.6 */ diff --git a/administrator/components/com_contact/src/Service/HTML/Icon.php b/administrator/components/com_contact/src/Service/HTML/Icon.php index 7955ec57bf3cb..9073e21a66395 100644 --- a/administrator/components/com_contact/src/Service/HTML/Icon.php +++ b/administrator/components/com_contact/src/Service/HTML/Icon.php @@ -118,7 +118,7 @@ public function edit($contact, $params, $attribs = [], $legacy = false) property_exists($contact, 'checked_out') && property_exists($contact, 'checked_out_time') && !\is_null($contact->checked_out) - && $contact->checked_out !== $user->get('id') + && $contact->checked_out !== $user->id ) { $checkoutUser = $this->getUserFactory()->loadUserById($contact->checked_out); $date = HTMLHelper::_('date', $contact->checked_out_time); diff --git a/administrator/components/com_contact/src/Table/ContactTable.php b/administrator/components/com_contact/src/Table/ContactTable.php index 15d73d0588a11..0746e02a83a5a 100644 --- a/administrator/components/com_contact/src/Table/ContactTable.php +++ b/administrator/components/com_contact/src/Table/ContactTable.php @@ -48,7 +48,7 @@ class ContactTable extends Table implements VersionableTableInterface, TaggableT protected $_supportNullValue = true; /** - * Ensure the params and metadata in json encoded in the bind method + * Ensure the params and metadata are json encoded in the bind method * * @var array * @since 3.3 diff --git a/administrator/components/com_contact/tmpl/contact/edit.php b/administrator/components/com_contact/tmpl/contact/edit.php index 886c4876bdae1..dddda905f7305 100644 --- a/administrator/components/com_contact/tmpl/contact/edit.php +++ b/administrator/components/com_contact/tmpl/contact/edit.php @@ -20,7 +20,7 @@ /** @var \Joomla\Component\Contact\Administrator\View\Contact\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); diff --git a/administrator/components/com_contact/tmpl/contact/modal.php b/administrator/components/com_contact/tmpl/contact/modal.php index dc5b2f283a8ea..d4260411e8cac 100644 --- a/administrator/components/com_contact/tmpl/contact/modal.php +++ b/administrator/components/com_contact/tmpl/contact/modal.php @@ -13,7 +13,7 @@ /** @var \Joomla\Component\Contact\Administrator\View\Contact\HtmlView $this */ ?>
- document->getToolbar('toolbar')->render(); ?> + getDocument()->getToolbar('toolbar')->render(); ?>
setLayout('edit'); ?> diff --git a/administrator/components/com_contact/tmpl/contact/modalreturn.php b/administrator/components/com_contact/tmpl/contact/modalreturn.php index ffe791c45772d..007c0bd9d1cd3 100644 --- a/administrator/components/com_contact/tmpl/contact/modalreturn.php +++ b/administrator/components/com_contact/tmpl/contact/modalreturn.php @@ -28,11 +28,11 @@ // Add Content select script /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('modal-content-select'); // The data for Content select script -$this->document->addScriptOptions('content-select-on-load', $data, false); +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); ?> diff --git a/administrator/components/com_contact/tmpl/contacts/default.php b/administrator/components/com_contact/tmpl/contacts/default.php index 3a5e2c4c3e925..83049cc92f6be 100644 --- a/administrator/components/com_contact/tmpl/contacts/default.php +++ b/administrator/components/com_contact/tmpl/contacts/default.php @@ -21,12 +21,12 @@ /** @var \Joomla\Component\Contact\Administrator\View\Contacts\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); $user = $this->getCurrentUser(); -$userId = $user->get('id'); +$userId = $user->id; $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'a.ordering'; diff --git a/administrator/components/com_contact/tmpl/contacts/modal.php b/administrator/components/com_contact/tmpl/contacts/modal.php index 294f935e1d631..8d9fe4391c436 100644 --- a/administrator/components/com_contact/tmpl/contacts/modal.php +++ b/administrator/components/com_contact/tmpl/contacts/modal.php @@ -28,7 +28,7 @@ } /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('modal-content-select') ->useScript('com_contact.admin-contacts-modal'); @@ -42,7 +42,7 @@ if (!empty($editor)) { // This view is used also in com_menus. Load the xtd script only if the editor is set! - $this->document->addScriptOptions('xtd-contacts', ['editor' => $editor]); + $this->getDocument()->addScriptOptions('xtd-contacts', ['editor' => $editor]); $onclick = "jSelectContact"; } ?> diff --git a/administrator/components/com_content/src/Model/ArticlesModel.php b/administrator/components/com_content/src/Model/ArticlesModel.php index defc1981763b7..3d3f40673d6ab 100644 --- a/administrator/components/com_content/src/Model/ArticlesModel.php +++ b/administrator/components/com_content/src/Model/ArticlesModel.php @@ -19,6 +19,7 @@ use Joomla\CMS\Table\Table; use Joomla\Component\Content\Administrator\Extension\ContentComponent; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Registry\Registry; use Joomla\Utilities\ArrayHelper; @@ -217,7 +218,7 @@ protected function getStoreId($id = '') /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 1.6 */ diff --git a/administrator/components/com_content/src/Model/FeaturedModel.php b/administrator/components/com_content/src/Model/FeaturedModel.php index 8cfece263ac59..2f9893f99a4f1 100644 --- a/administrator/components/com_content/src/Model/FeaturedModel.php +++ b/administrator/components/com_content/src/Model/FeaturedModel.php @@ -11,6 +11,8 @@ namespace Joomla\Component\Content\Administrator\Model; // phpcs:disable PSR1.Files.SideEffects +use Joomla\Database\QueryInterface; + \defined('_JEXEC') or die; // phpcs:enable PSR1.Files.SideEffects @@ -88,7 +90,7 @@ protected function populateState($ordering = 'a.title', $direction = 'asc') /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 4.0.0 */ diff --git a/administrator/components/com_content/src/Service/HTML/Icon.php b/administrator/components/com_content/src/Service/HTML/Icon.php index be1bfc6a4dedd..fe1782260de47 100644 --- a/administrator/components/com_content/src/Service/HTML/Icon.php +++ b/administrator/components/com_content/src/Service/HTML/Icon.php @@ -104,7 +104,7 @@ public function edit($article, $params, $attribs = [], $legacy = false) property_exists($article, 'checked_out') && property_exists($article, 'checked_out_time') && !\is_null($article->checked_out) - && $article->checked_out != $user->get('id') + && $article->checked_out != $user->id ) { $checkoutUser = Factory::getUser($article->checked_out); $date = HTMLHelper::_('date', $article->checked_out_time); diff --git a/administrator/components/com_content/tmpl/article/edit.php b/administrator/components/com_content/tmpl/article/edit.php index 84caa25f31a4f..e794dfd8cc4bc 100644 --- a/administrator/components/com_content/tmpl/article/edit.php +++ b/administrator/components/com_content/tmpl/article/edit.php @@ -21,7 +21,7 @@ use Joomla\Registry\Registry; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->getRegistry()->addExtensionRegistryFile('com_contenthistory'); $wa->useScript('keepalive') ->useScript('form.validate') diff --git a/administrator/components/com_content/tmpl/article/modal.php b/administrator/components/com_content/tmpl/article/modal.php index a6afdb0dc3cd3..a825d2b35bff9 100644 --- a/administrator/components/com_content/tmpl/article/modal.php +++ b/administrator/components/com_content/tmpl/article/modal.php @@ -13,7 +13,7 @@ /** @var \Joomla\Component\Content\Administrator\View\Article\HtmlView $this */ ?>
- document->getToolbar('toolbar')->render(); ?> + getDocument()->getToolbar('toolbar')->render(); ?>
setLayout('edit'); ?> diff --git a/administrator/components/com_content/tmpl/article/modalreturn.php b/administrator/components/com_content/tmpl/article/modalreturn.php index 6a79ddff8c3ec..10fd2fd24c344 100644 --- a/administrator/components/com_content/tmpl/article/modalreturn.php +++ b/administrator/components/com_content/tmpl/article/modalreturn.php @@ -28,11 +28,11 @@ // Add Content select script /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('modal-content-select'); // The data for Content select script -$this->document->addScriptOptions('content-select-on-load', $data, false); +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); ?> diff --git a/administrator/components/com_content/tmpl/article/pagebreak.php b/administrator/components/com_content/tmpl/article/pagebreak.php index 1d5914e12bb4c..478f755687237 100644 --- a/administrator/components/com_content/tmpl/article/pagebreak.php +++ b/administrator/components/com_content/tmpl/article/pagebreak.php @@ -16,12 +16,12 @@ /** @var \Joomla\Component\Content\Administrator\View\Article\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_content.admin-article-pagebreak'); $this->eName = Factory::getApplication()->getInput()->getCmd('e_name', ''); $this->eName = preg_replace('#[^A-Z0-9\-\_\[\]]#i', '', $this->eName); -$this->document->setTitle(Text::_('COM_CONTENT_PAGEBREAK_DOC_TITLE')); +$this->getDocument()->setTitle(Text::_('COM_CONTENT_PAGEBREAK_DOC_TITLE')); ?>
diff --git a/administrator/components/com_content/tmpl/articles/default.php b/administrator/components/com_content/tmpl/articles/default.php index 83b3e287a6a36..72cb283302965 100644 --- a/administrator/components/com_content/tmpl/articles/default.php +++ b/administrator/components/com_content/tmpl/articles/default.php @@ -28,13 +28,13 @@ /** @var \Joomla\Component\Content\Administrator\View\Articles\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); $app = Factory::getApplication(); $user = $this->getCurrentUser(); -$userId = $user->get('id'); +$userId = $user->id; $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'a.ordering'; diff --git a/administrator/components/com_content/tmpl/articles/modal.php b/administrator/components/com_content/tmpl/articles/modal.php index 63410ea69d668..42dd83cc093a7 100644 --- a/administrator/components/com_content/tmpl/articles/modal.php +++ b/administrator/components/com_content/tmpl/articles/modal.php @@ -28,7 +28,7 @@ } /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('core') ->useScript('multiselect') ->useScript('modal-content-select') @@ -44,7 +44,7 @@ if (!empty($editor)) { // This view is used also in com_menus. Load the xtd script only if the editor is set! - $this->document->addScriptOptions('xtd-articles', ['editor' => $editor]); + $this->getDocument()->addScriptOptions('xtd-articles', ['editor' => $editor]); $onclick = "jSelectArticle"; } ?> diff --git a/administrator/components/com_content/tmpl/featured/default.php b/administrator/components/com_content/tmpl/featured/default.php index e4569f65d687d..048b8640421c0 100644 --- a/administrator/components/com_content/tmpl/featured/default.php +++ b/administrator/components/com_content/tmpl/featured/default.php @@ -28,13 +28,13 @@ /** @var \Joomla\Component\Content\Administrator\View\Featured\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); $app = Factory::getApplication(); $user = $this->getCurrentUser(); -$userId = $user->get('id'); +$userId = $user->id; $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'fp.ordering'; diff --git a/administrator/components/com_content/tmpl/featured/default_stage_footer.php b/administrator/components/com_content/tmpl/featured/default_stage_footer.php index 9afc9b9df8a18..8c6d2bfccdad4 100644 --- a/administrator/components/com_content/tmpl/featured/default_stage_footer.php +++ b/administrator/components/com_content/tmpl/featured/default_stage_footer.php @@ -15,7 +15,7 @@ /** @var \Joomla\Component\Content\Administrator\View\Featured\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_content.admin-articles-stage'); ?> diff --git a/administrator/components/com_contenthistory/src/Model/HistoryModel.php b/administrator/components/com_contenthistory/src/Model/HistoryModel.php index 1dea5ec5159fa..0022b9e008705 100644 --- a/administrator/components/com_contenthistory/src/Model/HistoryModel.php +++ b/administrator/components/com_contenthistory/src/Model/HistoryModel.php @@ -22,6 +22,7 @@ use Joomla\CMS\Table\ContentType; use Joomla\CMS\Table\Table; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -317,7 +318,7 @@ protected function populateState($ordering = 'h.save_date', $direction = 'DESC') /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 3.2 */ diff --git a/administrator/components/com_contenthistory/tmpl/compare/compare.php b/administrator/components/com_contenthistory/tmpl/compare/compare.php index 7a7933593baae..8f855b92c1ad8 100644 --- a/administrator/components/com_contenthistory/tmpl/compare/compare.php +++ b/administrator/components/com_contenthistory/tmpl/compare/compare.php @@ -23,7 +23,7 @@ $object2 = $version2->data; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_contenthistory.admin-compare-compare'); ?> diff --git a/administrator/components/com_contenthistory/tmpl/history/modal.php b/administrator/components/com_contenthistory/tmpl/history/modal.php index 4884ff52cb457..759607d4cbfd9 100644 --- a/administrator/components/com_contenthistory/tmpl/history/modal.php +++ b/administrator/components/com_contenthistory/tmpl/history/modal.php @@ -34,7 +34,7 @@ JS; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('multiselect') ->useScript('com_contenthistory.admin-history-modal') ->useScript('list-view') diff --git a/administrator/components/com_cpanel/tmpl/cpanel/default.php b/administrator/components/com_cpanel/tmpl/cpanel/default.php index 058ca5d6d5a4d..8a28c306c2f94 100644 --- a/administrator/components/com_cpanel/tmpl/cpanel/default.php +++ b/administrator/components/com_cpanel/tmpl/cpanel/default.php @@ -27,7 +27,7 @@ Text::script('COM_CPANEL_UNPUBLISH_MODULE_ERROR'); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_cpanel.admin-cpanel') ->useScript('joomla.dialog-autocreate'); diff --git a/administrator/components/com_fields/forms/field.xml b/administrator/components/com_fields/forms/field.xml index 88157e4abbf3e..c4b1196266fc8 100644 --- a/administrator/components/com_fields/forms/field.xml +++ b/administrator/components/com_fields/forms/field.xml @@ -81,7 +81,6 @@ label="COM_FIELDS_FIELD_ONLY_USE_IN_SUBFORM_LABEL" layout="joomla.form.field.radio.switcher" default="0" - showon="type!:subform" > diff --git a/administrator/components/com_fields/src/Field/SubfieldsField.php b/administrator/components/com_fields/src/Field/SubfieldsField.php index c84d2592ba015..c8dc4cfeba751 100644 --- a/administrator/components/com_fields/src/Field/SubfieldsField.php +++ b/administrator/components/com_fields/src/Field/SubfieldsField.php @@ -75,11 +75,6 @@ protected function getOptions() // Iterate over the custom fields for this context foreach (static::$customFieldsCache[$this->context] as $customField) { - // Skip our own subform type. We won't have subform in subform. - if ($customField->type == 'subform') { - continue; - } - $options[] = HTMLHelper::_( 'select.option', $customField->id, diff --git a/administrator/components/com_fields/src/Helper/FieldsHelper.php b/administrator/components/com_fields/src/Helper/FieldsHelper.php index 5f83985de0d1a..8e70a96a4312c 100644 --- a/administrator/components/com_fields/src/Helper/FieldsHelper.php +++ b/administrator/components/com_fields/src/Helper/FieldsHelper.php @@ -485,24 +485,14 @@ public static function prepareForm($context, Form $form, $data) // Loading the XML fields string into the form $form->load($xml->saveXML()); - $model = Factory::getApplication()->bootComponent('com_fields') - ->getMVCFactory()->createModel('Field', 'Administrator', ['ignore_request' => true]); - - if ( - (!isset($data->id) || !$data->id) && Factory::getApplication()->getInput()->getCmd('controller') == 'modules' - && Factory::getApplication()->isClient('site') - ) { - // Modules on front end editing don't have data and an id set - $data->id = Factory::getApplication()->getInput()->getInt('id'); - } - // Looping through the fields again to set the value if (!isset($data->id) || !$data->id) { return true; } foreach ($fields as $field) { - $value = $model->getFieldValue($field->id, $data->id); + // Get the value already loaded by static::getFields() + $value = $field->rawvalue; if ($value === null) { continue; diff --git a/administrator/components/com_fields/src/Model/FieldModel.php b/administrator/components/com_fields/src/Model/FieldModel.php index 4f3ebf3ba9561..c6eff9511df62 100644 --- a/administrator/components/com_fields/src/Model/FieldModel.php +++ b/administrator/components/com_fields/src/Model/FieldModel.php @@ -584,17 +584,9 @@ public function getForm($data = [], $loadData = true) $form->setFieldAttribute('created_user_id', 'filter', 'unset'); } - // In case we are editing a field, field type cannot be changed, so some extra handling below is needed + // In case we are editing a field, field type cannot be changed, so remove showon attribute to avoid js errors if ($fieldId) { - $fieldType = $form->getField('type'); - - if ($fieldType->value == 'subform') { - // Only Use In subform should not be available for subform field type, so we remove it - $form->removeField('only_use_in_subform'); - } else { - // Field type could not be changed, so remove showon attribute to avoid js errors - $form->setFieldAttribute('only_use_in_subform', 'showon', ''); - } + $form->setFieldAttribute('only_use_in_subform', 'showon', ''); } return $form; diff --git a/administrator/components/com_fields/src/Model/FieldsModel.php b/administrator/components/com_fields/src/Model/FieldsModel.php index 9059b892bdf43..8d17cc16449d3 100644 --- a/administrator/components/com_fields/src/Model/FieldsModel.php +++ b/administrator/components/com_fields/src/Model/FieldsModel.php @@ -17,6 +17,7 @@ use Joomla\CMS\MVC\Model\ListModel; use Joomla\Component\Fields\Administrator\Helper\FieldsHelper; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Registry\Registry; use Joomla\Utilities\ArrayHelper; @@ -129,9 +130,9 @@ protected function getStoreId($id = '') } /** - * Method to get a DatabaseQuery object for retrieving the data set from a database. + * Method to get a QueryInterface object for retrieving the data set from a database. * - * @return \Joomla\Database\DatabaseQuery A DatabaseQuery object to retrieve the data set. + * @return QueryInterface An object implementing QueryInterface to retrieve the data set. * * @since 3.7.0 */ diff --git a/administrator/components/com_fields/src/Model/GroupsModel.php b/administrator/components/com_fields/src/Model/GroupsModel.php index 725c0d2252456..55c59aa154cb3 100644 --- a/administrator/components/com_fields/src/Model/GroupsModel.php +++ b/administrator/components/com_fields/src/Model/GroupsModel.php @@ -13,6 +13,7 @@ use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Registry\Registry; use Joomla\Utilities\ArrayHelper; @@ -117,9 +118,9 @@ protected function getStoreId($id = '') } /** - * Method to get a DatabaseQuery object for retrieving the data set from a database. + * Method to get a QueryInterface object for retrieving the data set from a database. * - * @return \Joomla\Database\DatabaseQuery A DatabaseQuery object to retrieve the data set. + * @return QueryInterface An object implementing QueryInterface to retrieve the data set. * * @since 3.7.0 */ diff --git a/administrator/components/com_fields/src/Table/FieldTable.php b/administrator/components/com_fields/src/Table/FieldTable.php index b40fd9524c8cd..bdc72b9e212d7 100644 --- a/administrator/components/com_fields/src/Table/FieldTable.php +++ b/administrator/components/com_fields/src/Table/FieldTable.php @@ -181,14 +181,14 @@ public function check() if ($this->id) { // Existing item $this->modified_time = $date; - $this->modified_by = $user->get('id'); + $this->modified_by = $user->id; } else { if (!(int) $this->modified_time) { $this->modified_time = $this->created_time; } if (empty($this->created_user_id)) { - $this->created_user_id = $user->get('id'); + $this->created_user_id = $user->id; } if (empty($this->modified_by)) { diff --git a/administrator/components/com_fields/src/Table/GroupTable.php b/administrator/components/com_fields/src/Table/GroupTable.php index e153f289ed0c0..abc0dd9879eee 100644 --- a/administrator/components/com_fields/src/Table/GroupTable.php +++ b/administrator/components/com_fields/src/Table/GroupTable.php @@ -116,14 +116,14 @@ public function check() if ($this->id) { $this->modified = $date; - $this->modified_by = $user->get('id'); + $this->modified_by = $user->id; } else { if (!(int) $this->modified) { $this->modified = $this->created; } if (empty($this->created_by)) { - $this->created_by = $user->get('id'); + $this->created_by = $user->id; } if (empty($this->modified_by)) { diff --git a/administrator/components/com_fields/src/View/Field/HtmlView.php b/administrator/components/com_fields/src/View/Field/HtmlView.php index 25d8167e20a2c..0191220f4f140 100644 --- a/administrator/components/com_fields/src/View/Field/HtmlView.php +++ b/administrator/components/com_fields/src/View/Field/HtmlView.php @@ -93,7 +93,7 @@ protected function addToolbar() { $component = $this->state->get('field.component'); $section = $this->state->get('field.section'); - $userId = $this->getCurrentUser()->get('id'); + $userId = $this->getCurrentUser()->id; $canDo = $this->canDo; $toolbar = Toolbar::getInstance(); diff --git a/administrator/components/com_fields/src/View/Group/HtmlView.php b/administrator/components/com_fields/src/View/Group/HtmlView.php index e540aaa32c0f3..5a3f9a2cc71c6 100644 --- a/administrator/components/com_fields/src/View/Group/HtmlView.php +++ b/administrator/components/com_fields/src/View/Group/HtmlView.php @@ -114,7 +114,7 @@ protected function addToolbar() $component = $parts[0]; } - $userId = $this->getCurrentUser()->get('id'); + $userId = $this->getCurrentUser()->id; $canDo = $this->canDo; $isNew = ($this->item->id == 0); diff --git a/administrator/components/com_fields/tmpl/field/edit.php b/administrator/components/com_fields/tmpl/field/edit.php index 791d85badfb72..d9cb6f1d99b59 100644 --- a/administrator/components/com_fields/tmpl/field/edit.php +++ b/administrator/components/com_fields/tmpl/field/edit.php @@ -24,7 +24,7 @@ $this->useCoreUI = true; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate') ->useScript('com_fields.admin-field-edit'); diff --git a/administrator/components/com_fields/tmpl/fields/default.php b/administrator/components/com_fields/tmpl/fields/default.php index 89868d2803521..77b27cce1aa81 100644 --- a/administrator/components/com_fields/tmpl/fields/default.php +++ b/administrator/components/com_fields/tmpl/fields/default.php @@ -23,13 +23,13 @@ /** @var \Joomla\Component\Fields\Administrator\View\Fields\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); $app = Factory::getApplication(); $user = $this->getCurrentUser(); -$userId = $user->get('id'); +$userId = $user->id; $context = $this->escape($this->state->get('filter.context')); $component = $this->state->get('filter.component'); $section = $this->state->get('filter.section'); diff --git a/administrator/components/com_fields/tmpl/fields/default_batch_body.php b/administrator/components/com_fields/tmpl/fields/default_batch_body.php index 69a6faeda91d4..e4e5446d1b24f 100644 --- a/administrator/components/com_fields/tmpl/fields/default_batch_body.php +++ b/administrator/components/com_fields/tmpl/fields/default_batch_body.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Fields\Administrator\View\Fields\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_fields.admin-fields-batch'); $wa->useScript('joomla.batch-copymove'); diff --git a/administrator/components/com_fields/tmpl/fields/modal.php b/administrator/components/com_fields/tmpl/fields/modal.php index 47ab74c36d5ea..2319856c991bc 100644 --- a/administrator/components/com_fields/tmpl/fields/modal.php +++ b/administrator/components/com_fields/tmpl/fields/modal.php @@ -24,7 +24,7 @@ } /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_fields.admin-fields-modal')->useScript('modal-content-select'); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_fields/tmpl/group/edit.php b/administrator/components/com_fields/tmpl/group/edit.php index 3b10a192be07a..02c7cb2790512 100644 --- a/administrator/components/com_fields/tmpl/group/edit.php +++ b/administrator/components/com_fields/tmpl/group/edit.php @@ -19,7 +19,7 @@ /** @var \Joomla\Component\Fields\Administrator\View\Group\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); diff --git a/administrator/components/com_fields/tmpl/groups/default.php b/administrator/components/com_fields/tmpl/groups/default.php index 4010c80e60ba1..d72ad1d5cb4c9 100644 --- a/administrator/components/com_fields/tmpl/groups/default.php +++ b/administrator/components/com_fields/tmpl/groups/default.php @@ -22,13 +22,13 @@ /** @var \Joomla\Component\Fields\Administrator\View\Groups\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); $app = Factory::getApplication(); $user = $this->getCurrentUser(); -$userId = $user->get('id'); +$userId = $user->id; $component = ''; $parts = FieldsHelper::extract($this->state->get('filter.context')); diff --git a/administrator/components/com_finder/src/Model/FiltersModel.php b/administrator/components/com_finder/src/Model/FiltersModel.php index 4c64d31da46d5..0c4f22b18f537 100644 --- a/administrator/components/com_finder/src/Model/FiltersModel.php +++ b/administrator/components/com_finder/src/Model/FiltersModel.php @@ -13,6 +13,7 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -53,7 +54,7 @@ public function __construct($config = [], MVCFactoryInterface $factory = null) /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 2.5 */ diff --git a/administrator/components/com_finder/src/Model/IndexModel.php b/administrator/components/com_finder/src/Model/IndexModel.php index 75ea94cbcffa7..dabd5e1fb2085 100644 --- a/administrator/components/com_finder/src/Model/IndexModel.php +++ b/administrator/components/com_finder/src/Model/IndexModel.php @@ -16,6 +16,7 @@ use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; use Joomla\CMS\Plugin\PluginHelper; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -174,7 +175,7 @@ public function delete(&$pks) /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 2.5 */ @@ -441,7 +442,7 @@ public function publish(&$pks, $value = 1) } // Attempt to change the state of the records. - if (!$table->publish($pks, $value, $user->get('id'))) { + if (!$table->publish($pks, $value, $user->id)) { $this->setError($table->getError()); return false; diff --git a/administrator/components/com_finder/src/Model/MapsModel.php b/administrator/components/com_finder/src/Model/MapsModel.php index b256927f00087..3379a906da647 100644 --- a/administrator/components/com_finder/src/Model/MapsModel.php +++ b/administrator/components/com_finder/src/Model/MapsModel.php @@ -17,6 +17,7 @@ use Joomla\CMS\MVC\Model\ListModel; use Joomla\CMS\Plugin\PluginHelper; use Joomla\Database\DatabaseQuery; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -155,7 +156,7 @@ public function delete(&$pks) /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 2.5 */ @@ -335,7 +336,7 @@ public function publish(&$pks, $value = 1) } // Attempt to change the state of the records. - if (!$table->publish($pks, $value, $user->get('id'))) { + if (!$table->publish($pks, $value, $user->id)) { $this->setError($table->getError()); return false; diff --git a/administrator/components/com_finder/src/Model/SearchesModel.php b/administrator/components/com_finder/src/Model/SearchesModel.php index 69399be23d460..91a80d04311b1 100644 --- a/administrator/components/com_finder/src/Model/SearchesModel.php +++ b/administrator/components/com_finder/src/Model/SearchesModel.php @@ -13,6 +13,7 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -96,7 +97,7 @@ protected function getStoreId($id = '') /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 4.0.0 */ diff --git a/administrator/components/com_finder/tmpl/filter/edit.php b/administrator/components/com_finder/tmpl/filter/edit.php index e61b5ada457d3..8d0f660cffe46 100644 --- a/administrator/components/com_finder/tmpl/filter/edit.php +++ b/administrator/components/com_finder/tmpl/filter/edit.php @@ -26,7 +26,7 @@ $this->useCoreUI = true; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate') ->useScript('com_finder.finder-edit'); diff --git a/administrator/components/com_finder/tmpl/filters/default.php b/administrator/components/com_finder/tmpl/filters/default.php index f8fa79d2a71bc..a75c842ed8ec5 100644 --- a/administrator/components/com_finder/tmpl/filters/default.php +++ b/administrator/components/com_finder/tmpl/filters/default.php @@ -18,14 +18,14 @@ /** @var \Joomla\Component\Finder\Administrator\View\Filters\HtmlView $this */ $user = $this->getCurrentUser(); -$userId = $user->get('id'); +$userId = $user->id; $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); Text::script('COM_FINDER_INDEX_CONFIRM_DELETE_PROMPT'); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_finder.filters') ->useScript('table.columns') ->useScript('multiselect'); diff --git a/administrator/components/com_finder/tmpl/index/default.php b/administrator/components/com_finder/tmpl/index/default.php index 9143f27f49d7c..9c678717dac90 100644 --- a/administrator/components/com_finder/tmpl/index/default.php +++ b/administrator/components/com_finder/tmpl/index/default.php @@ -25,7 +25,7 @@ $lang = $this->getLanguage(); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('multiselect') ->useScript('table.columns') ->useScript('joomla.dialog-autocreate'); diff --git a/administrator/components/com_finder/tmpl/index/emptystate.php b/administrator/components/com_finder/tmpl/index/emptystate.php index c9c117274da02..9f5d84d0292bf 100644 --- a/administrator/components/com_finder/tmpl/index/emptystate.php +++ b/administrator/components/com_finder/tmpl/index/emptystate.php @@ -33,7 +33,7 @@ // Show warning that the content - finder plugin is disabled if ($this->finderPluginId) { /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ - $wa = $this->document->getWebAssetManager(); + $wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('joomla.dialog-autocreate'); $popupOptions = [ diff --git a/administrator/components/com_finder/tmpl/indexer/debug.php b/administrator/components/com_finder/tmpl/indexer/debug.php index b4247b72025e6..2cfad37dd97ba 100644 --- a/administrator/components/com_finder/tmpl/indexer/debug.php +++ b/administrator/components/com_finder/tmpl/indexer/debug.php @@ -19,7 +19,7 @@ Text::script('COM_FINDER_INDEXER_MESSAGE_COMPLETE', true); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('com_finder.debug'); diff --git a/administrator/components/com_finder/tmpl/indexer/default.php b/administrator/components/com_finder/tmpl/indexer/default.php index 04f2141318ba6..db3ca5a37d173 100644 --- a/administrator/components/com_finder/tmpl/indexer/default.php +++ b/administrator/components/com_finder/tmpl/indexer/default.php @@ -22,7 +22,7 @@ Text::script('JLIB_JS_AJAX_ERROR_PARSE'); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useStyle('com_finder.indexer') ->useScript('com_finder.indexer'); diff --git a/administrator/components/com_finder/tmpl/maps/default.php b/administrator/components/com_finder/tmpl/maps/default.php index 978750df7b58d..2b9ca870ffecc 100644 --- a/administrator/components/com_finder/tmpl/maps/default.php +++ b/administrator/components/com_finder/tmpl/maps/default.php @@ -28,7 +28,7 @@ Text::script('COM_FINDER_MAPS_CONFIRM_DELETE_PROMPT'); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_finder.maps') ->useScript('table.columns') ->useScript('multiselect'); diff --git a/administrator/components/com_finder/tmpl/searches/default.php b/administrator/components/com_finder/tmpl/searches/default.php index 29244ad7da9f5..e6cf3b29731e4 100644 --- a/administrator/components/com_finder/tmpl/searches/default.php +++ b/administrator/components/com_finder/tmpl/searches/default.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Finder\Administrator\View\Searches\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('multiselect'); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_guidedtours/src/Model/StepsModel.php b/administrator/components/com_guidedtours/src/Model/StepsModel.php index acf733565fec2..6cdc950933e71 100644 --- a/administrator/components/com_guidedtours/src/Model/StepsModel.php +++ b/administrator/components/com_guidedtours/src/Model/StepsModel.php @@ -14,8 +14,8 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\ListModel; use Joomla\Component\Guidedtours\Administrator\Helper\GuidedtoursHelper; -use Joomla\Database\DatabaseQuery; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Registry\Registry; use Joomla\Utilities\ArrayHelper; @@ -62,7 +62,7 @@ public function __construct($config = []) /** * Provide a query to be used to evaluate if this is an Empty State, can be overridden in the model to provide granular control. * - * @return DatabaseQuery + * @return QueryInterface * * @since 4.3.0 */ @@ -138,7 +138,7 @@ protected function getStoreId($id = '') /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 4.3.0 */ diff --git a/administrator/components/com_guidedtours/src/Model/ToursModel.php b/administrator/components/com_guidedtours/src/Model/ToursModel.php index bbadcc0e9fd6a..03a79fce17a1b 100644 --- a/administrator/components/com_guidedtours/src/Model/ToursModel.php +++ b/administrator/components/com_guidedtours/src/Model/ToursModel.php @@ -15,6 +15,7 @@ use Joomla\CMS\MVC\Model\ListModel; use Joomla\Component\Guidedtours\Administrator\Helper\GuidedtoursHelper; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Registry\Registry; use Joomla\Utilities\ArrayHelper; @@ -108,7 +109,7 @@ public function getFilterForm($data = [], $loadData = true) /** * Method to get the data that should be injected in the form. * - * @return string The query to database. + * @return QueryInterface The query to database. * * @since 4.3.0 */ diff --git a/administrator/components/com_guidedtours/tmpl/step/edit.php b/administrator/components/com_guidedtours/tmpl/step/edit.php index 6b67e6d289fde..c47a6d07209ba 100644 --- a/administrator/components/com_guidedtours/tmpl/step/edit.php +++ b/administrator/components/com_guidedtours/tmpl/step/edit.php @@ -19,7 +19,7 @@ /** @var \Joomla\Component\Guidedtours\Administrator\View\Step\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate') ->useScript('com_guidedtours.tour-edit'); diff --git a/administrator/components/com_guidedtours/tmpl/steps/default.php b/administrator/components/com_guidedtours/tmpl/steps/default.php index e3ea2137f5865..97a0217a49c86 100644 --- a/administrator/components/com_guidedtours/tmpl/steps/default.php +++ b/administrator/components/com_guidedtours/tmpl/steps/default.php @@ -22,12 +22,12 @@ /** @var HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); $user = $this->getCurrentUser(); -$userId = $user->get('id'); +$userId = $user->id; $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'a.ordering'; diff --git a/administrator/components/com_guidedtours/tmpl/tour/edit.php b/administrator/components/com_guidedtours/tmpl/tour/edit.php index 942dfee5a40ad..e115cab0af1ee 100644 --- a/administrator/components/com_guidedtours/tmpl/tour/edit.php +++ b/administrator/components/com_guidedtours/tmpl/tour/edit.php @@ -24,7 +24,7 @@ $lang = $this->getLanguage()->getTag(); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); ?> diff --git a/administrator/components/com_guidedtours/tmpl/tours/default.php b/administrator/components/com_guidedtours/tmpl/tours/default.php index 1c4f88a3f4a42..6b1f349b562f2 100644 --- a/administrator/components/com_guidedtours/tmpl/tours/default.php +++ b/administrator/components/com_guidedtours/tmpl/tours/default.php @@ -23,7 +23,7 @@ /** @var HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); @@ -34,7 +34,7 @@ } $user = $app->getIdentity(); -$userId = $user->get('id'); +$userId = $user->id; $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'a.ordering'; diff --git a/administrator/components/com_installer/src/Model/DatabaseModel.php b/administrator/components/com_installer/src/Model/DatabaseModel.php index 278be890e00e1..0923a7cc5a4b2 100644 --- a/administrator/components/com_installer/src/Model/DatabaseModel.php +++ b/administrator/components/com_installer/src/Model/DatabaseModel.php @@ -19,9 +19,9 @@ use Joomla\CMS\Table\Extension; use Joomla\CMS\Version; use Joomla\Component\Installer\Administrator\Helper\InstallerHelper; -use Joomla\Database\DatabaseQuery; use Joomla\Database\Exception\ExecutionFailureException; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Registry\Registry; \JLoader::register('JoomlaInstallerScript', JPATH_ADMINISTRATOR . '/components/com_admin/script.php'); @@ -320,7 +320,7 @@ public function getItems() /** * Method to get the database query * - * @return DatabaseQuery The database query + * @return QueryInterface The database query * * @since 4.0.0 */ diff --git a/administrator/components/com_installer/src/Model/DiscoverModel.php b/administrator/components/com_installer/src/Model/DiscoverModel.php index 26cfc37974906..2f47fad781c6b 100644 --- a/administrator/components/com_installer/src/Model/DiscoverModel.php +++ b/administrator/components/com_installer/src/Model/DiscoverModel.php @@ -14,9 +14,9 @@ use Joomla\CMS\Installer\Installer; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; -use Joomla\Database\DatabaseQuery; use Joomla\Database\Exception\ExecutionFailureException; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects @@ -89,7 +89,7 @@ protected function populateState($ordering = 'name', $direction = 'asc') /** * Method to get the database query. * - * @return DatabaseQuery The database query + * @return QueryInterface The database query * * @since 3.1 */ @@ -280,7 +280,7 @@ public function purge() /** * Manipulate the query to be used to evaluate if this is an Empty State to provide specific conditions for this extension. * - * @return DatabaseQuery + * @return QueryInterface * * @since 4.0.0 */ diff --git a/administrator/components/com_installer/src/Model/LanguagesModel.php b/administrator/components/com_installer/src/Model/LanguagesModel.php index 39f381c03fe31..7aba317158d01 100644 --- a/administrator/components/com_installer/src/Model/LanguagesModel.php +++ b/administrator/components/com_installer/src/Model/LanguagesModel.php @@ -155,7 +155,7 @@ protected function getLanguages() } $languages = []; - $search = strtolower($this->getState('filter.search')); + $search = strtolower($this->getState('filter.search', '')); foreach ($updateSiteXML->extension as $extension) { $language = new \stdClass(); @@ -183,9 +183,9 @@ protected function getLanguages() usort( $languages, function ($a, $b) use ($that) { - $ordering = $that->getState('list.ordering'); + $ordering = $that->getState('list.ordering', 'name'); - if (strtolower($that->getState('list.direction')) === 'asc') { + if (strtolower($that->getState('list.direction', 'asc')) === 'asc') { return StringHelper::strcmp($a->$ordering, $b->$ordering); } @@ -195,9 +195,9 @@ function ($a, $b) use ($that) { // Count the non-paginated list $this->languageCount = \count($languages); - $limit = ($this->getState('list.limit') > 0) ? $this->getState('list.limit') : $this->languageCount; + $limit = ($this->getState('list.limit', 20) > 0) ? $this->getState('list.limit', 20) : $this->languageCount; - return \array_slice($languages, $this->getStart(), $limit); + return \array_slice($languages, $this->getStart() ?? 0, $limit); } /** diff --git a/administrator/components/com_installer/src/Model/ManageModel.php b/administrator/components/com_installer/src/Model/ManageModel.php index d6c6e954d5d88..c5e1b44a79d46 100644 --- a/administrator/components/com_installer/src/Model/ManageModel.php +++ b/administrator/components/com_installer/src/Model/ManageModel.php @@ -21,8 +21,8 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Table\Extension; use Joomla\Component\Templates\Administrator\Table\StyleTable; -use Joomla\Database\DatabaseQuery; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -308,7 +308,7 @@ public function remove($eid = []) /** * Method to get the database query * - * @return DatabaseQuery The database query + * @return QueryInterface The database query * * @since 1.6 */ diff --git a/administrator/components/com_installer/src/Model/UpdateModel.php b/administrator/components/com_installer/src/Model/UpdateModel.php index 17431af5ed004..64a81e0284616 100644 --- a/administrator/components/com_installer/src/Model/UpdateModel.php +++ b/administrator/components/com_installer/src/Model/UpdateModel.php @@ -21,9 +21,9 @@ use Joomla\CMS\Plugin\PluginHelper; use Joomla\CMS\Updater\Update; use Joomla\CMS\Updater\Updater; -use Joomla\Database\DatabaseQuery; use Joomla\Database\Exception\ExecutionFailureException; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects @@ -92,7 +92,7 @@ protected function populateState($ordering = 'u.name', $direction = 'asc') /** * Method to get the database query * - * @return \Joomla\Database\DatabaseQuery The database query + * @return QueryInterface The database query * * @since 1.6 */ @@ -200,9 +200,9 @@ protected function translate(&$items) /** * Returns an object list * - * @param DatabaseQuery $query The query - * @param int $limitstart Offset - * @param int $limit The number of records + * @param QueryInterface $query The query + * @param int $limitstart Offset + * @param int $limit The number of records * * @return object[] * @@ -614,7 +614,7 @@ protected function preparePreUpdate($update, $table) /** * Manipulate the query to be used to evaluate if this is an Empty State to provide specific conditions for this extension. * - * @return DatabaseQuery + * @return QueryInterface * * @since 4.0.0 */ diff --git a/administrator/components/com_installer/src/Model/UpdatesitesModel.php b/administrator/components/com_installer/src/Model/UpdatesitesModel.php index 0ade2440207dd..5ec653751cd48 100644 --- a/administrator/components/com_installer/src/Model/UpdatesitesModel.php +++ b/administrator/components/com_installer/src/Model/UpdatesitesModel.php @@ -21,6 +21,7 @@ use Joomla\CMS\Table\UpdateSite as UpdateSiteTable; use Joomla\Component\Installer\Administrator\Helper\InstallerHelper; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -517,7 +518,7 @@ protected function getStoreId($id = '') /** * Method to get the database query * - * @return \Joomla\Database\DatabaseQuery The database query + * @return QueryInterface The database query * * @since 3.4 */ diff --git a/administrator/components/com_installer/tmpl/database/default.php b/administrator/components/com_installer/tmpl/database/default.php index 4fd6fb026007e..dcbd008ce8c64 100644 --- a/administrator/components/com_installer/tmpl/database/default.php +++ b/administrator/components/com_installer/tmpl/database/default.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Installer\Administrator\View\Database\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); diff --git a/administrator/components/com_installer/tmpl/discover/default.php b/administrator/components/com_installer/tmpl/discover/default.php index c59ca27aa433c..a42996408b1b9 100644 --- a/administrator/components/com_installer/tmpl/discover/default.php +++ b/administrator/components/com_installer/tmpl/discover/default.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Installer\Administrator\View\Discover\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); diff --git a/administrator/components/com_installer/tmpl/install/default.php b/administrator/components/com_installer/tmpl/install/default.php index 61775cf2efc93..5a3dec64c9ab3 100644 --- a/administrator/components/com_installer/tmpl/install/default.php +++ b/administrator/components/com_installer/tmpl/install/default.php @@ -27,7 +27,7 @@ Text::script('COM_INSTALLER_MSG_INSTALL_ENTER_A_URL'); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('core') ->usePreset('com_installer.installer') ->useScript('webcomponent.core-loader'); diff --git a/administrator/components/com_installer/tmpl/languages/default.php b/administrator/components/com_installer/tmpl/languages/default.php index 714caf960cbae..bc9575f3e1b62 100644 --- a/administrator/components/com_installer/tmpl/languages/default.php +++ b/administrator/components/com_installer/tmpl/languages/default.php @@ -19,7 +19,7 @@ /** @var \Joomla\Component\Installer\Administrator\View\Languages\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect') ->useScript('webcomponent.core-loader'); diff --git a/administrator/components/com_installer/tmpl/manage/default.php b/administrator/components/com_installer/tmpl/manage/default.php index 2429b771c63f0..0c09f458e1d68 100644 --- a/administrator/components/com_installer/tmpl/manage/default.php +++ b/administrator/components/com_installer/tmpl/manage/default.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Installer\Administrator\View\Manage\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect') ->useScript('joomla.dialog-autocreate'); diff --git a/administrator/components/com_installer/tmpl/update/default.php b/administrator/components/com_installer/tmpl/update/default.php index 19659ef7bbeaa..9970fef2e6b22 100644 --- a/administrator/components/com_installer/tmpl/update/default.php +++ b/administrator/components/com_installer/tmpl/update/default.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Installer\Administrator\View\Update\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('multiselect') ->useScript('table.columns') ->useScript('joomla.dialog-autocreate'); diff --git a/administrator/components/com_installer/tmpl/updatesite/edit.php b/administrator/components/com_installer/tmpl/updatesite/edit.php index be0c2ce5c365a..dc95fcddcd8a8 100644 --- a/administrator/components/com_installer/tmpl/updatesite/edit.php +++ b/administrator/components/com_installer/tmpl/updatesite/edit.php @@ -17,7 +17,7 @@ /** @var \Joomla\Component\Installer\Administrator\View\Updatesite\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('form.validate'); ?> diff --git a/administrator/components/com_installer/tmpl/updatesites/default.php b/administrator/components/com_installer/tmpl/updatesites/default.php index 17e68a5a9e136..be5c1e9f25249 100644 --- a/administrator/components/com_installer/tmpl/updatesites/default.php +++ b/administrator/components/com_installer/tmpl/updatesites/default.php @@ -18,12 +18,12 @@ /** @var \Joomla\Component\Installer\Administrator\View\Updatesites\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); $user = $this->getCurrentUser(); -$userId = $user->get('id'); +$userId = $user->id; $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); ?> diff --git a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/preupdatecheck.php b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/preupdatecheck.php index 769bd50bdc9a8..8abd7a5efa2e7 100644 --- a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/preupdatecheck.php +++ b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/preupdatecheck.php @@ -21,14 +21,14 @@ /** @var HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('core') ->useScript('com_joomlaupdate.default') ->useScript('bootstrap.popover') ->useScript('bootstrap.tab'); // Text::script doesn't have a sprintf equivalent so work around this -$this->document->addScriptOptions('nonCoreCriticalPlugins', $this->nonCoreCriticalPlugins); +$this->getDocument()->addScriptOptions('nonCoreCriticalPlugins', $this->nonCoreCriticalPlugins); // Push Joomla! Update client-side error messages Text::script('COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN_CONFIRM_MESSAGE'); diff --git a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/reinstall.php b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/reinstall.php index 5e8e78c3f174f..8e402929e3680 100644 --- a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/reinstall.php +++ b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/reinstall.php @@ -17,7 +17,7 @@ /** @var \Joomla\Component\Joomlaupdate\Administrator\View\Joomlaupdate\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('core') ->useScript('com_joomlaupdate.default') ->useScript('bootstrap.popover'); diff --git a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/update.php b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/update.php index d644542c4e02d..d316daba2266f 100644 --- a/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/update.php +++ b/administrator/components/com_joomlaupdate/tmpl/joomlaupdate/update.php @@ -17,7 +17,7 @@ /** @var \Joomla\Component\Joomlaupdate\Administrator\View\Joomlaupdate\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('core') ->useScript('com_joomlaupdate.default') ->useScript('bootstrap.popover'); diff --git a/administrator/components/com_joomlaupdate/tmpl/update/default.php b/administrator/components/com_joomlaupdate/tmpl/update/default.php index e741ccdddec68..898a647e62433 100644 --- a/administrator/components/com_joomlaupdate/tmpl/update/default.php +++ b/administrator/components/com_joomlaupdate/tmpl/update/default.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Joomlaupdate\Administrator\View\Update\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('core') ->useScript('com_joomlaupdate.admin-update') ->useScript('bootstrap.modal'); @@ -47,7 +47,7 @@ $ajaxUrl = Uri::base() . 'components/com_joomlaupdate/extract.php'; $returnUrl = 'index.php?option=com_joomlaupdate&task=update.finalise&' . Factory::getSession()->getFormToken() . '=1'; -$this->document->addScriptOptions( +$this->getDocument()->addScriptOptions( 'joomlaupdate', [ 'password' => $password, diff --git a/administrator/components/com_joomlaupdate/tmpl/update/finaliseconfirm.php b/administrator/components/com_joomlaupdate/tmpl/update/finaliseconfirm.php index 3c9454ad97bc1..ed13812241f7a 100644 --- a/administrator/components/com_joomlaupdate/tmpl/update/finaliseconfirm.php +++ b/administrator/components/com_joomlaupdate/tmpl/update/finaliseconfirm.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Joomlaupdate\Administrator\View\Update\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive'); ?> diff --git a/administrator/components/com_joomlaupdate/tmpl/upload/captive.php b/administrator/components/com_joomlaupdate/tmpl/upload/captive.php index f5d4d61aa21b1..76b10f0c16da6 100644 --- a/administrator/components/com_joomlaupdate/tmpl/upload/captive.php +++ b/administrator/components/com_joomlaupdate/tmpl/upload/captive.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Joomlaupdate\Administrator\View\Upload\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('core') ->useScript('jquery') ->useScript('form.validate') diff --git a/administrator/components/com_joomlaupdate/tmpl/upload/default.php b/administrator/components/com_joomlaupdate/tmpl/upload/default.php index a329b73a13acc..1626462d8d430 100644 --- a/administrator/components/com_joomlaupdate/tmpl/upload/default.php +++ b/administrator/components/com_joomlaupdate/tmpl/upload/default.php @@ -19,7 +19,7 @@ /** @var HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('core') ->useScript('com_joomlaupdate.default') ->useScript('bootstrap.popover'); diff --git a/administrator/components/com_languages/src/Model/LanguagesModel.php b/administrator/components/com_languages/src/Model/LanguagesModel.php index 43949a3d2f2da..ea494ed7d5a20 100644 --- a/administrator/components/com_languages/src/Model/LanguagesModel.php +++ b/administrator/components/com_languages/src/Model/LanguagesModel.php @@ -14,8 +14,8 @@ use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; use Joomla\CMS\Table\Table; -use Joomla\Database\DatabaseQuery; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -105,7 +105,7 @@ protected function getStoreId($id = '') /** * Method to build an SQL query to load the list data. * - * @return DatabaseQuery An SQL query + * @return QueryInterface An SQL query * * @since 1.6 */ diff --git a/administrator/components/com_languages/src/Model/OverridesModel.php b/administrator/components/com_languages/src/Model/OverridesModel.php index c05d9e5b511ce..ad9b1492fb771 100644 --- a/administrator/components/com_languages/src/Model/OverridesModel.php +++ b/administrator/components/com_languages/src/Model/OverridesModel.php @@ -233,7 +233,7 @@ public function delete($cids) /** * Removes all of the cached strings from the table. * - * @return boolean result of operation + * @return void|\RuntimeException * * @since 3.4.2 */ diff --git a/administrator/components/com_languages/tmpl/installed/default.php b/administrator/components/com_languages/tmpl/installed/default.php index 48186ea75f35c..02e4a83886341 100644 --- a/administrator/components/com_languages/tmpl/installed/default.php +++ b/administrator/components/com_languages/tmpl/installed/default.php @@ -20,7 +20,7 @@ /** @var \Joomla\Component\Languages\Administrator\View\Installed\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns'); $user = $this->getCurrentUser(); diff --git a/administrator/components/com_languages/tmpl/language/edit.php b/administrator/components/com_languages/tmpl/language/edit.php index 0c0e5661d2502..3288093d4fb89 100644 --- a/administrator/components/com_languages/tmpl/language/edit.php +++ b/administrator/components/com_languages/tmpl/language/edit.php @@ -17,7 +17,7 @@ /** @var \Joomla\Component\Languages\Administrator\View\Language\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate') ->useScript('com_languages.admin-language-edit-change-flag'); diff --git a/administrator/components/com_languages/tmpl/languages/default.php b/administrator/components/com_languages/tmpl/languages/default.php index f095c30cee57f..b9930320a5626 100644 --- a/administrator/components/com_languages/tmpl/languages/default.php +++ b/administrator/components/com_languages/tmpl/languages/default.php @@ -19,7 +19,7 @@ /** @var \Joomla\Component\Languages\Administrator\View\Languages\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); diff --git a/administrator/components/com_languages/tmpl/override/edit.php b/administrator/components/com_languages/tmpl/override/edit.php index cea4d169c51e5..6df1ece2e9778 100644 --- a/administrator/components/com_languages/tmpl/override/edit.php +++ b/administrator/components/com_languages/tmpl/override/edit.php @@ -19,7 +19,7 @@ $expired = ($this->state->get('cache_expired') == 1 ) ? '1' : ''; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate') ->usePreset('com_languages.overrider') diff --git a/administrator/components/com_languages/tmpl/overrides/default.php b/administrator/components/com_languages/tmpl/overrides/default.php index cfba4e38e1d64..66b295bd8c4c3 100644 --- a/administrator/components/com_languages/tmpl/overrides/default.php +++ b/administrator/components/com_languages/tmpl/overrides/default.php @@ -19,7 +19,7 @@ /** @var \Joomla\Component\Languages\Administrator\View\Overrides\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); diff --git a/administrator/components/com_mails/src/Model/TemplatesModel.php b/administrator/components/com_mails/src/Model/TemplatesModel.php index 45173e78fbd85..eda12f4de957f 100644 --- a/administrator/components/com_mails/src/Model/TemplatesModel.php +++ b/administrator/components/com_mails/src/Model/TemplatesModel.php @@ -13,7 +13,7 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\MVC\Model\ListModel; -use Joomla\Database\DatabaseQuery; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -109,7 +109,7 @@ public function getItems() /** * Build an SQL query to load the list data. * - * @return DatabaseQuery + * @return QueryInterface * * @since 4.0.0 */ diff --git a/administrator/components/com_mails/tmpl/template/edit.php b/administrator/components/com_mails/tmpl/template/edit.php index 5693ef8e66ad3..5cd1385fb84a5 100644 --- a/administrator/components/com_mails/tmpl/template/edit.php +++ b/administrator/components/com_mails/tmpl/template/edit.php @@ -23,7 +23,7 @@ $app = Factory::getApplication(); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate') ->useScript('com_mails.admin-email-template-edit'); @@ -34,7 +34,7 @@ list($component, $sub_id) = explode('.', $this->master->template_id, 2); $sub_id = str_replace('.', '_', $sub_id); -$this->document->addScriptOptions('com_mails', ['templateData' => $this->templateData]); +$this->getDocument()->addScriptOptions('com_mails', ['templateData' => $this->templateData]); ?> diff --git a/administrator/components/com_mails/tmpl/templates/default.php b/administrator/components/com_mails/tmpl/templates/default.php index daa96aa87bf08..86690895985b8 100644 --- a/administrator/components/com_mails/tmpl/templates/default.php +++ b/administrator/components/com_mails/tmpl/templates/default.php @@ -20,7 +20,7 @@ HTMLHelper::_('bootstrap.dropdown', '.dropdown-toggle'); /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns'); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_media/tmpl/file/default.php b/administrator/components/com_media/tmpl/file/default.php index 964c8ee93e16f..a1807a44fc4d6 100644 --- a/administrator/components/com_media/tmpl/file/default.php +++ b/administrator/components/com_media/tmpl/file/default.php @@ -20,7 +20,7 @@ /** @var \Joomla\Component\Media\Administrator\View\File\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate') ->useStyle('com_media.mediamanager'); @@ -53,13 +53,13 @@ 'contents' => $this->file->content, ]; -$this->document->addScriptOptions('com_media', $config); +$this->getDocument()->addScriptOptions('com_media', $config); $this->useCoreUI = true; ?>
- document->getToolbar('toolbar')->render(); ?> + getDocument()->getToolbar('toolbar')->render(); ?>
@@ -72,4 +72,4 @@
- + diff --git a/administrator/components/com_media/tmpl/media/default.php b/administrator/components/com_media/tmpl/media/default.php index a6e3783af1710..b1785db7fac56 100644 --- a/administrator/components/com_media/tmpl/media/default.php +++ b/administrator/components/com_media/tmpl/media/default.php @@ -23,7 +23,7 @@ $user = $app->getIdentity(); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useStyle('com_media.mediamanager') ->useScript('com_media.mediamanager'); @@ -55,11 +55,11 @@ 'canEdit' => $user->authorise('core.edit', 'com_media'), 'canDelete' => $user->authorise('core.delete', 'com_media'), ]; -$this->document->addScriptOptions('com_media', $config); +$this->getDocument()->addScriptOptions('com_media', $config); ?>
- document->getToolbar('toolbar')->render(); ?> + getDocument()->getToolbar('toolbar')->render(); ?>
diff --git a/administrator/components/com_menus/src/Controller/MenuController.php b/administrator/components/com_menus/src/Controller/MenuController.php index 0bc88f5be1329..0b9f99a79ece6 100644 --- a/administrator/components/com_menus/src/Controller/MenuController.php +++ b/administrator/components/com_menus/src/Controller/MenuController.php @@ -180,6 +180,8 @@ public function save($key = null, $urlVar = null) $this->setRedirect(Route::_('index.php?option=com_menus&view=menus', false)); break; } + + return true; } /** diff --git a/administrator/components/com_menus/src/Model/ItemsModel.php b/administrator/components/com_menus/src/Model/ItemsModel.php index b55ee807863ac..172fb75729d25 100644 --- a/administrator/components/com_menus/src/Model/ItemsModel.php +++ b/administrator/components/com_menus/src/Model/ItemsModel.php @@ -19,6 +19,7 @@ use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -231,7 +232,7 @@ protected function getStoreId($id = '') /** * Builds an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery A query object. + * @return QueryInterface A query object. * * @since 1.6 */ diff --git a/administrator/components/com_menus/src/Model/MenusModel.php b/administrator/components/com_menus/src/Model/MenusModel.php index 16a538a34bcdc..41d9098d37af8 100644 --- a/administrator/components/com_menus/src/Model/MenusModel.php +++ b/administrator/components/com_menus/src/Model/MenusModel.php @@ -14,8 +14,8 @@ use Joomla\CMS\Language\LanguageHelper; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; -use Joomla\Database\DatabaseQuery; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -145,7 +145,7 @@ public function getItems() /** * Method to build an SQL query to load the list data. * - * @return DatabaseQuery An SQL query + * @return QueryInterface An SQL query * * @since 1.6 */ diff --git a/administrator/components/com_menus/src/View/Item/HtmlView.php b/administrator/components/com_menus/src/View/Item/HtmlView.php index 028f73b052b1f..21208cab7ab81 100644 --- a/administrator/components/com_menus/src/View/Item/HtmlView.php +++ b/administrator/components/com_menus/src/View/Item/HtmlView.php @@ -141,7 +141,7 @@ protected function addToolbar() $user = $this->getCurrentUser(); $isNew = ($this->item->id == 0); - $checkedOut = !(\is_null($this->item->checked_out) || $this->item->checked_out == $user->get('id')); + $checkedOut = !(\is_null($this->item->checked_out) || $this->item->checked_out == $user->id); $canDo = $this->canDo; $clientId = $this->state->get('item.client_id', 0); $toolbar = Toolbar::getInstance(); @@ -229,7 +229,7 @@ protected function addModalToolbar() { $user = $this->getCurrentUser(); $isNew = ($this->item->id == 0); - $checkedOut = !(\is_null($this->item->checked_out) || $this->item->checked_out == $user->get('id')); + $checkedOut = !(\is_null($this->item->checked_out) || $this->item->checked_out == $user->id); $canDo = $this->canDo; $toolbar = Toolbar::getInstance(); diff --git a/administrator/components/com_menus/tmpl/item/edit.php b/administrator/components/com_menus/tmpl/item/edit.php index 353b212586e84..b37dbe9f0787e 100644 --- a/administrator/components/com_menus/tmpl/item/edit.php +++ b/administrator/components/com_menus/tmpl/item/edit.php @@ -25,10 +25,10 @@ Text::script('JGLOBAL_VALIDATION_FORM_FAILED'); Text::script('JGLOBAL_ROOT_PARENT'); -$this->document->addScriptOptions('menu-item', ['itemId' => (int) $this->item->id]); +$this->getDocument()->addScriptOptions('menu-item', ['itemId' => (int) $this->item->id]); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate') ->useScript('com_menus.admin-item-edit'); diff --git a/administrator/components/com_menus/tmpl/item/edit_container.php b/administrator/components/com_menus/tmpl/item/edit_container.php index 0d54be3df71b7..05ed03830327c 100644 --- a/administrator/components/com_menus/tmpl/item/edit_container.php +++ b/administrator/components/com_menus/tmpl/item/edit_container.php @@ -20,7 +20,7 @@ $menuLinks = MenusHelper::getMenuLinks('main'); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('joomla.treeselectmenu') ->useStyle('com_menus.admin-item-edit-container') ->useScript('com_menus.admin-item-edit-container'); diff --git a/administrator/components/com_menus/tmpl/item/edit_modules.php b/administrator/components/com_menus/tmpl/item/edit_modules.php index aff598b16a0eb..d854a11b122c7 100644 --- a/administrator/components/com_menus/tmpl/item/edit_modules.php +++ b/administrator/components/com_menus/tmpl/item/edit_modules.php @@ -13,17 +13,17 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; +use Joomla\Component\Menus\Administrator\View\Item\HtmlView; -/** @var \Joomla\Component\Menus\Administrator\View\Item\HtmlView $this */ - +/** @var HtmlView $this */ foreach ($this->levels as $key => $value) { $allLevels[$value->id] = $value->title; } -$this->document->addScriptOptions('menus-edit-modules', ['viewLevels' => $allLevels, 'itemId' => (int) $this->item->id]); +$this->getDocument()->addScriptOptions('menus-edit-modules', ['viewLevels' => $allLevels, 'itemId' => (int) $this->item->id]); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_menus.admin-item-edit-modules') ->useScript('joomla.dialog-autocreate'); diff --git a/administrator/components/com_menus/tmpl/item/modal.php b/administrator/components/com_menus/tmpl/item/modal.php index 91a77916d4071..224a84177345a 100644 --- a/administrator/components/com_menus/tmpl/item/modal.php +++ b/administrator/components/com_menus/tmpl/item/modal.php @@ -13,7 +13,7 @@ /** @var \Joomla\Component\Menus\Administrator\View\Item\HtmlView $this */ ?>
- document->getToolbar('toolbar')->render(); ?> + getDocument()->getToolbar('toolbar')->render(); ?>
setLayout('edit'); ?> diff --git a/administrator/components/com_menus/tmpl/item/modalreturn.php b/administrator/components/com_menus/tmpl/item/modalreturn.php index b3cbe7817dd2b..187305cb02d71 100644 --- a/administrator/components/com_menus/tmpl/item/modalreturn.php +++ b/administrator/components/com_menus/tmpl/item/modalreturn.php @@ -25,11 +25,11 @@ // Add Content select script /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('modal-content-select'); // The data for Content select script -$this->document->addScriptOptions('content-select-on-load', $data, false); +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); ?> diff --git a/administrator/components/com_menus/tmpl/items/default.php b/administrator/components/com_menus/tmpl/items/default.php index bb7a075f2f6ae..f2b5971bd021c 100644 --- a/administrator/components/com_menus/tmpl/items/default.php +++ b/administrator/components/com_menus/tmpl/items/default.php @@ -22,13 +22,13 @@ /** @var \Joomla\Component\Menus\Administrator\View\Items\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); $user = $this->getCurrentUser(); $app = Factory::getApplication(); -$userId = $user->get('id'); +$userId = $user->id; $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $ordering = ($listOrder == 'a.lft'); @@ -109,7 +109,7 @@ $orderkey = array_search($item->id, $this->ordering[$item->parent_id]); $canCreate = $user->authorise('core.create', 'com_menus.menu.' . $item->menutype_id); $canEdit = $user->authorise('core.edit', 'com_menus.menu.' . $item->menutype_id); - $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || is_null($item->checked_out); + $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || is_null($item->checked_out); $canChange = $user->authorise('core.edit.state', 'com_menus.menu.' . $item->menutype_id) && $canCheckin; // Get the parents of item for sorting diff --git a/administrator/components/com_menus/tmpl/items/default_batch_body.php b/administrator/components/com_menus/tmpl/items/default_batch_body.php index 229931615f9d3..71f9df278611b 100644 --- a/administrator/components/com_menus/tmpl/items/default_batch_body.php +++ b/administrator/components/com_menus/tmpl/items/default_batch_body.php @@ -28,7 +28,7 @@ if ($clientId == 1) { /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ - $wa = $this->document->getWebAssetManager(); + $wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_menus.batch-body'); $wa->useScript('joomla.batch-copymove'); } diff --git a/administrator/components/com_menus/tmpl/items/modal.php b/administrator/components/com_menus/tmpl/items/modal.php index 70cae7c6e3228..62ade8a302d58 100644 --- a/administrator/components/com_menus/tmpl/items/modal.php +++ b/administrator/components/com_menus/tmpl/items/modal.php @@ -27,7 +27,7 @@ } /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_menus.admin-items-modal')->useScript('modal-content-select'); // @todo: Use of Function and Editor is deprecated and should be removed in 6.0. It stays only for backward compatibility. @@ -40,7 +40,7 @@ if (!empty($editor)) { // This view is used also in com_menus. Load the xtd script only if the editor is set! - $this->document->addScriptOptions('xtd-menus', ['editor' => $editor]); + $this->getDocument()->addScriptOptions('xtd-menus', ['editor' => $editor]); $onclick = "jSelectMenuItem"; $link = 'index.php?option=com_menus&view=items&layout=modal&tmpl=component&editor=' . $editor . '&' . Session::getFormToken() . '=1&function=' . $function; } diff --git a/administrator/components/com_menus/tmpl/menu/edit.php b/administrator/components/com_menus/tmpl/menu/edit.php index 85cc6ddaad905..c689ed4451801 100644 --- a/administrator/components/com_menus/tmpl/menu/edit.php +++ b/administrator/components/com_menus/tmpl/menu/edit.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Menus\Administrator\View\Menu\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('core') ->useScript('keepalive') ->useScript('form.validate'); diff --git a/administrator/components/com_menus/tmpl/menus/default.php b/administrator/components/com_menus/tmpl/menus/default.php index de22ecbcff54a..e39ba67c3d4c5 100644 --- a/administrator/components/com_menus/tmpl/menus/default.php +++ b/administrator/components/com_menus/tmpl/menus/default.php @@ -20,7 +20,7 @@ /** @var \Joomla\Component\Menus\Administrator\View\Menus\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect') ->useScript('com_menus.admin-menus') @@ -47,7 +47,7 @@ HTMLHelper::_('draggablelist.draggable'); } -$this->document->addScriptOptions('menus-default', ['items' => $itemIds]); +$this->getDocument()->addScriptOptions('menus-default', ['items' => $itemIds]); // Set up the modal options that will be used for module editor $popupOptionsEdit = [ diff --git a/administrator/components/com_menus/tmpl/menutypes/default.php b/administrator/components/com_menus/tmpl/menutypes/default.php index 525ede44dec0a..20802be4fee77 100644 --- a/administrator/components/com_menus/tmpl/menutypes/default.php +++ b/administrator/components/com_menus/tmpl/menutypes/default.php @@ -23,7 +23,7 @@ $tmpl = $input->getCmd('tmpl') ? '1' : ''; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_menus.admin-item-modal'); if ($tmpl) { diff --git a/administrator/components/com_messages/src/Model/ConfigModel.php b/administrator/components/com_messages/src/Model/ConfigModel.php index 4b0d3ae9ebc66..692299e83bceb 100644 --- a/administrator/components/com_messages/src/Model/ConfigModel.php +++ b/administrator/components/com_messages/src/Model/ConfigModel.php @@ -43,7 +43,7 @@ protected function populateState() { $user = $this->getCurrentUser(); - $this->setState('user.id', $user->get('id')); + $this->setState('user.id', $user->id); // Load the parameters. $params = ComponentHelper::getParams('com_messages'); diff --git a/administrator/components/com_messages/src/Model/MessageModel.php b/administrator/components/com_messages/src/Model/MessageModel.php index 534a353cf4c8a..b4547ca06250e 100644 --- a/administrator/components/com_messages/src/Model/MessageModel.php +++ b/administrator/components/com_messages/src/Model/MessageModel.php @@ -69,7 +69,7 @@ protected function populateState() $input = Factory::getApplication()->getInput(); $user = $this->getCurrentUser(); - $this->setState('user.id', $user->get('id')); + $this->setState('user.id', $user->id); $messageId = (int) $input->getInt('message_id'); $this->setState('message.id', $messageId); @@ -300,7 +300,7 @@ public function save($data) // Assign empty values. if (empty($table->user_id_from)) { - $table->user_id_from = $this->getCurrentUser()->get('id'); + $table->user_id_from = $this->getCurrentUser()->id; } if ((int) $table->date_time == 0) { @@ -366,7 +366,7 @@ public function save($data) $app = Factory::getApplication(); $linkMode = $app->get('force_ssl', 0) >= 1 ? Route::TLS_FORCE : Route::TLS_IGNORE; $sitename = $app->get('sitename'); - $fromName = $fromUser->get('name'); + $fromName = $fromUser->name; $siteURL = Route::link( 'administrator', 'index.php?option=com_messages&view=message&message_id=' . $table->message_id, diff --git a/administrator/components/com_messages/src/Model/MessagesModel.php b/administrator/components/com_messages/src/Model/MessagesModel.php index 0d2494ce3ead9..7c214c82f9dec 100644 --- a/administrator/components/com_messages/src/Model/MessagesModel.php +++ b/administrator/components/com_messages/src/Model/MessagesModel.php @@ -14,6 +14,7 @@ use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -99,7 +100,7 @@ protected function getStoreId($id = '') /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 1.6 */ @@ -109,7 +110,7 @@ protected function getListQuery() $db = $this->getDatabase(); $query = $db->getQuery(true); $user = $this->getCurrentUser(); - $id = (int) $user->get('id'); + $id = (int) $user->id; // Select the required fields from the table. $query->select( diff --git a/administrator/components/com_messages/tmpl/config/default.php b/administrator/components/com_messages/tmpl/config/default.php index 350bd8fea815b..a366045716225 100644 --- a/administrator/components/com_messages/tmpl/config/default.php +++ b/administrator/components/com_messages/tmpl/config/default.php @@ -17,7 +17,7 @@ /** @var \Joomla\Component\Messages\Administrator\View\Config\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); ?> diff --git a/administrator/components/com_messages/tmpl/message/default.php b/administrator/components/com_messages/tmpl/message/default.php index 0bd7249090f09..9dd62b281b627 100644 --- a/administrator/components/com_messages/tmpl/message/default.php +++ b/administrator/components/com_messages/tmpl/message/default.php @@ -17,7 +17,7 @@ /** @var \Joomla\Component\Messages\Administrator\View\Message\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('core'); ?> diff --git a/administrator/components/com_messages/tmpl/message/edit.php b/administrator/components/com_messages/tmpl/message/edit.php index 33b0335f4ec32..ac0fe33e81b54 100644 --- a/administrator/components/com_messages/tmpl/message/edit.php +++ b/administrator/components/com_messages/tmpl/message/edit.php @@ -17,7 +17,7 @@ /** @var \Joomla\Component\Messages\Administrator\View\Message\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); diff --git a/administrator/components/com_messages/tmpl/messages/default.php b/administrator/components/com_messages/tmpl/messages/default.php index 3dd9fc1c5b449..f79eb7488bdd7 100644 --- a/administrator/components/com_messages/tmpl/messages/default.php +++ b/administrator/components/com_messages/tmpl/messages/default.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Messages\Administrator\View\Messages\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('multiselect'); $user = $this->getCurrentUser(); diff --git a/administrator/components/com_modules/src/Controller/ModuleController.php b/administrator/components/com_modules/src/Controller/ModuleController.php index ac3fbc7d544ec..172d2dad9aa3e 100644 --- a/administrator/components/com_modules/src/Controller/ModuleController.php +++ b/administrator/components/com_modules/src/Controller/ModuleController.php @@ -258,7 +258,7 @@ public function save($key = null, $urlVar = null) /** * Method to get the other modules in the same position * - * @return string The data for the Ajax request. + * @return void * * @since 3.6.3 */ @@ -303,7 +303,7 @@ public function orderPosition() } catch (\RuntimeException $e) { $app->enqueueMessage($e->getMessage(), 'error'); - return ''; + return; } $orders2 = []; diff --git a/administrator/components/com_modules/src/Model/ModulesModel.php b/administrator/components/com_modules/src/Model/ModulesModel.php index 2e8751991f9fa..2eabe05b6d4c7 100644 --- a/administrator/components/com_modules/src/Model/ModulesModel.php +++ b/administrator/components/com_modules/src/Model/ModulesModel.php @@ -14,8 +14,8 @@ use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\ListModel; -use Joomla\Database\DatabaseQuery; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\String\StringHelper; use Joomla\Utilities\ArrayHelper; @@ -161,9 +161,9 @@ protected function getStoreId($id = '') /** * Returns an object list * - * @param DatabaseQuery $query The query - * @param int $limitstart Offset - * @param int $limit The number of records + * @param QueryInterface $query The query + * @param int $limitstart Offset + * @param int $limit The number of records * * @return array */ @@ -252,7 +252,7 @@ protected function translate(&$items) /** * Build an SQL query to load the list data. * - * @return DatabaseQuery + * @return QueryInterface */ protected function getListQuery() { @@ -425,7 +425,7 @@ protected function getListQuery() /** * Manipulate the query to be used to evaluate if this is an Empty State to provide specific conditions for this extension. * - * @return DatabaseQuery + * @return QueryInterface * * @since 4.0.0 */ diff --git a/administrator/components/com_modules/src/Model/SelectModel.php b/administrator/components/com_modules/src/Model/SelectModel.php index 12f4ad72e3e9f..643ca24503046 100644 --- a/administrator/components/com_modules/src/Model/SelectModel.php +++ b/administrator/components/com_modules/src/Model/SelectModel.php @@ -16,6 +16,7 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\ListModel; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Filesystem\Path; use Joomla\Utilities\ArrayHelper; @@ -83,7 +84,7 @@ protected function getStoreId($id = '') /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface */ protected function getListQuery() { diff --git a/administrator/components/com_modules/src/View/Module/HtmlView.php b/administrator/components/com_modules/src/View/Module/HtmlView.php index 52c22cbe56b08..b7ef0b6862834 100644 --- a/administrator/components/com_modules/src/View/Module/HtmlView.php +++ b/administrator/components/com_modules/src/View/Module/HtmlView.php @@ -114,7 +114,7 @@ protected function addToolbar() $user = $this->getCurrentUser(); $isNew = ($this->item->id == 0); - $checkedOut = !(\is_null($this->item->checked_out) || $this->item->checked_out == $user->get('id')); + $checkedOut = !(\is_null($this->item->checked_out) || $this->item->checked_out == $user->id); $canDo = $this->canDo; $toolbar = Toolbar::getInstance(); @@ -208,5 +208,7 @@ protected function addModalToolbar() } $toolbar->cancel('module.cancel'); + + $toolbar->inlinehelp(); } } diff --git a/administrator/components/com_modules/tmpl/module/edit.php b/administrator/components/com_modules/tmpl/module/edit.php index a51a1f02bd9de..45a819a54cfa9 100644 --- a/administrator/components/com_modules/tmpl/module/edit.php +++ b/administrator/components/com_modules/tmpl/module/edit.php @@ -37,10 +37,10 @@ Text::script('JALL'); Text::script('JTRASHED'); -$this->document->addScriptOptions('module-edit', ['itemId' => $this->item->id, 'state' => (int) $this->item->id == 0 ? 'Add' : 'Edit']); +$this->getDocument()->addScriptOptions('module-edit', ['itemId' => $this->item->id, 'state' => (int) $this->item->id == 0 ? 'Add' : 'Edit']); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); diff --git a/administrator/components/com_modules/tmpl/module/edit_assignment.php b/administrator/components/com_modules/tmpl/module/edit_assignment.php index 072844cd50d28..9306590dde5d3 100644 --- a/administrator/components/com_modules/tmpl/module/edit_assignment.php +++ b/administrator/components/com_modules/tmpl/module/edit_assignment.php @@ -21,7 +21,7 @@ // Initialise related data. $menuTypes = MenusHelper::getMenuLinks(); -$this->document->getWebAssetManager() +$this->getDocument()->getWebAssetManager() ->useScript('joomla.treeselectmenu') ->useScript('com_modules.admin-module-edit-assignment'); diff --git a/administrator/components/com_modules/tmpl/module/modal.php b/administrator/components/com_modules/tmpl/module/modal.php index 6122c50568437..4d9cad46253cf 100644 --- a/administrator/components/com_modules/tmpl/module/modal.php +++ b/administrator/components/com_modules/tmpl/module/modal.php @@ -26,7 +26,7 @@ ', ['name' => 'inline.module-modal-fix'], ['type' => 'module']); ?>
- document->getToolbar('toolbar')->render(); ?> + getDocument()->getToolbar('toolbar')->render(); ?>
setLayout('edit'); ?> diff --git a/administrator/components/com_modules/tmpl/module/modalreturn.php b/administrator/components/com_modules/tmpl/module/modalreturn.php index 59c712c62d733..d7c2228aceb63 100644 --- a/administrator/components/com_modules/tmpl/module/modalreturn.php +++ b/administrator/components/com_modules/tmpl/module/modalreturn.php @@ -32,11 +32,11 @@ // Add Content select script /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('modal-content-select'); // The data for Content select script -$this->document->addScriptOptions('content-select-on-load', $data, false); +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); ?> diff --git a/administrator/components/com_modules/tmpl/modules/default.php b/administrator/components/com_modules/tmpl/modules/default.php index eb1ace44a31de..5928d7c24d6e3 100644 --- a/administrator/components/com_modules/tmpl/modules/default.php +++ b/administrator/components/com_modules/tmpl/modules/default.php @@ -21,7 +21,7 @@ /** @var \Joomla\Component\Modules\Administrator\View\Modules\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); @@ -95,7 +95,7 @@ $ordering = ($listOrder == 'a.ordering'); $canCreate = $user->authorise('core.create', 'com_modules'); $canEdit = $user->authorise('core.edit', 'com_modules.module.' . $item->id); - $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || is_null($item->checked_out); + $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || is_null($item->checked_out); $canChange = $user->authorise('core.edit.state', 'com_modules.module.' . $item->id) && $canCheckin; ?> diff --git a/administrator/components/com_modules/tmpl/modules/default_batch_body.php b/administrator/components/com_modules/tmpl/modules/default_batch_body.php index bf9d34ba810a8..9174e50228baa 100644 --- a/administrator/components/com_modules/tmpl/modules/default_batch_body.php +++ b/administrator/components/com_modules/tmpl/modules/default_batch_body.php @@ -34,7 +34,7 @@ Text::script('JGLOBAL_SELECT_NO_RESULTS_MATCH'); Text::script('JGLOBAL_SELECT_PRESS_TO_SELECT'); -$this->document->getWebAssetManager() +$this->getDocument()->getWebAssetManager() ->usePreset('choicesjs') ->useScript('webcomponent.field-fancy-select') ->useScript('joomla.batch-copymove'); diff --git a/administrator/components/com_modules/tmpl/modules/modal.php b/administrator/components/com_modules/tmpl/modules/modal.php index 7b42fc5088d83..ec94112651a3e 100644 --- a/administrator/components/com_modules/tmpl/modules/modal.php +++ b/administrator/components/com_modules/tmpl/modules/modal.php @@ -24,7 +24,7 @@ } /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_modules.admin-modules-modal')->useScript('modal-content-select'); $listOrder = $this->escape($this->state->get('list.ordering')); diff --git a/administrator/components/com_modules/tmpl/select/default.php b/administrator/components/com_modules/tmpl/select/default.php index e668e7bdf5b30..8125ab6a06402 100644 --- a/administrator/components/com_modules/tmpl/select/default.php +++ b/administrator/components/com_modules/tmpl/select/default.php @@ -22,7 +22,7 @@ $function = $app->getInput()->getCmd('function'); /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_modules.admin-module-search'); if ($function) : diff --git a/administrator/components/com_newsfeeds/src/Model/NewsfeedModel.php b/administrator/components/com_newsfeeds/src/Model/NewsfeedModel.php index 5fccfccf5154c..b165d3134b4b2 100644 --- a/administrator/components/com_newsfeeds/src/Model/NewsfeedModel.php +++ b/administrator/components/com_newsfeeds/src/Model/NewsfeedModel.php @@ -320,7 +320,7 @@ protected function prepareTable($table) } else { // Set the values $table->modified = $date->toSql(); - $table->modified_by = $user->get('id'); + $table->modified_by = $user->id; } // Increment the content version number. diff --git a/administrator/components/com_newsfeeds/src/Model/NewsfeedsModel.php b/administrator/components/com_newsfeeds/src/Model/NewsfeedsModel.php index 255df9768b804..cee290f6ac3c9 100644 --- a/administrator/components/com_newsfeeds/src/Model/NewsfeedsModel.php +++ b/administrator/components/com_newsfeeds/src/Model/NewsfeedsModel.php @@ -16,6 +16,7 @@ use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects @@ -140,7 +141,7 @@ protected function getStoreId($id = '') /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface */ protected function getListQuery() { diff --git a/administrator/components/com_newsfeeds/src/Table/NewsfeedTable.php b/administrator/components/com_newsfeeds/src/Table/NewsfeedTable.php index 327afc27bbd08..6207b270a5efa 100644 --- a/administrator/components/com_newsfeeds/src/Table/NewsfeedTable.php +++ b/administrator/components/com_newsfeeds/src/Table/NewsfeedTable.php @@ -150,12 +150,12 @@ public function store($updateNulls = true) if ($this->id) { // Existing item - $this->modified_by = $user->get('id'); + $this->modified_by = $user->id; $this->modified = $date->toSql(); } else { // Field created_by can be set by the user, so we don't touch it if it's set. if (empty($this->created_by)) { - $this->created_by = $user->get('id'); + $this->created_by = $user->id; } if (!(int) $this->modified) { diff --git a/administrator/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php b/administrator/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php index 8f35fe1752b2b..f1d19c7e52389 100644 --- a/administrator/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php +++ b/administrator/components/com_newsfeeds/src/View/Newsfeed/HtmlView.php @@ -119,7 +119,7 @@ protected function addToolbar() $user = $this->getCurrentUser(); $isNew = ($this->item->id == 0); - $checkedOut = !(\is_null($this->item->checked_out) || $this->item->checked_out == $user->get('id')); + $checkedOut = !(\is_null($this->item->checked_out) || $this->item->checked_out == $user->id); $toolbar = Toolbar::getInstance(); // Since we don't track these assets at the item level, use the category id. diff --git a/administrator/components/com_newsfeeds/tmpl/newsfeed/edit.php b/administrator/components/com_newsfeeds/tmpl/newsfeed/edit.php index a6e3252c6084d..0122427456644 100644 --- a/administrator/components/com_newsfeeds/tmpl/newsfeed/edit.php +++ b/administrator/components/com_newsfeeds/tmpl/newsfeed/edit.php @@ -20,7 +20,7 @@ /** @var \Joomla\Component\Newsfeeds\Administrator\View\Newsfeed\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); diff --git a/administrator/components/com_newsfeeds/tmpl/newsfeed/modal.php b/administrator/components/com_newsfeeds/tmpl/newsfeed/modal.php index 9af43ab5542db..497af62fed381 100644 --- a/administrator/components/com_newsfeeds/tmpl/newsfeed/modal.php +++ b/administrator/components/com_newsfeeds/tmpl/newsfeed/modal.php @@ -13,7 +13,7 @@ /** @var \Joomla\Component\Newsfeeds\Administrator\View\Newsfeed\HtmlView $this */ ?>
- document->getToolbar('toolbar')->render(); ?> + getDocument()->getToolbar('toolbar')->render(); ?>
setLayout('edit'); ?> diff --git a/administrator/components/com_newsfeeds/tmpl/newsfeed/modalreturn.php b/administrator/components/com_newsfeeds/tmpl/newsfeed/modalreturn.php index 0f853a5991921..0a032dfd605b3 100644 --- a/administrator/components/com_newsfeeds/tmpl/newsfeed/modalreturn.php +++ b/administrator/components/com_newsfeeds/tmpl/newsfeed/modalreturn.php @@ -28,11 +28,11 @@ // Add Content select script /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('modal-content-select'); // The data for Content select script -$this->document->addScriptOptions('content-select-on-load', $data, false); +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); ?> diff --git a/administrator/components/com_newsfeeds/tmpl/newsfeeds/default.php b/administrator/components/com_newsfeeds/tmpl/newsfeeds/default.php index da436aca31c8d..5b1cf424eb896 100644 --- a/administrator/components/com_newsfeeds/tmpl/newsfeeds/default.php +++ b/administrator/components/com_newsfeeds/tmpl/newsfeeds/default.php @@ -21,7 +21,7 @@ /** @var \Joomla\Component\Newsfeeds\Administrator\View\Newsfeeds\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); @@ -98,7 +98,7 @@ $ordering = ($listOrder == 'a.ordering'); $canCreate = $user->authorise('core.create', 'com_newsfeeds.category.' . $item->catid); $canEdit = $user->authorise('core.edit', 'com_newsfeeds.category.' . $item->catid); - $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || is_null($item->checked_out); + $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || is_null($item->checked_out); $canEditOwn = $user->authorise('core.edit.own', 'com_newsfeeds.category.' . $item->catid) && $item->created_by == $user->id; $canChange = $user->authorise('core.edit.state', 'com_newsfeeds.category.' . $item->catid) && $canCheckin; ?> diff --git a/administrator/components/com_newsfeeds/tmpl/newsfeeds/modal.php b/administrator/components/com_newsfeeds/tmpl/newsfeeds/modal.php index a375f0ab651bf..e053cab87129b 100644 --- a/administrator/components/com_newsfeeds/tmpl/newsfeeds/modal.php +++ b/administrator/components/com_newsfeeds/tmpl/newsfeeds/modal.php @@ -21,7 +21,7 @@ /** @var \Joomla\Component\Newsfeeds\Administrator\View\Newsfeeds\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('core') ->useScript('modal-content-select'); diff --git a/administrator/components/com_plugins/src/Model/PluginsModel.php b/administrator/components/com_plugins/src/Model/PluginsModel.php index 6631da01185c4..6e631b7f02080 100644 --- a/administrator/components/com_plugins/src/Model/PluginsModel.php +++ b/administrator/components/com_plugins/src/Model/PluginsModel.php @@ -15,8 +15,8 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; -use Joomla\Database\DatabaseQuery; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects @@ -108,9 +108,9 @@ protected function getStoreId($id = '') /** * Returns an object list. * - * @param DatabaseQuery|string $query A database query object. - * @param integer $limitstart Offset. - * @param integer $limit The number of records. + * @param QueryInterface|string $query A database query object. + * @param integer $limitstart Offset. + * @param integer $limit The number of records. * * @return object[] */ @@ -197,7 +197,7 @@ protected function translate(&$items) /** * Build an SQL query to load the list data. * - * @return DatabaseQuery + * @return QueryInterface */ protected function getListQuery() { diff --git a/administrator/components/com_plugins/src/View/Plugin/HtmlView.php b/administrator/components/com_plugins/src/View/Plugin/HtmlView.php index ccaf0fffc49f2..82daf7da25947 100644 --- a/administrator/components/com_plugins/src/View/Plugin/HtmlView.php +++ b/administrator/components/com_plugins/src/View/Plugin/HtmlView.php @@ -150,5 +150,7 @@ protected function addModalToolbar() } $toolbar->cancel('plugin.cancel'); + + $toolbar->inlinehelp(); } } diff --git a/administrator/components/com_plugins/tmpl/plugin/edit.php b/administrator/components/com_plugins/tmpl/plugin/edit.php index 5e0e8a39f560e..1939185cd5f6d 100644 --- a/administrator/components/com_plugins/tmpl/plugin/edit.php +++ b/administrator/components/com_plugins/tmpl/plugin/edit.php @@ -19,7 +19,7 @@ /** @var \Joomla\Component\Plugins\Administrator\View\Plugin\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); diff --git a/administrator/components/com_plugins/tmpl/plugin/modal.php b/administrator/components/com_plugins/tmpl/plugin/modal.php index c4fd6e47ca3fe..d44de9e1a8a77 100644 --- a/administrator/components/com_plugins/tmpl/plugin/modal.php +++ b/administrator/components/com_plugins/tmpl/plugin/modal.php @@ -27,7 +27,7 @@ ?>
- document->getToolbar('toolbar')->render(); ?> + getDocument()->getToolbar('toolbar')->render(); ?>
setLayout('edit'); ?> diff --git a/administrator/components/com_plugins/tmpl/plugin/modalreturn.php b/administrator/components/com_plugins/tmpl/plugin/modalreturn.php index 8d0cf224810a8..3a26b2943584b 100644 --- a/administrator/components/com_plugins/tmpl/plugin/modalreturn.php +++ b/administrator/components/com_plugins/tmpl/plugin/modalreturn.php @@ -28,11 +28,11 @@ // Add Content select script /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('modal-content-select'); // The data for Content select script -$this->document->addScriptOptions('content-select-on-load', $data, false); +$this->getDocument()->addScriptOptions('content-select-on-load', $data, false); ?> diff --git a/administrator/components/com_plugins/tmpl/plugins/default.php b/administrator/components/com_plugins/tmpl/plugins/default.php index a61cc2ac08e92..f56129c5dacd5 100644 --- a/administrator/components/com_plugins/tmpl/plugins/default.php +++ b/administrator/components/com_plugins/tmpl/plugins/default.php @@ -19,7 +19,7 @@ /** @var \Joomla\Component\Plugins\Administrator\View\Plugins\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); @@ -82,7 +82,7 @@ items as $i => $item) : $ordering = ($listOrder == 'ordering'); $canEdit = $user->authorise('core.edit', 'com_plugins'); - $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->get('id') || is_null($item->checked_out); + $canCheckin = $user->authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || is_null($item->checked_out); $canChange = $user->authorise('core.edit.state', 'com_plugins') && $canCheckin; ?> diff --git a/administrator/components/com_privacy/src/Model/ConsentsModel.php b/administrator/components/com_privacy/src/Model/ConsentsModel.php index 172124a7cc5fa..ce6bfd07469cf 100644 --- a/administrator/components/com_privacy/src/Model/ConsentsModel.php +++ b/administrator/components/com_privacy/src/Model/ConsentsModel.php @@ -12,9 +12,9 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\MVC\Model\ListModel; -use Joomla\Database\DatabaseQuery; use Joomla\Database\Exception\ExecutionFailureException; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; use Joomla\Utilities\ArrayHelper; // phpcs:disable PSR1.Files.SideEffects @@ -53,9 +53,9 @@ public function __construct($config = []) } /** - * Method to get a DatabaseQuery object for retrieving the data set from a database. + * Method to get a QueryInterface object for retrieving the data set from a database. * - * @return DatabaseQuery + * @return QueryInterface * * @since 3.9.0 */ diff --git a/administrator/components/com_privacy/src/Model/RequestsModel.php b/administrator/components/com_privacy/src/Model/RequestsModel.php index 25e5042ae66c0..3be25115c3a21 100644 --- a/administrator/components/com_privacy/src/Model/RequestsModel.php +++ b/administrator/components/com_privacy/src/Model/RequestsModel.php @@ -13,8 +13,8 @@ use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\MVC\Model\ListModel; -use Joomla\Database\DatabaseQuery; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -50,9 +50,9 @@ public function __construct($config = []) } /** - * Method to get a DatabaseQuery object for retrieving the data set from a database. + * Method to get a QueryInterface object for retrieving the data set from a database. * - * @return DatabaseQuery + * @return QueryInterface * * @since 3.9.0 */ diff --git a/administrator/components/com_privacy/tmpl/consents/default.php b/administrator/components/com_privacy/tmpl/consents/default.php index 6a6c6f0adec21..723d7ccb15c18 100644 --- a/administrator/components/com_privacy/tmpl/consents/default.php +++ b/administrator/components/com_privacy/tmpl/consents/default.php @@ -20,7 +20,7 @@ /** @var \Joomla\Component\Privacy\Administrator\View\Consents\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); diff --git a/administrator/components/com_privacy/tmpl/request/default.php b/administrator/components/com_privacy/tmpl/request/default.php index 92fd5d14939d0..b457b6cb125a1 100644 --- a/administrator/components/com_privacy/tmpl/request/default.php +++ b/administrator/components/com_privacy/tmpl/request/default.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Privacy\Administrator\View\Request\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); ?> diff --git a/administrator/components/com_privacy/tmpl/request/edit.php b/administrator/components/com_privacy/tmpl/request/edit.php index 682e79313dd4d..c29e4134b394e 100644 --- a/administrator/components/com_privacy/tmpl/request/edit.php +++ b/administrator/components/com_privacy/tmpl/request/edit.php @@ -17,7 +17,7 @@ /** @var \Joomla\Component\Privacy\Administrator\View\Request\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); diff --git a/administrator/components/com_privacy/tmpl/requests/default.php b/administrator/components/com_privacy/tmpl/requests/default.php index 58b9fd357d035..08bd03afc9224 100644 --- a/administrator/components/com_privacy/tmpl/requests/default.php +++ b/administrator/components/com_privacy/tmpl/requests/default.php @@ -21,7 +21,7 @@ /** @var \Joomla\Component\Privacy\Administrator\View\Request\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect'); diff --git a/administrator/components/com_redirect/src/Model/LinksModel.php b/administrator/components/com_redirect/src/Model/LinksModel.php index 042e4314d84df..f54531c9c5eb0 100644 --- a/administrator/components/com_redirect/src/Model/LinksModel.php +++ b/administrator/components/com_redirect/src/Model/LinksModel.php @@ -15,6 +15,7 @@ use Joomla\CMS\MVC\Factory\MVCFactoryInterface; use Joomla\CMS\MVC\Model\ListModel; use Joomla\Database\ParameterType; +use Joomla\Database\QueryInterface; // phpcs:disable PSR1.Files.SideEffects \defined('_JEXEC') or die; @@ -127,7 +128,7 @@ protected function getStoreId($id = '') /** * Build an SQL query to load the list data. * - * @return \Joomla\Database\DatabaseQuery + * @return QueryInterface * * @since 1.6 */ diff --git a/administrator/components/com_redirect/tmpl/link/edit.php b/administrator/components/com_redirect/tmpl/link/edit.php index d41c724590ddf..6cc9b7d0cb9f0 100644 --- a/administrator/components/com_redirect/tmpl/link/edit.php +++ b/administrator/components/com_redirect/tmpl/link/edit.php @@ -18,7 +18,7 @@ /** @var \Joomla\Component\Redirect\Administrator\View\Link\HtmlView $this */ /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive') ->useScript('form.validate'); diff --git a/administrator/components/com_redirect/tmpl/links/default.php b/administrator/components/com_redirect/tmpl/links/default.php index 77555130dced5..e88ba83285a09 100644 --- a/administrator/components/com_redirect/tmpl/links/default.php +++ b/administrator/components/com_redirect/tmpl/links/default.php @@ -22,7 +22,7 @@ /** @var \Joomla\Component\Redirect\Administrator\View\Link\HtmlView $this */ /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('table.columns') ->useScript('multiselect') ->useScript('joomla.dialog-autocreate'); diff --git a/administrator/components/com_redirect/tmpl/links/emptystate.php b/administrator/components/com_redirect/tmpl/links/emptystate.php index edc7899266c86..1a7016491b5e4 100644 --- a/administrator/components/com_redirect/tmpl/links/emptystate.php +++ b/administrator/components/com_redirect/tmpl/links/emptystate.php @@ -51,7 +51,7 @@ $app->enqueueMessage(Text::sprintf('COM_REDIRECT_COLLECT_URLS_ENABLED', Text::_('COM_REDIRECT_PLUGIN_ENABLED')), 'notice'); } else { /** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */ - $wa = $this->document->getWebAssetManager(); + $wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('joomla.dialog-autocreate'); $popupOptions = [ diff --git a/administrator/components/com_scheduler/forms/filter_tasks.xml b/administrator/components/com_scheduler/forms/filter_tasks.xml index 78ad2ca21dca5..ce99fa07909d2 100644 --- a/administrator/components/com_scheduler/forms/filter_tasks.xml +++ b/administrator/components/com_scheduler/forms/filter_tasks.xml @@ -45,7 +45,7 @@ type="list" label="JGLOBAL_SORT_BY" class="js-select-submit-on-change" - default="a.title ASC" + default="a.next_execution ASC" validate="options" > @@ -59,6 +59,8 @@ + + diff --git a/administrator/components/com_scheduler/src/Model/TasksModel.php b/administrator/components/com_scheduler/src/Model/TasksModel.php index 2e80dc4b92e29..c699887897fba 100644 --- a/administrator/components/com_scheduler/src/Model/TasksModel.php +++ b/administrator/components/com_scheduler/src/Model/TasksModel.php @@ -19,7 +19,6 @@ use Joomla\CMS\Object\CMSObject; use Joomla\Component\Scheduler\Administrator\Helper\SchedulerHelper; use Joomla\Component\Scheduler\Administrator\Task\TaskOption; -use Joomla\Database\DatabaseQuery; use Joomla\Database\ParameterType; use Joomla\Database\QueryInterface; use Joomla\Utilities\ArrayHelper; @@ -103,7 +102,7 @@ protected function getStoreId($id = ''): string /** * Method to create a query for a list of items. * - * @return DatabaseQuery + * @return QueryInterface * * @since 4.1.0 * @throws \Exception @@ -329,7 +328,7 @@ static function (TaskOption $taskOption): string { $multiOrdering = $this->state->get('list.multi_ordering'); if (!$multiOrdering || !\is_array($multiOrdering)) { - $orderCol = $this->state->get('list.ordering', 'a.title'); + $orderCol = $this->state->get('list.ordering', 'a.next_execution'); $orderDir = $this->state->get('list.direction', 'asc'); // Type title ordering is handled exceptionally in _getList() @@ -354,9 +353,9 @@ static function (TaskOption $taskOption): string { * Overloads the parent _getList() method. * Takes care of attaching TaskOption objects and sorting by type titles. * - * @param DatabaseQuery $query The database query to get the list with - * @param int $limitstart The list offset - * @param int $limit Number of list items to fetch + * @param QueryInterface $query The database query to get the list with + * @param int $limitstart The list offset + * @param int $limit Number of list items to fetch * * @return object[] * @@ -366,7 +365,7 @@ static function (TaskOption $taskOption): string { protected function _getList($query, $limitstart = 0, $limit = 0): array { // Get stuff from the model state - $listOrder = $this->getState('list.ordering', 'a.title'); + $listOrder = $this->getState('list.ordering', 'a.next_execution'); $listDirectionN = strtolower($this->getState('list.direction', 'asc')) === 'desc' ? -1 : 1; // Set limit parameters and get object list @@ -433,7 +432,7 @@ private function attachTaskOptions(array $items): void * @return void * @since 4.1.0 */ - protected function populateState($ordering = 'a.title', $direction = 'ASC'): void + protected function populateState($ordering = 'a.next_execution', $direction = 'ASC'): void { // Call the parent method parent::populateState($ordering, $direction); @@ -468,4 +467,15 @@ public function hasDueTasks(Date $time): bool // False if we don't have due tasks, or we have locked tasks return $taskDetails && $taskDetails->due_count && !$taskDetails->locked_count; } + + /** + * Check if we have right now any enabled due tasks and no locked tasks. + * + * @return boolean + * @since 5.2.0 + */ + public function getHasDueTasks() + { + return $this->hasDueTasks(Factory::getDate('now', 'UTC')); + } } diff --git a/administrator/components/com_scheduler/src/Table/TaskTable.php b/administrator/components/com_scheduler/src/Table/TaskTable.php index 5a778142d7e22..65eb96cefc23c 100644 --- a/administrator/components/com_scheduler/src/Table/TaskTable.php +++ b/administrator/components/com_scheduler/src/Table/TaskTable.php @@ -45,7 +45,7 @@ class TaskTable extends Table implements CurrentUserInterface protected $_supportNullValue = true; /** - * Ensure params are json encoded by the bind method. + * Ensure params are json encoded in the bind method. * * @var string[] * @since 4.1.0 diff --git a/administrator/components/com_scheduler/src/View/Tasks/HtmlView.php b/administrator/components/com_scheduler/src/View/Tasks/HtmlView.php index 0934d91923a5f..828f486e46c61 100644 --- a/administrator/components/com_scheduler/src/View/Tasks/HtmlView.php +++ b/administrator/components/com_scheduler/src/View/Tasks/HtmlView.php @@ -97,6 +97,7 @@ public function display($tpl = null): void $this->state = $this->get('State'); $this->filterForm = $this->get('FilterForm'); $this->activeFilters = $this->get('ActiveFilters'); + $this->hasDueTasks = $this->get('hasDueTasks'); if (!\count($this->items) && $this->isEmptyState = $this->get('IsEmptyState')) { $this->setLayout('empty_state'); diff --git a/administrator/components/com_scheduler/tmpl/select/default.php b/administrator/components/com_scheduler/tmpl/select/default.php index 4705b91a6c6a2..10d4939f39a50 100644 --- a/administrator/components/com_scheduler/tmpl/select/default.php +++ b/administrator/components/com_scheduler/tmpl/select/default.php @@ -22,7 +22,7 @@ $app = $this->app; -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('com_scheduler.admin-view-select-task-search'); ?> diff --git a/administrator/components/com_scheduler/tmpl/task/edit.php b/administrator/components/com_scheduler/tmpl/task/edit.php index 2573261ce460c..8240b1996cb4e 100644 --- a/administrator/components/com_scheduler/tmpl/task/edit.php +++ b/administrator/components/com_scheduler/tmpl/task/edit.php @@ -21,7 +21,7 @@ /** @var HtmlView $this */ -$wa = $this->document->getWebAssetManager(); +$wa = $this->getDocument()->getWebAssetManager(); $wa->useScript('keepalive'); $wa->useScript('form.validate'); diff --git a/administrator/components/com_scheduler/tmpl/tasks/default.php b/administrator/components/com_scheduler/tmpl/tasks/default.php index e2ecc581c7736..60ef2e27c9295 100644 --- a/administrator/components/com_scheduler/tmpl/tasks/default.php +++ b/administrator/components/com_scheduler/tmpl/tasks/default.php @@ -52,7 +52,7 @@ } $user = $app->getIdentity(); -$userId = $user->get('id'); +$userId = $user->id; $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $saveOrder = $listOrder == 'a.ordering'; @@ -63,6 +63,12 @@ $saveOrderingUrl = 'index.php?option=com_scheduler&task=tasks.saveOrderAjax&tmpl=component&' . Session::getFormToken() . '=1'; HTMLHelper::_('draggablelist.draggable'); } + +// When there are due Tasks show that information to the user +if ($this->hasDueTasks === true) { + $app->enqueueMessage(Text::_('COM_SCHEDULER_MSG_DUETASKS'), 'warning'); +} + ?>
+ + + + + @@ -239,6 +250,11 @@ class="js-draggable" data-url="" data-direction=" last_execution ? HTMLHelper::_('date', $item->last_execution, 'DATE_FORMAT_LC5') : '-'; ?> + + + next_execution ? HTMLHelper::_('date', $item->next_execution, 'DATE_FORMAT_LC5') : Text::_('COM_SCHEDULER_NEXT_RUN_MANUAL'); ?> + +