Bug 42053 - Bug 37893 DBUpdate does not always add the new userflags/permissions
Summary: Bug 37893 DBUpdate does not always add the new userflags/permissions
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Kyle M Hall (khall)
QA Contact: Testopia
URL:
Keywords:
Depends on: 37893
Blocks:
  Show dependency treegraph
 
Reported: 2026-03-10 15:32 UTC by Lucas Gass (lukeg)
Modified: 2026-03-10 16:14 UTC (History)
1 user (show)

See Also:
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:


Attachments
Bug 42053: Add sip2 to userflags if it doesn't exist (1.57 KB, patch)
2026-03-10 16:14 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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!