Bug 26651 - Add Koha::Object->reset_messages
Summary: Add Koha::Object->reset_messages
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Testopia
URL:
Keywords:
: 26650 (view as bug list)
Depends on: 26555
Blocks:
  Show dependency treegraph
 
Reported: 2020-10-09 17:42 UTC by Tomás Cohen Arazi
Modified: 2022-12-12 21:23 UTC (History)
4 users (show)

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


Attachments
Bug 26651: Add ->reset_messages (2.61 KB, patch)
2020-10-09 17:48 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2020-10-09 17:42:53 UTC
This method was originally introduced as part of bug 26555. But it was not clear if it was required, or even if some more complex mechanism for marking 'seen' messages is required.

I'm leaving this specific patch here for discussing it once someone finds a real need for it.
Comment 1 Tomás Cohen Arazi 2020-10-09 17:48:32 UTC
Created attachment 111425 [details] [review]
Bug 26651: Add ->reset_messages

This patch was orginally part of bug 26555, and introduces a method for
cleaning the accumulated messages.

The idea is that you might run:

    $patron->some
           ->series
           ->of
           ->method
           ->calls;

    if ( $patron->messages ) { ... }

and for next calls, want the messages cleared. So you can call

    $patron->reset_messages;

To test:
1. Run:
   $ kshell
  k$ prove t/db_dependent/Koha/Object.t
=> SUCCESS: Tests pass
2. Apply this patch
3. Repeat 1
4. Sign off :-D

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 2 Tomás Cohen Arazi 2022-03-09 13:21:31 UTC
*** Bug 26650 has been marked as a duplicate of this bug. ***