https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40850

            Bug ID: 40850
           Summary: Add `Koha::ILL::Request->add_or_update_attributes`
 Change sponsored?: ---
           Product: Koha
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: ILL
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
                CC: [email protected],
                    [email protected], [email protected]

Currently, ILL backends and plugins must implement custom logic to update
existing extended attributes on ILL requests, as the core extended_attributes()
method only supports adding new attributes and throws duplicate key errors when
attempting to update existing ones. This has led to code duplication across
multiple ILL plugins (Rapido, INNReach, SLNP) that all implement identical
add_or_update_attributes() methods, and forces the Standard backend to use
error-prone patterns when managing request metadata.

The proposed `add_or_update_attributes()` method in Koha::ILL::Request would
provide a safe, efficient way to add new attributes or update existing ones in
a single operation, eliminating duplicate key errors and reducing code
duplication. 

This enhancement would immediately benefit the Standard backend (which
currently as 6+ locations using the problematic pattern), allow existing
plugins to remove their custom implementations, improve performance by only
updating attributes when values actually change, and provide a cleaner API for
all ILL backend developers. The implementation follows proven patterns already
tested in production plugins an d maintains full backward compatibility while
solving a common pain point in ILL development.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to