Skip to content
New issue

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

[3.10] Add a check whether we are running the core backend template and issue an info when that is not the case #35107

Merged
merged 36 commits into from Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9b4df26
add a check whether we are running the core tempaltes where the backe…
zero-24 Aug 12, 2021
33a0aed
some more updates
zero-24 Aug 12, 2021
d217552
move to the "recommended box"
zero-24 Aug 12, 2021
52fbec2
update title
zero-24 Aug 12, 2021
164496e
update two more strings
zero-24 Aug 12, 2021
b218e37
Apply suggestions from code review
zero-24 Aug 12, 2021
4509aac
alpha sort
zero-24 Aug 12, 2021
615613d
add hathor and beez3
zero-24 Aug 12, 2021
395ef02
Merge branch 'template_check' of github.com:zero-24/joomla-cms into t…
zero-24 Aug 12, 2021
0932803
Update administrator/components/com_joomlaupdate/models/default.php
zero-24 Aug 13, 2021
ddb59e7
only do backend template use the proposed message
zero-24 Aug 13, 2021
aafbe76
Merge branch 'template_check' of github.com:zero-24/joomla-cms into t…
zero-24 Aug 13, 2021
f6d1418
Merge branch '3.10-dev' of github.com:joomla/joomla-cms into template…
zero-24 Aug 13, 2021
dceb52f
remove frontend check and move backend check down the line
zero-24 Aug 13, 2021
30842d1
make drone happy
zero-24 Aug 13, 2021
7b43049
move it to a top message only
zero-24 Aug 13, 2021
2f3a76a
Merge branch 'template_check' of github.com:zero-24/joomla-cms into t…
zero-24 Aug 13, 2021
984aa76
that should not be here
zero-24 Aug 13, 2021
d541818
move variable
zero-24 Aug 13, 2021
60c45a1
add link to styles as requested
zero-24 Aug 13, 2021
0c54f14
force it to show the admin styles
zero-24 Aug 13, 2021
69f9079
Update administrator/components/com_joomlaupdate/models/default.php
zero-24 Aug 13, 2021
d61f300
Update administrator/components/com_joomlaupdate/models/default.php
zero-24 Aug 13, 2021
0fe1bfe
Apply suggestions from code review
zero-24 Aug 13, 2021
b3d71fd
Update administrator/components/com_joomlaupdate/views/default/view.h…
zero-24 Aug 13, 2021
7cdb22a
Merge branch '3.10-dev' into template_check
zero-24 Aug 13, 2021
cef6299
Update administrator/components/com_joomlaupdate/models/default.php
zero-24 Aug 19, 2021
ee5f356
Merge branch '3.10-dev' into template_check
zero-24 Aug 20, 2021
c6e7cb7
Update administrator/language/en-GB/en-GB.com_joomlaupdate.ini
zero-24 Sep 3, 2021
ad7b419
Merge branch '3.10-dev' into template_check
zero-24 Sep 3, 2021
67f5005
i hate you php 5.3...
zero-24 Sep 11, 2021
5a5d328
Merge branch '3.10-dev' into template_check
zero-24 Sep 11, 2021
b5b42f1
remove additional tabs
zero-24 Sep 11, 2021
6099129
Merge branch '3.10-dev' into template_check
zero-24 Sep 19, 2021
f961339
Merge branch '3.10-dev' into template_check
zero-24 Nov 21, 2021
939a86e
Merge branch '3.10-dev' into template_check
zero-24 Nov 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
59 changes: 59 additions & 0 deletions administrator/components/com_joomlaupdate/models/default.php
Expand Up @@ -1791,4 +1791,63 @@ protected function translateExtensionName(&$item)
// Translate the extension name if possible
$item->name = strip_tags(JText::_($item->name));
}

/**
* Checks whether a given template is active
*
* @param string $template The template name to be checked
*
* @return bool
zero-24 marked this conversation as resolved.
Show resolved Hide resolved
*
* @since __DEPLOY_VERSION__
*/
public function isTemplateActive($template)
{
$db = $this->getDbo();
$query = $db->getQuery(true);

$query->select(
$db->qn(
array(
'id',
'home'
)
)
)->from(
$db->qn('#__template_styles')
)->where(
$db->qn('template') . ' = ' . $db->q($template)
);

$templates = $db->setQuery($query)->loadObjectList();

$home = array_filter(
$templates,
function($value)
{
return $value->home > 0;
}
);

$ids = JArrayHelper::getColumn($templates, 'id');

$menu = false;

if (count($ids))
{
$query = $db->getQuery(true);

$query->select(
'COUNT(*)'
)->from(
$db->qn('#__menu')
)->where(
$db->qn('template_style_id') . ' IN(' . implode(',', $ids) . ')'
);

$menu = $db->setQuery($query)->loadResult() > 0;
}

return $home || $menu;
}
}
Expand Up @@ -44,6 +44,16 @@
)
);

if (version_compare($this->updateInfo['latest'], '4', '>=') && $this->isBackendTemplateIsis === false)
{
JFactory::getApplication()->enqueueMessage(
JText::_(
'COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_BACKEND_TEMPLATE_USED_NOTICE',
),
'info'
);
}

?>
<h2>
<?php echo JText::sprintf('COM_JOOMLAUPDATE_VIEW_DEFAULT_PREUPDATE_CHECK', $this->updateInfo['latest']); ?>
Expand Down
Expand Up @@ -102,6 +102,7 @@ public function display($tpl = null)
$this->phpSettings = $model->getPhpSettings();
$this->nonCoreExtensions = $model->getNonCoreExtensions();
$this->nonCoreCriticalPlugins = $model->getNonCorePlugins(array('system','user','authentication','actionlog','twofactorauth'));
$this->isBackendTemplateIsis = (bool) $this->getModel()->isTemplateActive('isis');
zero-24 marked this conversation as resolved.
Show resolved Hide resolved

// Set the toolbar information.
JToolbarHelper::title(JText::_('COM_JOOMLAUPDATE_OVERVIEW'), 'loop install');
Expand Down
1 change: 1 addition & 0 deletions administrator/language/en-GB/en-GB.com_joomlaupdate.ini
Expand Up @@ -79,6 +79,7 @@ COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_WARNING_UNKNOWN="Unkown error"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSION_SERVER_ERROR="Update Server error"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS="Extensions Pre-Update Check"
COM_JOOMLAUPDATE_VIEW_DEFAULT_EXTENSIONS_NONE="No extensions installed."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_BACKEND_TEMPLATE_USED_NOTICE="We detected that you are not using a core admin template. You might find the upgrade process smoother if you <a href="_QQ_"index.php?option=com_templates&view=styles&client_id=1"_QQ_">switch</a> to use the Isis template."
zero-24 marked this conversation as resolved.
Show resolved Hide resolved
COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_PLUGIN_BEING_CHECKED="The system is currently checking these plugins to see if they could cause problems during the upgrade.<br><br>Please be patient while the checks are completed."
COM_JOOMLAUPDATE_VIEW_DEFAULT_NON_CORE_PLUGIN_CONFIRMATION="Do you wish to ignore the warnings about potentially incompatible plugins and to proceed with the upgrade?"
COM_JOOMLAUPDATE_VIEW_DEFAULT_POTENTIALLY_DANGEROUS_PLUGIN="Potential Upgrade Issue"
Expand Down