Bug 39720 - Search for system preferences call errors
Summary: Search for system preferences call errors
Status: ASSIGNED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Fridolin Somers
QA Contact: Testopia
URL:
Keywords:
Depends on: 39733 39734 39735 39736 39737 39738 39745 39746 39747
Blocks:
  Show dependency treegraph
 
Reported: 2025-04-24 08:46 UTC by Fridolin Somers
Modified: 2025-04-25 09:49 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fridolin Somers 2025-04-24 08:46:39 UTC
Since Bug 38772 found a typo in system preference 'minPasswordPreference' call, we could try to grep any call to compare with system preferences file.
Comment 1 Fridolin Somers 2025-04-24 08:57:13 UTC
git grep can not exclude so I use grep directly :
We need not exclude test suite and installer (updatedatabase.pl and dbrevs)

grep -r --exclude-dir=.git --exclude-dir=t --exclude-dir=installer -o 'C4::Context->preference(.*)' | awk -F 'preference\(|\)' '{print $2}' | tr -d '"' | tr -d "'" | tr -d ' ' | sort -u | grep -v '^\$' | tee patches/sysprefs_calls.txt

Then :
for i in $(cat patches/sysprefs_calls.txt); do echo "### $i" ; grep -i -c "'$i'" installer/data/mysql/mandatory/sysprefs.sql ; done | grep -B1 ^0 | grep ^#
### ($interfaceeqopac
### automatic_item_modification_by_age_configuration
### delimiter
### IntranetmainUserblock
### marcflavour
### MarcFlavour
### MARCFLAVOUR
### OPACFineNoRenewalsIncludeCredit
### OPACResultsSidebar
### PatronSelfRegistrationAdditionalInstructions
### PREF_008
### preference
### SelfCheckHelpMessage
### some_variable
### version
### Version

Those are normal cases :
automatic_item_modification_by_age_configuration
MarcFlavour
version
some_variable/preference => commes from POD ;)
PREF_008 => Is a constant for "MARCAuthorityControlField008"

So :
for i in $(cat patches/sysprefs_missing.txt); do echo "## $i"; git grep "C4::Context->preference(.$i"  ; echo ; done

## delimiter
misc/cronjobs/staticfines.pl:    $delim           = "\t";    # ?  C4::Context->preference('delimiter') || "\t";

## IntranetmainUserblock
C4/Auth.pm:            IntranetmainUserblock         => C4::Context->preference("IntranetmainUserblock"),

## OPACFineNoRenewalsIncludeCredit
C4/Circulation.pm:            C4::Context->preference("OPACFineNoRenewalsIncludeCredit")
opac/opac-user.pl:    C4::Context->preference("OPACFineNoRenewalsIncludeCredit")

## OPACResultsSidebar
opac/opac-search.pl:$template->param( OPACResultsSidebar => C4::Context->preference('OPACResultsSidebar') );

## PatronSelfRegistrationAdditionalInstructions
opac/opac-memberentry.pl:                    C4::Context->preference('PatronSelfRegistrationAdditionalInstructions') );
opac/opac-registration-verify.pl:                C4::Context->preference('PatronSelfRegistrationAdditionalInstructions') );

## SelfCheckHelpMessage
opac/sco/help.pl:if ( C4::Context->preference('SelfCheckHelpMessage') ) {
opac/sco/help.pl:    $template->param( SelfCheckHelpMessage => C4::Context->preference('SelfCheckHelpMessage') );
Comment 2 Fridolin Somers 2025-04-24 09:06:00 UTC
I will create new bug reports for each :

### delimiter :

In misc/cronjobs/staticfines.pl :
Bug 27486 renamed "delimiter" into "CSVDelimiter"
=> Patch to fix

### IntranetmainUserblock :

Bug 35153 moved to additional contents.
=> Patch to remove call

### OPACFineNoRenewalsIncludeCredit

A typo : 
installer/data/mysql/mandatory/sysprefs.sql:('OPACFineNoRenewalsIncludeCredits','1',NULL,'If enabled the value specified in OPACFineNoRenewals should include any unapplied account credits in the calculation','YesNo'),
=> Patch to fix calls (ending 's')

### OPACResultsSidebar
Bug 34869 moved additional contents.
=> Patch to remove call

### PatronSelfRegistrationAdditionalInstructions
Bug 34889 moved to additional contents.
=> Patch to remove call

### SelfCheckHelpMessage
Bug 35065 moved to additional contents.
=> Patch to remove call

So some catches, maybe missed some of them ;)
Comment 3 Fridolin Somers 2025-04-24 09:45:38 UTC
We may grep in test suite and in templates
Comment 4 Fridolin Somers 2025-04-25 08:54:02 UTC
Searching in t/ gives :

### IDoNotExist
### marcflavour
### MARCFlavour
### SillyPreference
### testpreference
### TestPreference
### Version

marcflavour => OK
Version => OK

Other are normal cases of test suite playing with false preferences ;)
Comment 5 Fridolin Somers 2025-04-25 09:01:01 UTC
Searching t/ for C4::Context->set_preference(

### IDoNotExist
### language
### OPACFineNoRenewalsIncludeCredit
### SillyPreference
### testpreference
### TestPreference

language
=> Bug 27490 changed to "StaffInterfaceLanguages"

OPACFineNoRenewalsIncludeCredit
=> already fixed by Bug 39735

Other are normal cases of test suite
Comment 6 Fridolin Somers 2025-04-25 09:49:15 UTC
Searching t/ for mock_preference(

### AutoLocation
### DefaultHoldExpirationUnitOfTime
### language
### marcflavour
### MultiValuedSyspref
### Version

AutoLocation
=> renamed by Bug 26176
Opened Bug 39746

DefaultHoldExpirationUnitOfTime
=> 
Correct pref is DefaultHoldExpiration[date]UnitOfTime
Opened Bug 39747

language
=> Added to Bug 39745

MultiValuedSyspref
=> No problem, its test suite playing ;)

Other are OK