diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html
index 81c24fe98a..3ce3b23ac1 100644
--- a/phpBB/adm/style/acp_styles.html
+++ b/phpBB/adm/style/acp_styles.html
@@ -127,7 +127,7 @@
{styles_list.COMMENT}
-
+
{L_STYLE_PATH}{L_COLON} {styles_list.STYLE_PATH_FULL}
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 6f83b4ce51..a157d283b0 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -711,6 +711,12 @@ class acp_styles
// Show styles
foreach ($styles as &$style)
{
+ if (!$style['_available'] && !empty($style['_invalid']))
+ {
+ $this->list_invalid($style);
+ continue;
+ }
+
// Check if style has a parent style in styles list
$has_parent = false;
if ($style['_inherit_name'] != '')
@@ -795,6 +801,13 @@ class acp_styles
catch (\DomainException $e)
{
// Invalid composer.json
+ $style = array(
+ '_available' => false,
+ '_invalid' => true,
+ 'style_path' => $dir,
+ );
+ $styles[] = $style;
+
continue;
}
@@ -1076,6 +1089,42 @@ class acp_styles
$this->style_counters['total']++;
}
+ /**
+ * List invalid style
+ *
+ * @param array $style Array with info about style to display as invalid
+ */
+ protected function list_invalid(&$style)
+ {
+ $style['_shown'] = true;
+
+ $row = array(
+ // Style data
+ 'STYLE_INVALID' => true,
+ 'STYLE_NAME' => $this->user->lang('INVALID_STYLE_MESSAGE', $style['style_path']),
+ );
+
+ $this->template->assign_block_vars('styles_list', $row);
+
+ $this->template->assign_block_vars('styles_list.actions', array(
+ 'HTML' => $this->user->lang['CANNOT_BE_INSTALLED']
+ ));
+
+ // Increase counters
+ if (!isset($this->style_counters))
+ {
+ $this->style_counters = array(
+ 'total' => 0,
+ 'active' => 0,
+ 'inactive' => 0,
+ 'caninstall' => 0,
+ 'cannotinstall' => 0
+ );
+ }
+ $this->style_counters['cannotinstall']++;
+ $this->style_counters['total']++;
+ }
+
/**
* Show welcome message
*
diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php
index 44be3c11cd..0adc95f3dc 100644
--- a/phpBB/language/en/acp/styles.php
+++ b/phpBB/language/en/acp/styles.php
@@ -54,6 +54,7 @@ $lang = array_merge($lang, [
'INSTALL_STYLES' => 'Install styles',
'INSTALL_STYLES_EXPLAIN' => 'Here you can install new styles.
If you cannot find a specific style in list below, check to make sure style is already installed. If it is not installed, check if it was uploaded correctly.',
'INVALID_STYLE_ID' => 'Invalid style ID.',
+ 'INVALID_STYLE_MESSAGE' => 'The directory %1$s does not contain a valid style.',
'NO_MATCHING_STYLES_FOUND' => 'No styles match your query.',
'NO_UNINSTALLED_STYLE' => 'No uninstalled styles detected.',