Bug 37989 - Add template toolkit to problem_report notice
Summary: Add template toolkit to problem_report notice
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Lisette Scheer
QA Contact: Victor Grousset/tuxayo
URL:
Keywords:
Depends on:
Blocks: 36260
  Show dependency treegraph
 
Reported: 2024-09-23 18:07 UTC by Lisette Scheer
Modified: 2024-12-18 00:50 UTC (History)
2 users (show)

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


Attachments
Attachment to Bug 37989 - Add template toolkit to problem_report notice (903 bytes, patch)
2024-09-23 18:25 UTC, Lisette Scheer
Details | Diff | Splinter Review
Bug 37989: Add template toolkit to problem_report notice This patch adds the ability to use template toolkit in the PROBLEM_REPORT notice (957 bytes, patch)
2024-09-26 18:54 UTC, Olivier Vezina
Details | Diff | Splinter Review
Bug 37989: Add template toolkit to problem_report notice (1.56 KB, patch)
2024-12-18 00:45 UTC, Victor Grousset/tuxayo
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lisette Scheer 2024-09-23 18:07:54 UTC
Currently the PROBLEM_REPORT notice does not properly call the problemreports object into the notice.
Comment 1 Lisette Scheer 2024-09-23 18:25:42 UTC
Created attachment 171884 [details] [review]
Attachment to Bug 37989 - Add template toolkit to problem_report notice

Bug 37989: Add template toolkit to problem_report notice 
This patch adds the ability to use template toolkit in the PROBLEM_REPORT notice
Comment 2 Lisette Scheer 2024-09-23 18:34:29 UTC
To test:

1. Turn on OPACReportProblem in the system preferences. 
2. In the staff interface, create the following report:
  SELECT * FROM message_queue WHERE letter_id='PROBLEM_REPORT'
3. Log into the OPAC
4. Report a problem
5. Run the report you created.
6. Observe the data. (Bug 37991, the title doesn't store properly)
7. Apply the patch
8. Restart all services (restart_all on command line Restart Services in sandbox options)
9. Edit the PROBLEM_REPORT notice to include [% problemreport.username %] after the bespoke syntax for the username. 
10. File a new OPAC problem report
11. Run your report. 2 usernames should now show.
Comment 3 Olivier Vezina 2024-09-26 18:54:52 UTC
Created attachment 172019 [details] [review]
Bug 37989: Add template toolkit to problem_report notice This patch adds the ability to use template toolkit in the PROBLEM_REPORT notice

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Comment 4 Victor Grousset/tuxayo 2024-11-23 23:02:01 UTC
Without the patch I get this:

*************************** 2. row ***************************
            message_id: 2
             letter_id: 90
        borrowernumber: 51
               subject: OPAC problem report
               content: Username: koha

Problem page: /

Title: this is the subject

Message: this is the body
              metadata: 
           letter_code: PROBLEM_REPORT
message_transport_type: email
                status: pending
           time_queued: 2024-11-23 22:57:57
            updated_on: 2024-11-23 22:57:57
            to_address: root@localhost
            cc_address: NULL
          from_address: NULL
         reply_address: NULL
          content_type: NULL
          failure_code: 
----------------------------

Isn't it okay? What is the expected anomaly?
And it's the same with the patch. Even though in main there is not the problem_reports object.
Comment 5 Victor Grousset/tuxayo 2024-11-23 23:09:48 UTC
@Lisette When attaching patches there should not be the "Attachment to" prefix to attachment name. It should be just the commit summary (1st line of the commit message).
That's why we have twice the patch attached. Because they don't have exactly the same name so the 1st version isn't marked as obsolete and hidden.

git bz does that by default but I think it's possible to get away without it and still get the same result.

Also it look like "This patch adds the ability to use template toolkit in the PROBLEM_REPORT notice" is not part of the commit summary so it should be spaced by an empty line in the commit message.
Comment 6 Lisette Scheer 2024-12-02 19:13:05 UTC
Ah, both the confusion and the patch name came from doing this on my laptop during KohaCon between presentations. 

The test plan should have  step 9 before the first one is created so you can see that the tt doesn't populate.

Edit the PROBLEM_REPORT notice to include [% problemreport.username %] after the bespoke syntax for the username. 

Then you can see after  the patch applies that it does. 

There's a bug this one blocks to update the default to use TT.
Comment 7 Victor Grousset/tuxayo 2024-12-18 00:45:45 UTC
Created attachment 175638 [details] [review]
Bug 37989: Add template toolkit to problem_report notice

This patch adds the ability to use template toolkit in the PROBLEM_REPORT notice

Test plan:
1. Turn on OPACReportProblem in the system preferences.
2. In the staff interface, create the following report:
  SELECT * FROM message_queue WHERE letter_id='PROBLEM_REPORT'
3. Log into the OPAC
4. Edit the PROBLEM_REPORT notice to include [% problemreport.username %] after the bespoke syntax for the username.
5. Report a problem
6. Run the report you created.
7. Observe the data. (Bug 37991, the title doesn't store properly)
8. Apply the patch
9. Restart all services (restart_all on command line Restart Services in sandbox options)
10. File a new OPAC problem report
11. Run your report. 2 usernames should now show.

Signed-off-by: Olivier V <olivier.vezina@inLibro.com>
Comment 8 Victor Grousset/tuxayo 2024-12-18 00:50:45 UTC
(In reply to Lisette Scheer from comment #6)
> Ah, both the confusion and the patch name came from doing this on my laptop
> during KohaCon between presentations. 
> 
> The test plan should have  step 9 before the first one is created so you can
> see that the tt doesn't populate.
> 
> Edit the PROBLEM_REPORT notice to include [% problemreport.username %] after
> the bespoke syntax for the username. 
> 
> Then you can see after  the patch applies that it does. 
> 
> There's a bug this one blocks to update the default to use TT.

Oops about that, it's a confusion from my side: It was about the commit summary (1st line of commit message)

It's «Bug 37989: Add template toolkit to problem_report notice This patch adds the ability to use template toolkit in the PROBLEM_REPORT notice»

And it looks like it should be just «Bug 37989: Add template toolkit to problem_report notice»

And the rest of the commit message be
«

This patch adds the ability to use template toolkit in the PROBLEM_REPORT notice
»

About step 9 IIUC it should be above "Report a problem"

With all that, tell me if the commit summary and the rest of the commit message is what you expect on the newly attached patch.