Skip to content

Commit

Permalink
Merge 2da33f0 into 81c5530
Browse files Browse the repository at this point in the history
  • Loading branch information
Dark1z committed Apr 27, 2022
2 parents 81c5530 + 2da33f0 commit fcb51bc
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "phpbb-extension",
"description": "Reduce Search Index [RSI]",
"homepage": "https://phpbb.com/customise/db/extension/reduce_search_index",
"version": "1.1.0",
"version": "1.1.1",
"time": "2022-01-23",
"keywords": [
"phpbb",
Expand Down
11 changes: 8 additions & 3 deletions controller/acp_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,21 @@ protected function check_form_on_submit()
* Success Form On Submit.
* Used to Log & Trigger Success Err0r.
*
* @param string $lang_key Lang Key
* @param string $lang_str Lang String
*
* @return void
* @access protected
*/
protected function success_form_on_submit()
protected function success_form_on_submit($lang_key = 'ACP_RSI_LOG_SET_SAV', $lang_str = null)
{
$lang_str = !isset($lang_str) ? $this->language->lang('ACP_RSI_' . strtoupper($this->mode)) : $lang_str;

// Add option settings change action to the admin log
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, 'ACP_RSI_LOG_SET_SAV', time(), [$this->language->lang('ACP_RSI_' . strtoupper($this->mode))]);
$this->log->add('admin', $this->user->data['user_id'], $this->user->ip, $lang_key, time(), [$lang_str]);

// Option settings have been updated and logged
// Confirm this to the user and provide link back to previous page
trigger_error($this->language->lang('ACP_RSI_LOG_SET_SAV', $this->language->lang('ACP_RSI_' . strtoupper($this->mode))) . adm_back_link($this->u_action), E_USER_NOTICE);
trigger_error($this->language->lang($lang_key, $lang_str) . adm_back_link($this->u_action), E_USER_NOTICE);
}
}
2 changes: 1 addition & 1 deletion controller/acp_cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function handle()
$cron_task = $this->cron_manager->find_task('dark1.reducesearchindex.cron.auto_reduce_sync');
$cron_task->run();

$this->success_form_on_submit();
$this->success_form_on_submit('ACP_RSI_LOG_CRON', '');
}

// Set output variables for display in the template
Expand Down
2 changes: 1 addition & 1 deletion cron/auto_reduce_sync.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private function reduce_search_index($post_ids, $poster_ids, $forum_ids)
if ($name == 'fulltext_native' && class_exists($search) && count($post_ids) > 0)
{
/** @var fulltext_native */
$search = new $search(false, $this->phpbb_root_path, $this->php_ext, $this->auth, $this->config, $this->db, $this->user, $this->phpbb_dispatcher);
$search = new $search($error = false, $this->phpbb_root_path, $this->php_ext, $this->auth, $this->config, $this->db, $this->user, $this->phpbb_dispatcher);

$post_ids = array_chunk($post_ids, 50, true);
foreach ($post_ids as $post_ids_chunk)
Expand Down
1 change: 1 addition & 0 deletions language/en/info_acp_rsi.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@

// phpBB Log
'ACP_RSI_LOG_SET_SAV' => '<strong>Reduce Search Index [RSI]</strong><br>» %s saved successfully!',
'ACP_RSI_LOG_CRON' => '<strong>Reduce Search Index [RSI]</strong><br>» Cron ran successfully!%s',
'RSI_AUTO_LOG' => '<strong>Reduce Search Index [RSI]</strong><br>» Auto Reduce Updater completed.<br>» Search Restricted for Last “%1$s” Day(s) from “%2$s”',

// ACP Modes
Expand Down

0 comments on commit fcb51bc

Please sign in to comment.