Skip to content

Commit

Permalink
Merge remote-tracking branch 'nickvergessen/ticket/11911' into develop
Browse files Browse the repository at this point in the history
# By Joas Schilling
# Via Joas Schilling
* nickvergessen/ticket/11911:
  [ticket/11911] Warn admins when there is no search index for the selected engine
  • Loading branch information
dhruvgoel92 committed Dec 27, 2013
2 parents f9c7f0f + bef7bc7 commit db94f80
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
6 changes: 6 additions & 0 deletions phpBB/adm/style/acp_main.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ <h1>{L_WELCOME_PHPBB}</h1>
</div>
<!-- ENDIF -->

<!-- IF S_SEARCH_INDEX_MISSING -->
<div class="errorbox">
<h3>{L_WARNING}</h3>
<p>{L_NO_SEARCH_INDEX}</p>
</div>
<!-- ENDIF -->

<!-- IF S_REMOVE_INSTALL -->
<div class="errorbox">
Expand Down
16 changes: 16 additions & 0 deletions phpBB/includes/acp/acp_main.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,22 @@ function main($id, $mode)
$template->assign_var('S_REMOVE_INSTALL', true);
}

// Warn if no search index is created
if ($config['num_posts'] && class_exists($config['search_type']))
{
$error = false;
$search_type = $config['search_type'];
$search = new $search_type($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user);

if (!$search->index_created())
{
$template->assign_vars(array(
'S_SEARCH_INDEX_MISSING' => true,
'L_NO_SEARCH_INDEX' => $user->lang('NO_SEARCH_INDEX', $search->get_name(), '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=acp_search&amp;mode=index') . '">', '</a>'),
));
}
}

if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx))
{
// World-Writable? (000x)
Expand Down
1 change: 1 addition & 0 deletions phpBB/language/en/acp/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@

'GZIP_COMPRESSION' => 'GZip compression',

'NO_SEARCH_INDEX' => 'The selected search backend does not have a search index.<br >Please create the index for “%1$s” in the %2$ssearch index%3$s section.',
'NOT_AVAILABLE' => 'Not available',
'NUMBER_FILES' => 'Number of attachments',
'NUMBER_POSTS' => 'Number of posts',
Expand Down

0 comments on commit db94f80

Please sign in to comment.