How do I override pdf.rb?
Added by Peter Werner about 14 years ago
Hello everybody.
I have a minor problem with my self developed plugin. A short explanation what it does: I can store contacts in redmine and I can connect them to issues. In the issues query I can filter the issues and I can add the contact name to the list of the shown columns. And there my problem starts: If I try to export a issue list with a column displaying a contact name not the same content is exported but the ID of my contact object.
I had the same problem before with the list itself and I patched therefore the queries_helper.rb. Here I can distribute my own version with my plugin. Now I have done that with the pdf.rb in lib/redmine/export as well and it works now but I am not sure how I can override an installed rdf.rb with my plugin? If I store my version of the pdf.rb in the lib folder of my plugin it is not used. Maybe I have to stored in a different place - but where?
Thanks in advance for any advice.
:-)Peter
Replies (5)
RE: How do I override pdf.rb? - Added by Manuel Charette about 14 years ago
I have to override pdf.rb to fix the function issues_to_pdf to implement indentation of sub-issue.
Actually, I have modify the the file (lib\redmine\export\pdf.rb). Is there a cleaner way to do it.
RE: How do I override pdf.rb? - Added by Peter Werner about 14 years ago
Hello Manuel,
that is also my question. I did the same and changed the file pdf.rb but I am not sure if this is a clean solution. I guess not but I do not see how I can deliver my own version within my plugin.
:-)Peter
RE: How do I override pdf.rb? - Added by Peter Werner about 14 years ago
Hi Manuel,
did you already find a answer for our question or has anybody else an answer? At the moment I see the only way to patch the code directly. But I would to avoid that in order to be able to update redmine without any trouble. Or maybe someone of the community can give me a hint where I should look in the documentation to answer that question?
:-)Peter
RE: How do I override pdf.rb? - Added by Manuel Charette about 14 years ago
No, I didn't find any thing for it. I'm waiting for a better way to do it rather then patching the code directly. But I'll have to put that soon in production.
RE: How do I override pdf.rb? - Added by Cecilia Håkansson about 12 years ago
Has anyone found an better way to do this?