Skip to content

Commit

Permalink
Bug 6874: (QA followup) Warnings in about page
Browse files Browse the repository at this point in the history
This patch introduces checks on the about.pl page so the user is warned
for a deficient configuration.

Signed-off-by: Tomas Cohen Arazi <[email protected]>
  • Loading branch information
tomascohen committed Aug 11, 2015
1 parent 7f797b3 commit cef2dd1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions about.pl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
use C4::Installer;

use Koha;
use Koha::Config::SysPrefs;

#use Smart::Comments '####';

Expand Down Expand Up @@ -157,6 +158,19 @@
}
}

if ( ! defined C4::Context->config('upload_path') ) {
if ( Koha::Config::SysPrefs->find('OPACBaseURL')->value ) {
# OPACBaseURL seems to be set
push @xml_config_warnings, {
error => 'uploadpath_entry_missing'
}
} else {
push @xml_config_warnings, {
error => 'uploadpath_and_opacbaseurl_entry_missing'
}
}
}

# Test QueryParser configuration sanity
if ( C4::Context->preference( 'UseQueryParser' ) ) {
# Get the QueryParser configuration file name
Expand Down
15 changes: 15 additions & 0 deletions koha-tmpl/intranet-tmpl/prog/en/modules/about.tt
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,21 @@
add it, pointing to the log4perl.conf file for your Koha instance.
</td>
</tr>
[% ELSIF config_entry.error == 'uploadpath_entry_missing' %]
<tr>
<th scope="row"><b>Warning</b></th>
<td>You are missing the <strong>&lt;upload_path&gt;</strong> entry in your koha-conf.xml file. Please
add it, pointing to the configured file upload directory for your Koha instance.
</td>
</tr>
[% ELSIF config_entry.error == 'uploadpath_and_opacbaseurl_entry_missing' %]
<tr>
<th scope="row"><b>Warning</b></th>
<td>You are missing the <strong>&lt;upload_path&gt;</strong> entry in your koha-conf.xml file. Please
add it, pointing to the configured file upload directory for your Koha instance.
Also note that you need to properly set the <strong>OPACBaseURL</strong> preference for the file upload plugin to work.
</td>
</tr>
[% END %]
[% END %]
</table>
Expand Down

0 comments on commit cef2dd1

Please sign in to comment.