We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PR w związku ze zmianą oryginału joomla/joomla-cms#36191 Poniżej zmiany w oryginale:
diff --git a/administrator/language/en-GB/lib_joomla.ini b/administrator/language/en-GB/lib_joomla.ini index 5f718b1de0c1..4cebf64ed4ef 100644 --- a/administrator/language/en-GB/lib_joomla.ini +++ b/administrator/language/en-GB/lib_joomla.ini @@ -630,6 +630,7 @@ JLIB_INSTALLER_ERROR_TPL_REFRESH_MANIFEST_CACHE="Template Refresh manifest cache JLIB_INSTALLER_ERROR_TPL_UNINSTALL_ERRORUNKOWNEXTENSION="Template Uninstall: Unknown Extension." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_INVALID_CLIENT="Template Uninstall: Invalid client." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Template Uninstall: Manifest file invalid or not found." +JLIB_INSTALLER_ERROR_TPL_UNINSTALL_PARENT_TEMPLATE="Template Uninstall: Can't remove parent template. Please remove all children templates first." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_DEFAULT="Template Uninstall: Can't remove default template." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_DIRECTORY="Template Uninstall: Folder does not exist, can't remove files." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_ID_EMPTY="Template Uninstall: Template ID is empty, can't uninstall files." diff --git a/language/en-GB/lib_joomla.ini b/language/en-GB/lib_joomla.ini index ef9676294b32..8cee7dc26824 100644 --- a/language/en-GB/lib_joomla.ini +++ b/language/en-GB/lib_joomla.ini @@ -629,6 +629,7 @@ JLIB_INSTALLER_ERROR_TPL_REFRESH_MANIFEST_CACHE="Template Refresh manifest cache JLIB_INSTALLER_ERROR_TPL_UNINSTALL_ERRORUNKOWNEXTENSION="Template Uninstall: Unknown Extension." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_INVALID_CLIENT="Template Uninstall: Invalid client." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_INVALID_NOTFOUND_MANIFEST="Template Uninstall: Manifest file invalid or not found." +JLIB_INSTALLER_ERROR_TPL_UNINSTALL_PARENT_TEMPLATE="Template Uninstall: Can't remove parent template. Please remove all children templates first." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_DEFAULT="Template Uninstall: Can't remove default template." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_DIRECTORY="Template Uninstall: Folder does not exist, can't remove files." JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_ID_EMPTY="Template Uninstall: Template ID is empty, can't uninstall files." diff --git a/libraries/src/Installer/Adapter/TemplateAdapter.php b/libraries/src/Installer/Adapter/TemplateAdapter.php index ddda178f9228..5ca13ddf5419 100644 --- a/libraries/src/Installer/Adapter/TemplateAdapter.php +++ b/libraries/src/Installer/Adapter/TemplateAdapter.php @@ -464,6 +464,7 @@ protected function setupUninstall() { $this->parent->extension = $this->extension; + $db = $this->parent->getDbo(); $name = $this->extension->element; $clientId = $this->extension->client_id; @@ -473,8 +474,26 @@ protected function setupUninstall() throw new \RuntimeException(Text::_('JLIB_INSTALLER_ERROR_TPL_UNINSTALL_TEMPLATE_ID_EMPTY')); } + // Deny removing a parent template if there are children + $query = $db->getQuery(true) + ->select('COUNT(*)') + ->from($db->quoteName('#__template_styles')) + ->where( + [ + $db->quoteName('parent') . ' = :template', + $db->quoteName('client_id') . ' = :client_id', + ] + ) + ->bind(':template', $name) + ->bind(':client_id', $clientId); + $db->setQuery($query); + + if ($db->loadResult() != 0) + { + throw new \RuntimeException(Text::_('JLIB_INSTALLER_ERROR_TPL_UNINSTALL_PARENT_TEMPLATE')); + } + // Deny remove default template - $db = $this->parent->getDbo(); $query = $db->getQuery(true) ->select('COUNT(*)') ->from($db->quoteName('#__template_styles'))
The text was updated successfully, but these errors were encountered:
5bdfbfd
wojsmol
zwiastunsw
No branches or pull requests
PR w związku ze zmianą oryginału joomla/joomla-cms#36191 Poniżej zmiany w oryginale:
Click to expand the diff!
The text was updated successfully, but these errors were encountered: