From abb9ae472a232d9bca806ed4879ca1bad88d2170 Mon Sep 17 00:00:00 2001 From: Arthur Suzuki Date: Wed, 15 Jan 2025 16:20:23 +0100 Subject: [PATCH] Bug 23898: Share new data to HEA Test plan : Apply test patch prove t/db_dependent/UsageStats.t -> fail apply patch prove t/db_dependent/UsageStats.t -> green After patch is applied to a production environment with HEA sharing enabled, more data will be shared to the community. Those data will help us clean some unused functionnality or debug some rare case where systempreferences configuration might be broken. Signed-off-by: Victor Grousset/tuxayo --- C4/UsageStats.pm | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index 4492080c09..7399e3eba3 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -78,6 +78,15 @@ sub BuildReport { foreach ( @{ _shared_preferences() } ) { $report->{systempreferences}{$_} = C4::Context->preference($_); } + + # Get private systempreferences and set "Used" or "Empty" + foreach ( @{ _shared_private_preferences() } ) { + if ( C4::Context->preference($_) ) { + $report->{systempreferences}{$_} = "Used"; + next; + } + $report->{systempreferences}{$_} = "Empty"; + } return $report; } @@ -356,6 +365,65 @@ sub _shared_preferences { return \@preferences; } +=head2 _shared_private_preferences + + my $preferences = C4::UsageStats::_shared_private_preferences + +Returns an I with the system preferences to be shared without their values. + +=cut + +sub _shared_private_preferences { + + my @preferences = qw/ + AmazonAssocTag + CoceHost + CookieConsentedJS + IntranetCirculationHomeHTML + intranetcolorstylesheet + IntranetFavicon + IntranetmainUserblock + IntranetNav + IntranetReportsHomeHTML + IntranetSlipPrinterJS + intranetstylesheet + IntranetUserCSS + IntranetUserJS + OpacAdditionalStylesheet + OpacCustomSearch + OPACHoldsIfAvailableAtPickupExceptions + opaclayoutstylesheet + OpacLoginInstructions + OPACLoginLabelTextContent + OpacMainUserBlock + OpacMetaRobots + OpacMoreSearches + OPACMySummaryHTML + OPACNoResultsFound + OPACnumSearchResultsDropdown + OPACOpenURLItemTypes + OPACOverDrive + OPACResultsLibrary + OPACResultsSidebar + OPACSearchForTitleIn + OPACUserCSS + OPACUserJS + ProcessingFeeNote + RestrictedPageContent + RoutingListNote + SCOUserCSS + SCOUserJS + SelfCheckInUserCSS + SelfCheckInUserJS + SlipCSS + SpineLabelFormat + XSLTDetailsDisplay + z3950Status + /; + + return \@preferences; +} + =head2 _count $data = _count($table); -- 2.52.0