Bug 36962

Summary: Apparent "typo" in notices and slips ---BORROWERS--- object (email)
Product: Koha Reporter: manuel.carro1
Component: ToolsAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low    
Version: 23.05   
Hardware: All   
OS: Linux   
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: Screen capture of bug narrative. On the left, notice the object in plural. On the right, changing the object's number to singular fixes the issue.

Description manuel.carro1 2024-05-26 19:58:05 UTC
Created attachment 167183 [details]
Screen capture of bug narrative. On the left, notice the object in plural. On the right, changing the object's number to singular fixes the issue.

There seems to be a "typo" in the object for borrowers in the notices and slips tool [WELCOME email template for patrons). Particularly, in the ---BORROWERS--- sublist, the object is written in plural (e.g. borrowers.borrowernumber, borrowers.cardnumber, ... et seq.). However, when utilizing the borrower object.methods as listed (in plural) by "inserting it into the body", an error is not returned when saving and the email is successfully sent. But the "inserted values" do not show in the email. Only the borrower.cardnumber showed, which was one that was already written in the default. Upon closer inspection, I noteiced that the borrower object was in singular. Upon changing the object from plural to singular in the body of the edit (e.g. changing borrowers.borrowernumber to borrower.borrowernumber etc.) and rerunning the test, it executed successfully. 

This is the first time that I have submitted a bug report to any system. Please forgive me if I may still have to learn the ropes of how to properly do/write so. 

Beatitudes, ~m
Comment 1 Katrin Fischer 2024-05-26 20:03:50 UTC
I think this is a misunderstanding. The editor doesn't list the object values, but the values to be used with the older 'hungry alligators' syntax that uses the table and column names from the database.

borrowers.surname etc. is completely correct in this case.

When you click on the value and the button in the middle you will see it's added to the notice as:

<<borrowers.surname>>

When using the TT syntax, this would be:

[% borrower.surname %]

Both currently work and we are working on deprecating the older less flexible syntax, but for the time being the editor only supports the first one. Other reports for enhancing the editor exist.

Please don't hesitate to file more bugs - there is really nothing that can go wrong :) We are also available for questions on chat.koha-community.org if you are not sure about one behavior or the other.
Comment 2 manuel.carro1 2024-05-26 23:19:22 UTC
Thank you.