Hi there,
I’ve been trying to find a way to add inline images to tickets, replies, comments, etc. via the web interface as it happens when a ticket is created via email. I’ve done it successfully with:
adding popup and filebrowser plugins to CKEditor
adding server side script for uploading images and
Setting $Framebusting to suppress X-Frame-Options: DENY header
manipulating lib/RT/Interface/Web.pm to handle such cases and generating necessary mime types (i.e. multipart/related etc.)
manipulating lib/RT/Transaction.pm to remove link to images in the editor when adding comments
It looks like everything works properly but the problem is I don’t want to patch the source code and want to use other mechanisms like hooks (i.e. callbacks) but I couldn’t find a proper callback for that.
Could someone please let me know what callbacks I can use for items 4 and 5?
If you search in the library files for “m->callback(” you can find all the places the subroutines provide for a callback to be inserted - whether those will be useful for you will depend how your code works.
You might also want to look at overlays, so you can just replace/extend the subroutines you need to rather than making a local copy of the entire file.
Thanks. I looked for the callbacks and tried several ones that seemed to be related to ticket creation without success.
So, I think I have two options:
To patch lib/RT/Interface/Web.pm to add my own callbacks
To use overlays.
I’ll try overlays first because I need to modify sub MakeMIMEEntity located in lib/RT/Interface/Web.pm.
I used overlays and it looks like it’s working. I haven’t run all tests related to the web interface yet.
I created a file with the name Web_Local.pm in lib/RT/Interface directory and overrode sub MakeMIMEEntity. I also added no warnings qw(redefine); to stop related warnings.