Bug 42053

Summary: Bug 37893 DBUpdate does not always add the new userflags/permissions
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: SIP2Assignee: Kyle M Hall (khall) <kyle>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: kyle
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Crowdfunding committed: 0
Crowdfunding contact: Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 37893    
Bug Blocks:    
Attachments: Bug 42053: Add sip2 to userflags if it doesn't exist

Description Lucas Gass (lukeg) 2026-03-10 15:32:54 UTC
In db_revs/250600035.pl for the SIP2 module there is:

unless ( -f $SIPconfigFile && -r $SIPconfigFile ) { 
            say_warning( $out, "Skipping migration. SIP config file not found or unreadable" );
            return;
        }

and then later:

        $dbh->do(
            q{INSERT IGNORE INTO userflags (bit, flag, flagdesc, defaulton) VALUES (31, 'sip2', 'Manage SIP2 module', 0) }
        );


So the permissions are only added if there is a SIP config. The permissions should be added no matter what.
Comment 1 Kyle M Hall (khall) 2026-03-10 16:14:58 UTC
Created attachment 195089 [details] [review]
Bug 42053: Add sip2 to userflags if it doesn't exist

Bug 37893 only creates the sip2 userflag if the instance has a
SIPConfig.xml set up. This userflag needs to be created reguardless
or the instance will not be able to use SIP in the future!

Test Plan:
1) Ensure you have no SIPConfig.xml
2) Run the bug 37893 update
3) Note the missing userflag
4) Apply this patch
5) Run updatedatabase.pl again
6) Note the userflag exists!