Bug 35467: Rename NewsLog system preference to AdditionalContent

To test:
1 - confirm whether or not NewsLog is enabled on your system
2 - apply patch, updatedatabase, restart_all
3 - search system preferences, confirm you now have
    AdditionalContentLog rather than NewsLog and that the new
    description is accurate
4 - confitm AdditionalContentLog shows the value you previously had for
    NewsLog
5 - go to Tools > Log Viewer
6 - confirm the checkbox here is labeled "Additional Content", that it
    correctly reflects the syspref value, and that it links to the
    syspref
7 - with AdditionalContentLog enabled, created/edit/delete news, HTML
    customizations, and pages. confirm they log
8 - with AdditionalContentLog disabled, created/edit/delete news, HTML
    customizations, and pages. confirm they don't log

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Andrew Fuerste Henry 2025-08-05 13:38:18 +00:00 committed by Lucas Gass
parent 8d2f2f25bf
commit 9805b4cb3e
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
4 changed files with 8 additions and 8 deletions

View File

@ -13,6 +13,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('AcqViewBaskets','user','user|branch|all','Define which baskets a user is allowed to view: their own only, any within their branch, or all','Choice'),
('AcqWarnOnDuplicateInvoice','0','','Warn librarians when they try to create a duplicate invoice','YesNo'),
('ActionLogsTraceDepth', '0', '', 'Sets the maximum depth of the action logs stack trace', 'Integer'),
('AdditionalContentLog','0',NULL,'If ON, log OPAC news changes','YesNo'),
('AdditionalContentsEditor','tinymce','tinymce|codemirror','Choose tool for editing News.', 'Choice'),
('AdditionalFieldsInZ3950ResultAuthSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of an authority Z39.50 search', 'Free'),
('AdditionalFieldsInZ3950ResultSearch', '', NULL, 'Determines which MARC field/subfields are displayed in -Additional field- column in the result of a search Z3950', 'Free'),
@ -432,7 +433,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('minPasswordLength','8',NULL,'Specify the minimum length of a patron/staff password','free'),
('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''),
('NewsAuthorDisplay','none','none|opac|staff|both','Display the author name for news items.','Choice'),
('NewsLog','0',NULL,'If ON, log OPAC news changes','YesNo'),
('noissuescharge','5','','Define maximum amount withstanding before checkouts are blocked','Integer'),
('NoIssuesChargeGuarantees','','','Define maximum amount withstanding before checkouts are blocked','Integer'),
('NoIssuesChargeGuarantorsWithGuarantees','','','Define maximum amount withstanding before checkouts are blocked including guarantors and their other guarantees','Integer'),

View File

@ -35,7 +35,7 @@
[% CASE 'NOTICES' %]
<span>Notices</span>[% UNLESS Koha.Preference('NoticesLog') %]<i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="NoticesLog"></i>[% END %]
[% CASE 'NEWS' %]
<span>News</span>[% UNLESS Koha.Preference('NewsLog') %]<i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="NewsLog"></i>[% END %]
<span>Additional content</span>[% UNLESS Koha.Preference('AdditionalContentLog') %]<i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="AdditionalContentLog"></i>[% END %]
[% CASE 'RECALLS' %]
<span>Recalls</span>[% UNLESS Koha.Preference('RecallsLog') %]<i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="RecallsLog"></i>[% END %]
[% CASE 'SUGGESTION' %]

View File

@ -109,11 +109,11 @@ Logging:
0: "Don't log"
- " changes to notice templates."
-
- pref: NewsLog
- pref: AdditionalContentLog
choices:
1: Log
0: "Don't log"
- " changes to news entries and other contents managed in the news tool."
- " changes to HTML customizations, news entires, pages, and other content managed in the additional content tools."
-
- pref: RecallsLog
choices:

View File

@ -143,7 +143,7 @@ if ( $op eq 'add_form' ) {
my $existing_content = $existing_contents->find($id);
if ($existing_content) {
if ( $existing_content->title ne $title || $existing_content->content ne $content ) {
if ( C4::Context->preference("NewsLog") ) {
if ( C4::Context->preference("AdditionalContentLog") ) {
logaction(
'NEWS', 'MODIFY', undef,
sprintf( "%s|%s|%s|%s", $code, $title, $lang, $content )
@ -152,14 +152,14 @@ if ( $op eq 'add_form' ) {
} else {
$translated_content->{updated_on} = $existing_content->updated_on;
}
} elsif ( C4::Context->preference("NewsLog") ) {
} elsif ( C4::Context->preference("AdditionalContentLog") ) {
logaction( 'NEWS', 'ADD', undef, sprintf( "%s|%s|%s|%s", $code, $title, $lang, $content ) );
}
push @translated_contents, $translated_content;
}
if ( C4::Context->preference("NewsLog") ) {
if ( C4::Context->preference("AdditionalContentLog") ) {
my @existing_ids = $existing_contents->get_column('id');
my @deleted_ids = array_minus( @existing_ids, @seen_ids );
for my $id (@deleted_ids) {
@ -197,7 +197,7 @@ if ( $op eq 'add_form' ) {
sub {
my $contents = Koha::AdditionalContents->search( { id => \@ids } );
if ( C4::Context->preference("NewsLog") ) {
if ( C4::Context->preference("AdditionalContentLog") ) {
while ( my $c = $contents->next ) {
my $translated_contents = $c->translated_contents;
while ( my $translated_content = $translated_contents->next ) {