diff --git a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php index 8516242b5e965..9582dcc0b0c52 100644 --- a/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php +++ b/administrator/components/com_joomlaupdate/src/Model/UpdateModel.php @@ -968,9 +968,9 @@ public function upload() // Check the uploaded file (throws RuntimeException when a check failed) if (\extension_loaded('zip')) { - $this->checkPackageFileZip($userfile['tmp_name']); + $this->checkPackageFileZip($userfile['tmp_name'], $userfile['name']); } else { - $this->checkPackageFileNoZip($userfile['tmp_name']); + $this->checkPackageFileNoZip($userfile['tmp_name'], $userfile['name']); } // Build the appropriate paths. @@ -1790,64 +1790,66 @@ public function collectError(string $context, \Throwable $error) /** * Check the update package with ZipArchive class from zip PHP extension * - * @param string $filePath Full path to the update package to test + * @param string $filePath Full path to the uploaded update package (temporary file) to test + * @param string $packageName Name of the selected update package * * @return void * - * @since 5.0.0 + * @since 4.4.0 * @throws \RuntimeException */ - private function checkPackageFileZip(string $filePath) + private function checkPackageFileZip(string $filePath, $packageName) { $zipArchive = new \ZipArchive(); if ($zipArchive->open($filePath) !== true) { - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN', $packageName), 500); } if ($zipArchive->locateName('installation/index.php') !== false) { - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_INSTALL_PACKAGE'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_INSTALL_PACKAGE', $packageName), 500); } $manifestFile = $zipArchive->getFromName('administrator/manifests/files/joomla.xml'); if ($manifestFile === false) { - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_MANIFEST_FILE'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_MANIFEST_FILE', $packageName), 500); } - $this->checkManifestXML($manifestFile); + $this->checkManifestXML($manifestFile, $packageName); } /** * Check the update package without using the ZipArchive class from zip PHP extension * - * @param string $filePath Full path to the update package to test + * @param string $filePath Full path to the uploaded update package (temporary file) to test + * @param string $packageName Name of the selected update package * * @return void * * @see https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT - * @since 5.0.0 + * @since 4.4.0 * @throws \RuntimeException */ - private function checkPackageFileNoZip(string $filePath) + private function checkPackageFileNoZip(string $filePath, $packageName) { // The file must exist and be readable if (!file_exists($filePath) || !is_readable($filePath)) { - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN', $packageName), 500); } // The file must be at least 1KiB (anything less is not even a real file!) $filesize = filesize($filePath); if ($filesize < 1024) { - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN', $packageName), 500); } // Open the file $fp = @fopen($filePath, 'rb'); if ($fp === false) { - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN', $packageName), 500); } // Read chunks of max. 1MiB size @@ -1874,7 +1876,7 @@ private function checkPackageFileNoZip(string $filePath) if ($fileChunk === false || strlen($fileChunk) !== $readsize) { @fclose($fp); - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN', $packageName), 500); } $posFirstHeader = strpos($fileChunk, $headerSignature); @@ -1893,7 +1895,7 @@ private function checkPackageFileNoZip(string $filePath) if (substr($fileChunk, $pos - 46, 4) == $headerSignature && substr($fileChunk, $pos - 18, 2) == $sizeSignatureIndexPhp) { @fclose($fp); - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_INSTALL_PACKAGE'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_INSTALL_PACKAGE', $packageName), 500); } $offset = $pos + 22; @@ -1928,14 +1930,14 @@ private function checkPackageFileNoZip(string $filePath) if (!$headerFound) { @fclose($fp); - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN', $packageName), 500); } // If no central directory file header found for the manifest XML file it's not a valid Joomla package if (!$headerInfo) { @fclose($fp); - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_MANIFEST_FILE'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_MANIFEST_FILE', $packageName), 500); } // Read the local file header of the manifest XML file @@ -1948,7 +1950,7 @@ private function checkPackageFileNoZip(string $filePath) if (!$localHeaderInfo['Compressed']) { @fclose($fp); - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_MANIFEST_FILE'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_MANIFEST_FILE', $packageName), 500); } // Read the compressed manifest XML file content @@ -1978,34 +1980,35 @@ private function checkPackageFileNoZip(string $filePath) } if (!$manifestFile) { - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_MANIFEST_FILE'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_MANIFEST_FILE', $packageName), 500); } - $this->checkManifestXML($manifestFile); + $this->checkManifestXML($manifestFile, $packageName); } /** * Check content of manifest XML file in update package * - * @param string $manifest Content of the manifest XML file + * @param string $manifest Content of the manifest XML file + * @param string $packageName Name of the selected update package * * @return void * - * @since 5.0.0 + * @since 4.4.0 * @throws \RuntimeException */ - private function checkManifestXML(string $manifest) + private function checkManifestXML(string $manifest, $packageName) { $manifestXml = simplexml_load_string($manifest); if (!$manifestXml) { - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_VERSION_FOUND'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_VERSION_FOUND', $packageName), 500); } $versionPackage = (string) $manifestXml->version ?: ''; if (!$versionPackage) { - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_VERSION_FOUND'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_VERSION_FOUND', $packageName), 500); } $currentVersion = JVERSION; @@ -2016,7 +2019,7 @@ private function checkManifestXML(string $manifest) } if (version_compare($versionPackage, $currentVersion, 'lt')) { - throw new \RuntimeException(Text::_('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_DOWNGRADE'), 500); + throw new \RuntimeException(Text::sprintf('COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_DOWNGRADE', $packageName, $versionPackage, $currentVersion), 500); } } } diff --git a/administrator/components/com_users/src/Model/UsersModel.php b/administrator/components/com_users/src/Model/UsersModel.php index 657ccdfba653c..0d3c46551726f 100644 --- a/administrator/components/com_users/src/Model/UsersModel.php +++ b/administrator/components/com_users/src/Model/UsersModel.php @@ -365,10 +365,7 @@ protected function getListQuery() $groups = $this->getState('filter.groups'); if ($groupId || isset($groups)) { - $query->join('LEFT', '#__user_usergroup_map AS map2 ON map2.user_id = a.id') - ->group( - $db->quoteName( - [ + $group_by = [ 'a.id', 'a.name', 'a.username', @@ -385,9 +382,14 @@ protected function getListQuery() 'a.otpKey', 'a.otep', 'a.requireReset', - ] - ) - ); + ]; + + if (PluginHelper::isEnabled('multifactorauth')) { + $group_by[] = 'mfa.mfaRecords'; + } + + $query->join('LEFT', '#__user_usergroup_map AS map2 ON map2.user_id = a.id') + ->group($db->quoteName($group_by)); if ($groupId) { $groupId = (int) $groupId; diff --git a/administrator/language/en-GB/com_joomlaupdate.ini b/administrator/language/en-GB/com_joomlaupdate.ini index 9a0101aa11e81..b059603856c19 100644 --- a/administrator/language/en-GB/com_joomlaupdate.ini +++ b/administrator/language/en-GB/com_joomlaupdate.ini @@ -179,11 +179,11 @@ COM_JOOMLAUPDATE_VIEW_UPDATE_FINALISE_HEAD_DESC="To complete the update Process COM_JOOMLAUPDATE_VIEW_UPDATE_PERCENT="Percent complete" COM_JOOMLAUPDATE_VIEW_UPLOAD_CAPTIVE_INTRO_BODY="Make sure that the update file you have uploaded comes from the official Joomla download page. Afterwards, please confirm that you want to install it by re-entering the login information for your site "%s" below." COM_JOOMLAUPDATE_VIEW_UPLOAD_CAPTIVE_INTRO_HEAD="Are you sure you want to install the file you uploaded?" -COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_DOWNGRADE="The update package file has a lower version than the current Joomla version. You cannot downgrade a Joomla site." -COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_INSTALL_PACKAGE="The uploaded package file looks like it is a full installation package of Joomla which can only be used for creating new sites. You can only use the \"Upgrade Package (.zip)\" to update your site." -COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_MANIFEST_FILE="The uploaded package file is not a Joomla update package. It does not contain the \"administrator/manifests/files/joomla.xml\" file." -COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_VERSION_FOUND="The uploaded package file is not a Joomla update package. It does not contain valid version information." -COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN="The uploaded package file is either not a ZIP file or is corrupted." +COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_DOWNGRADE="The uploaded package file \"%1$s\" has a lower version \"%2$s\" than the installed version \"%3$s\". You cannot downgrade a Joomla site.
Check the official Joomla download page for the Joomla Upgrade Package of a newer version." +COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_INSTALL_PACKAGE="The uploaded package file \"%s\" looks like it is a full installation package of Joomla which can only be used for creating new sites. You can only use the Upgrade Package to update your site.
Check the official Joomla download page for the Joomla Upgrade Package of the right version." +COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_MANIFEST_FILE="The uploaded package file \"%s\" is not a Joomla update package. It does not contain the \"administrator/manifests/files/joomla.xml\" file.
Check the official Joomla download page for the right Joomla Upgrade Package." +COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_NO_VERSION_FOUND="The uploaded package file \"%s\" is not a Joomla update package. It does not contain valid version information.
Check the official Joomla download page for the right Joomla Upgrade Package." +COM_JOOMLAUPDATE_VIEW_UPLOAD_ERROR_PACKAGE_OPEN="The uploaded package file \"%s\" is either not a ZIP file or is corrupted.
Check the official Joomla download page for the desired Joomla Upgrade Package in ZIP format." COM_JOOMLAUPDATE_VIEW_UPLOAD_PACKAGE_FILE="Joomla package file" COM_JOOMLAUPDATE_XML_DESCRIPTION="Updates Joomla to the latest version with one click." diff --git a/libraries/src/Event/MultiFactor/BeforeDisplayMethods.php b/libraries/src/Event/MultiFactor/BeforeDisplayMethods.php index e71e0aae718ec..e1b5be9cabdac 100644 --- a/libraries/src/Event/MultiFactor/BeforeDisplayMethods.php +++ b/libraries/src/Event/MultiFactor/BeforeDisplayMethods.php @@ -46,7 +46,7 @@ public function __construct(User $user) * @return User * @since 4.2.0 * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setUser(User $value): User @@ -64,7 +64,7 @@ public function setUser(User $value): User * @param User $value The value to validate * * @return User - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetUser(User $value): User { diff --git a/libraries/src/Event/MultiFactor/Callback.php b/libraries/src/Event/MultiFactor/Callback.php index 94fcd484d2359..89957e6a8c329 100644 --- a/libraries/src/Event/MultiFactor/Callback.php +++ b/libraries/src/Event/MultiFactor/Callback.php @@ -43,7 +43,7 @@ public function __construct(string $method) * @throws \DomainException * @since 4.2.0 * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setMethod(string $value): string @@ -62,7 +62,7 @@ public function setMethod(string $value): string * * @return string * @throws \DomainException - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetMethod(string $value): string { diff --git a/libraries/src/Event/MultiFactor/Captive.php b/libraries/src/Event/MultiFactor/Captive.php index 6619290e8fcbb..dc113a27aaab9 100644 --- a/libraries/src/Event/MultiFactor/Captive.php +++ b/libraries/src/Event/MultiFactor/Captive.php @@ -55,7 +55,7 @@ public function __construct(MfaTable $record) * @return MfaTable * @since 4.2.0 * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setRecord(MfaTable $value): MfaTable @@ -73,7 +73,7 @@ public function setRecord(MfaTable $value): MfaTable * @param MfaTable $value The value to validate * * @return MfaTable - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetRecord(MfaTable $value): MfaTable { diff --git a/libraries/src/Event/MultiFactor/GetSetup.php b/libraries/src/Event/MultiFactor/GetSetup.php index cba0157464f8e..4254f1240cf44 100644 --- a/libraries/src/Event/MultiFactor/GetSetup.php +++ b/libraries/src/Event/MultiFactor/GetSetup.php @@ -55,7 +55,7 @@ public function __construct(MfaTable $record) * @return MfaTable * @since 4.2.0 * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setRecord(MfaTable $value): MfaTable @@ -73,7 +73,7 @@ public function setRecord(MfaTable $value): MfaTable * @param MfaTable $value The value to validate * * @return MfaTable - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetRecord(MfaTable $value): MfaTable { diff --git a/libraries/src/Event/MultiFactor/SaveSetup.php b/libraries/src/Event/MultiFactor/SaveSetup.php index 46f12bcc546ee..a696ebe5eb8d3 100644 --- a/libraries/src/Event/MultiFactor/SaveSetup.php +++ b/libraries/src/Event/MultiFactor/SaveSetup.php @@ -59,7 +59,7 @@ public function __construct(MfaTable $record, Input $input) * @return MfaTable * @since 4.2.0 * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setRecord(MfaTable $value): MfaTable @@ -79,7 +79,7 @@ public function setRecord(MfaTable $value): MfaTable * @return Input * @since 4.2.0 * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setInput(Input $value): Input @@ -97,7 +97,7 @@ public function setInput(Input $value): Input * @param MfaTable $value The value to validate * * @return MfaTable - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetRecord(MfaTable $value): MfaTable { @@ -110,7 +110,7 @@ protected function onSetRecord(MfaTable $value): MfaTable * @param Input $value The value to validate * * @return Input - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetInput(Input $value): Input { diff --git a/libraries/src/Event/MultiFactor/Validate.php b/libraries/src/Event/MultiFactor/Validate.php index 55d1aff6b79cd..7fd77893b59f6 100644 --- a/libraries/src/Event/MultiFactor/Validate.php +++ b/libraries/src/Event/MultiFactor/Validate.php @@ -59,7 +59,7 @@ public function __construct(MfaTable $record, User $user, string $code) * @return MfaTable * @since 4.2.0 * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setRecord(MfaTable $value): MfaTable @@ -79,7 +79,7 @@ public function setRecord(MfaTable $value): MfaTable * @return User * @since 4.2.0 * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setUser(User $value): User @@ -99,7 +99,7 @@ public function setUser(User $value): User * @return string|null * @since 4.2.0 * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setCode(?string $value): ?string @@ -114,7 +114,7 @@ public function setCode(?string $value): ?string * @param MfaTable $value The value to validate * * @return MfaTable - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetRecord(MfaTable $value): MfaTable { @@ -127,7 +127,7 @@ protected function onSetRecord(MfaTable $value): MfaTable * @param User $value The value to validate * * @return User - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetUser(User $value): User { @@ -140,7 +140,7 @@ protected function onSetUser(User $value): User * @param string|null $value The value to validate * * @return string|null - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetCode(?string $value): ?string { diff --git a/libraries/src/Event/QuickIcon/GetIconEvent.php b/libraries/src/Event/QuickIcon/GetIconEvent.php index 6b64e4f3f5728..084d77f6d9c9c 100644 --- a/libraries/src/Event/QuickIcon/GetIconEvent.php +++ b/libraries/src/Event/QuickIcon/GetIconEvent.php @@ -55,7 +55,7 @@ public function __construct(string $name, array $arguments = []) * * @since 4.2.0 * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ public function setContext(string $value) @@ -74,7 +74,7 @@ public function setContext(string $value) * * @return string * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetContext(string $value) { diff --git a/libraries/src/Event/Result/ResultAware.php b/libraries/src/Event/Result/ResultAware.php index c7316adc0807f..66203dd645221 100644 --- a/libraries/src/Event/Result/ResultAware.php +++ b/libraries/src/Event/Result/ResultAware.php @@ -87,7 +87,7 @@ public function addResult($data): void * @return array * @since 4.2.0 * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setResult(array $value) @@ -121,7 +121,7 @@ protected function setResult(array $value) * @param array $value The new result array. * * @return array - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetResult(array $value) { diff --git a/libraries/src/Event/Table/AbstractEvent.php b/libraries/src/Event/Table/AbstractEvent.php index 833f4741cf6e3..f5b43129aad2c 100644 --- a/libraries/src/Event/Table/AbstractEvent.php +++ b/libraries/src/Event/Table/AbstractEvent.php @@ -49,7 +49,7 @@ public function __construct($name, array $arguments = []) * * @throws \BadMethodCallException If the argument is not of the expected type. * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setSubject($value) @@ -70,7 +70,7 @@ protected function setSubject($value) * * @throws \BadMethodCallException If the argument is not of the expected type. * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetSubject($value): TableInterface { diff --git a/libraries/src/Event/Table/AfterLoadEvent.php b/libraries/src/Event/Table/AfterLoadEvent.php index 7365158c32dc0..f2f49f657a33d 100644 --- a/libraries/src/Event/Table/AfterLoadEvent.php +++ b/libraries/src/Event/Table/AfterLoadEvent.php @@ -55,7 +55,7 @@ public function __construct($name, array $arguments = []) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setResult($value) @@ -72,7 +72,7 @@ protected function setResult($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setRow($value) @@ -93,7 +93,7 @@ protected function setRow($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetResult($value) { @@ -109,7 +109,7 @@ protected function onSetResult($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetRow($value) { diff --git a/libraries/src/Event/Table/AfterMoveEvent.php b/libraries/src/Event/Table/AfterMoveEvent.php index 14b2473dfc9ca..a892d6ea35115 100644 --- a/libraries/src/Event/Table/AfterMoveEvent.php +++ b/libraries/src/Event/Table/AfterMoveEvent.php @@ -62,7 +62,7 @@ public function __construct($name, array $arguments = []) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setRow($value) @@ -83,7 +83,7 @@ protected function setRow($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setDelta($value) @@ -104,7 +104,7 @@ protected function setDelta($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setWhere($value) @@ -125,7 +125,7 @@ protected function setWhere($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetRow($value) { @@ -141,7 +141,7 @@ protected function onSetRow($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetDelta($value) { @@ -157,7 +157,7 @@ protected function onSetDelta($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetWhere($value) { diff --git a/libraries/src/Event/Table/AfterReorderEvent.php b/libraries/src/Event/Table/AfterReorderEvent.php index a97d38c9ebb6c..bb845654a0fb5 100644 --- a/libraries/src/Event/Table/AfterReorderEvent.php +++ b/libraries/src/Event/Table/AfterReorderEvent.php @@ -51,7 +51,7 @@ public function __construct($name, array $arguments = []) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setWhere($value) @@ -72,7 +72,7 @@ protected function setWhere($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetWhere($value) { diff --git a/libraries/src/Event/Table/AfterStoreEvent.php b/libraries/src/Event/Table/AfterStoreEvent.php index 4b0ade92ba7df..61942b692fe42 100644 --- a/libraries/src/Event/Table/AfterStoreEvent.php +++ b/libraries/src/Event/Table/AfterStoreEvent.php @@ -50,7 +50,7 @@ public function __construct($name, array $arguments = []) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setResult($value) @@ -67,7 +67,7 @@ protected function setResult($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetResult($value) { diff --git a/libraries/src/Event/Table/BeforeBindEvent.php b/libraries/src/Event/Table/BeforeBindEvent.php index 087f209a9da77..fc0606535303f 100644 --- a/libraries/src/Event/Table/BeforeBindEvent.php +++ b/libraries/src/Event/Table/BeforeBindEvent.php @@ -55,7 +55,7 @@ public function __construct($name, array $arguments = []) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setSrc($value) @@ -76,7 +76,7 @@ protected function setSrc($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setIgnore($value) @@ -97,7 +97,7 @@ protected function setIgnore($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetSrc($value) { @@ -113,7 +113,7 @@ protected function onSetSrc($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetIgnore($value) { diff --git a/libraries/src/Event/Table/BeforeCheckoutEvent.php b/libraries/src/Event/Table/BeforeCheckoutEvent.php index f6ec51933118d..1bd023a278089 100644 --- a/libraries/src/Event/Table/BeforeCheckoutEvent.php +++ b/libraries/src/Event/Table/BeforeCheckoutEvent.php @@ -55,7 +55,7 @@ public function __construct($name, array $arguments = []) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setUserId($value) @@ -76,7 +76,7 @@ protected function setUserId($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetUserId($value) { diff --git a/libraries/src/Event/Table/BeforeLoadEvent.php b/libraries/src/Event/Table/BeforeLoadEvent.php index 00f3a58e8c4e2..b67007d52b854 100644 --- a/libraries/src/Event/Table/BeforeLoadEvent.php +++ b/libraries/src/Event/Table/BeforeLoadEvent.php @@ -53,7 +53,7 @@ public function __construct($name, array $arguments = []) * * @return boolean Normalised value * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setReset($value) @@ -68,7 +68,7 @@ protected function setReset($value) * * @return boolean Normalised value * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetReset($value) { diff --git a/libraries/src/Event/Table/BeforeMoveEvent.php b/libraries/src/Event/Table/BeforeMoveEvent.php index c1938a7947490..2026ad5be8839 100644 --- a/libraries/src/Event/Table/BeforeMoveEvent.php +++ b/libraries/src/Event/Table/BeforeMoveEvent.php @@ -62,7 +62,7 @@ public function __construct($name, array $arguments = []) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setQuery($value) @@ -83,7 +83,7 @@ protected function setQuery($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setDelta($value) @@ -104,7 +104,7 @@ protected function setDelta($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setWhere($value) @@ -125,7 +125,7 @@ protected function setWhere($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetQuery($value) { @@ -141,7 +141,7 @@ protected function onSetQuery($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetDelta($value) { @@ -157,7 +157,7 @@ protected function onSetDelta($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetWhere($value) { diff --git a/libraries/src/Event/Table/BeforePublishEvent.php b/libraries/src/Event/Table/BeforePublishEvent.php index 7fc0d5439b25f..83c21cbeb5871 100644 --- a/libraries/src/Event/Table/BeforePublishEvent.php +++ b/libraries/src/Event/Table/BeforePublishEvent.php @@ -60,7 +60,7 @@ public function __construct($name, array $arguments = []) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setQuery($value) @@ -81,7 +81,7 @@ protected function setQuery($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setState($value) @@ -102,7 +102,7 @@ protected function setState($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setUserId($value) @@ -123,7 +123,7 @@ protected function setUserId($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetQuery($value) { @@ -139,7 +139,7 @@ protected function onSetQuery($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetState($value) { @@ -155,7 +155,7 @@ protected function onSetState($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetUserId($value) { diff --git a/libraries/src/Event/Table/BeforeReorderEvent.php b/libraries/src/Event/Table/BeforeReorderEvent.php index 64cc2cefc7929..ef3b249505fcb 100644 --- a/libraries/src/Event/Table/BeforeReorderEvent.php +++ b/libraries/src/Event/Table/BeforeReorderEvent.php @@ -57,7 +57,7 @@ public function __construct($name, array $arguments = []) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setQuery($value) @@ -78,7 +78,7 @@ protected function setQuery($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setWhere($value) @@ -99,7 +99,7 @@ protected function setWhere($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetQuery($value) { @@ -115,7 +115,7 @@ protected function onSetQuery($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetWhere($value) { diff --git a/libraries/src/Event/Table/BeforeStoreEvent.php b/libraries/src/Event/Table/BeforeStoreEvent.php index 0d0040d4902a8..e53d7fad8362f 100644 --- a/libraries/src/Event/Table/BeforeStoreEvent.php +++ b/libraries/src/Event/Table/BeforeStoreEvent.php @@ -53,7 +53,7 @@ public function __construct($name, array $arguments = []) * * @return boolean Normalised value * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setUpdateNulls($value) @@ -68,7 +68,7 @@ protected function setUpdateNulls($value) * * @return boolean Normalised value * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetUpdateNulls($value) { diff --git a/libraries/src/Event/Table/SetNewTagsEvent.php b/libraries/src/Event/Table/SetNewTagsEvent.php index c986603fa4f58..41e421a09b584 100644 --- a/libraries/src/Event/Table/SetNewTagsEvent.php +++ b/libraries/src/Event/Table/SetNewTagsEvent.php @@ -55,7 +55,7 @@ public function __construct($name, array $arguments = []) * * @return boolean Normalised value * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setReplaceTags($value) @@ -70,7 +70,7 @@ protected function setReplaceTags($value) * * @return boolean Normalised value * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetReplaceTags($value) { diff --git a/libraries/src/Event/WebAsset/WebAssetRegistryAssetChanged.php b/libraries/src/Event/WebAsset/WebAssetRegistryAssetChanged.php index 66de3f14ae4bd..73f591869eb41 100644 --- a/libraries/src/Event/WebAsset/WebAssetRegistryAssetChanged.php +++ b/libraries/src/Event/WebAsset/WebAssetRegistryAssetChanged.php @@ -62,7 +62,7 @@ public function __construct($name, array $arguments = []) * * @since 4.0.0 * - * @deprecated 5.0.0 will be removed in 6.0 + * @deprecated 4.4.0 will be removed in 6.0 * Use counterpart with onSet prefix */ protected function setSubject($value) @@ -83,7 +83,7 @@ protected function setSubject($value) * * @throws \BadMethodCallException if the argument is not of the expected type * - * @since 5.0.0 + * @since 4.4.0 */ protected function onSetSubject($value) { diff --git a/libraries/src/Helper/TagsHelper.php b/libraries/src/Helper/TagsHelper.php index 2f61eee1b61dd..b938b0ca93757 100644 --- a/libraries/src/Helper/TagsHelper.php +++ b/libraries/src/Helper/TagsHelper.php @@ -1115,7 +1115,7 @@ public function unTagItem($contentId, TableInterface $table, $tags = []) * * @return array An array of tag id and name. * - * @since 5.0.0 + * @since 4.4.0 */ public function getTags($tagIds) { diff --git a/libraries/src/Installer/Adapter/FileAdapter.php b/libraries/src/Installer/Adapter/FileAdapter.php index 786e79a436fe5..499b702814760 100644 --- a/libraries/src/Installer/Adapter/FileAdapter.php +++ b/libraries/src/Installer/Adapter/FileAdapter.php @@ -216,7 +216,7 @@ protected function finaliseUninstall(): bool public function getElement($element = null) { if (!$element) { - $manifestPath = Path::clean($this->parent->getPath('manifest')); + $manifestPath = Path::clean($this->parent->getPath('manifest', '')); $element = preg_replace('/\.xml/', '', basename($manifestPath)); } diff --git a/libraries/src/Installer/Adapter/ModuleAdapter.php b/libraries/src/Installer/Adapter/ModuleAdapter.php index d560c2a45cc35..c0e5da3241df4 100644 --- a/libraries/src/Installer/Adapter/ModuleAdapter.php +++ b/libraries/src/Installer/Adapter/ModuleAdapter.php @@ -643,6 +643,7 @@ protected function storeExtension() $module->params = ''; $module->client_id = $this->clientId; $module->language = '*'; + $module->position = ''; $module->store(); } diff --git a/libraries/src/MVC/Model/Exception/ModelExceptionInterface.php b/libraries/src/MVC/Model/Exception/ModelExceptionInterface.php index adcaa6a072382..eefe5227599b7 100644 --- a/libraries/src/MVC/Model/Exception/ModelExceptionInterface.php +++ b/libraries/src/MVC/Model/Exception/ModelExceptionInterface.php @@ -18,7 +18,7 @@ * It is expected that the controller should catch all exceptions that implement this interface and then * make a decision as to whether the exception can be recovered from or not. * - * @since 5.0.0 + * @since 4.4.0 */ interface ModelExceptionInterface extends \Throwable { diff --git a/plugins/sampledata/blog/src/Extension/Blog.php b/plugins/sampledata/blog/src/Extension/Blog.php index 4bc1ef911f2a7..d69062bd0e005 100644 --- a/plugins/sampledata/blog/src/Extension/Blog.php +++ b/plugins/sampledata/blog/src/Extension/Blog.php @@ -799,16 +799,16 @@ public function onAjaxSampledataApplyStep2() $menuTypes = []; for ($i = 0; $i <= 2; $i++) { + $title = $this->getApplication()->getLanguage()->_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_' . $i . '_TITLE'); + $menu = [ 'id' => 0, - 'title' => $this->getApplication()->getLanguage()->_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_' . $i . '_TITLE') . $langSuffix, + 'title' => $title . ' ' . $langSuffix, 'description' => $this->getApplication()->getLanguage()->_('PLG_SAMPLEDATA_BLOG_SAMPLEDATA_MENUS_MENU_' . $i . '_DESCRIPTION'), ]; - // Calculate menutype. The number of characters allowed is 24. - $type = HTMLHelper::_('string.truncate', $menu['title'], 23, true, false); - - $menu['menutype'] = $i . $type; + // Calculate menutype. The maximum number of characters allowed is 24. + $menu['menutype'] = $i . HTMLHelper::_('string.truncate', $title, 16, true, false) . $langSuffix; try { $menuTable->load(); diff --git a/plugins/system/debug/src/DataCollector/SessionCollector.php b/plugins/system/debug/src/DataCollector/SessionCollector.php index 306a18c87d3a6..24c92fcab4dc8 100644 --- a/plugins/system/debug/src/DataCollector/SessionCollector.php +++ b/plugins/system/debug/src/DataCollector/SessionCollector.php @@ -38,7 +38,7 @@ class SessionCollector extends AbstractDataCollector * Collected data. * * @var array - * @since 5.0.0 + * @since 4.4.0 */ protected $sessionData; @@ -48,7 +48,7 @@ class SessionCollector extends AbstractDataCollector * @param Registry $params Parameters. * @param bool $collect Collect the session data. * - * @since 5.0.0 + * @since 4.4.0 */ public function __construct($params, $collect = false) { diff --git a/tests/System/integration/administrator/components/com_users/Users.cy.js b/tests/System/integration/administrator/components/com_users/Users.cy.js index ec846e72a7b44..89eb4853e9caa 100644 --- a/tests/System/integration/administrator/components/com_users/Users.cy.js +++ b/tests/System/integration/administrator/components/com_users/Users.cy.js @@ -33,4 +33,58 @@ describe('Test in backend that the user list', () => { cy.get('#system-message-container').contains('User deleted.').should('exist'); }); }); + + it('can filter state', () => { + cy.db_createUser({ name: 'Test user 1', username: 'test1', block: 0 }) + .then(() => cy.db_createUser({ name: 'Test user 2', username: 'test2', block: 1 })) + .then(() => { + cy.reload(); + + cy.get('#userList') + .should('contain', 'Test user 1') + .should('contain', 'Test user 2'); + + cy.setFilter('state', 'Enabled'); + + cy.get('#userList') + .should('contain', 'Test user 1') + .should('not.contain', 'Test user 2'); + + cy.setFilter('state', 'Disabled'); + + cy.get('#userList') + .should('not.contain', 'Test user 1') + .should('contain', 'Test user 2'); + }); + }); + + it('can filter group', () => { + cy.db_createUser({ name: 'Test user 1', username: 'test1', group_id: 2 }) + .then(() => cy.db_createUser({ name: 'Test user 2', username: 'test2', group_id: 6 })) + .then(() => { + cy.reload(); + + cy.get('#userList') + .should('contain', 'Test user 1') + .should('contain', 'Test user 2'); + + cy.setFilter('group_id', '- Registered'); + + cy.get('#userList') + .should('contain', 'Test user 1') + .should('not.contain', 'Test user 2'); + + cy.setFilter('group_id', '- Manager'); + + cy.get('#userList') + .should('not.contain', 'Test user 1') + .should('contain', 'Test user 2'); + + cy.setFilter('group_id', '- Super Users'); + + cy.get('#userList') + .should('not.contain', 'Test user 1') + .should('not.contain', 'Test user 2'); + }); + }); });