Quantcast
Channel: Zammad - Community - Latest posts
Viewing all articles
Browse latest Browse all 6801

Attachments in form

$
0
0

Hi @Caufland ,

I think the issue with your questions are that you are posting very big code snippets which are incomplete and not testable. If you need help you should try to break down your code in a small working code snippet which other developers can implement and test. Even if they are willing to help you, I don’t think that with your code examples this is even possible. And so is my answer, but I will try to give you some infos about the handling of attachments in zammad.

If you want to use attachments zammad-like I think they are working via form_id.

Normally a form has a form_id. It is used to connect attachments to the form you are using to create an object. Zammad is storing the attachments temporarily over this controller:

zammad/app/controllers/upload_caches_controller.rb at 45c9b70f98e952ec8d9dc93009c3ff4fac5468d3 · zammad/zammad · GitHub

With that it is possible to save the current temp state of the creation or the update related to a form_id. On creation of the object then the form_id is used to read the temp data from the upload cache. An example can be found here:
zammad/app/controllers/concerns/creates_ticket_articles.rb at 45c9b70f98e952ec8d9dc93009c3ff4fac5468d3 · zammad/zammad · GitHub

For the model itself AFAIK there is a concern which is helping for the handling of the attachments:
zammad/app/models/application_model/has_attachments.rb at 45c9b70f98e952ec8d9dc93009c3ff4fac5468d3 · zammad/zammad · GitHub

Hope this helps a bit.


Viewing all articles
Browse latest Browse all 6801

Trending Articles