From 88fa65e6f35f2628ffff5b818f73d77db16db488 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. --- C4/UsageStats.pm | 68 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/C4/UsageStats.pm b/C4/UsageStats.pm index 37b4a76ec4f..df95f4eb7b1 100644 --- a/C4/UsageStats.pm +++ b/C4/UsageStats.pm @@ -91,6 +91,15 @@ sub BuildReport { { $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; } @@ -369,6 +378,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.39.5