Hi, if I want to make internal changes in Zammad for example adding fields to a model and using them in the search queries what is the best approach you guys recommend? To create a new fork of Zammad repository and work here with the updates or using the Zammad Package? For example if I want to add a field (position) in the Ticket::State table and then use this field to order the Ticket states in the dropdowns. ( very simple task). Thanks so much!
Well I personally think that the update safest way would be a Zammad addon.
Other wise if you fork (which would be perfectly fine) you’d had to ensure to get all other code changes merged cleanly.
The downside on such a fork is that if you don’t need the functionality anymore, going back might be a bit more troublesome than just “removing” the addon.
Thank you for your answer MrGeneration!! I would like to make all updates with addons but if my addon overwrite existing code how can I manage the merges as I do when I merge code in git ( sometime resolving de conflicts manually ). I was thinking in the addons only for new functionalities that does not change the existing code.
Yes and no.
Addons can also replace existing files. Technically this can bring issues if you introduce bugs by that, but it’s perfectly possible and required on some points.
As you provide your fiels (and their locations) within the addon, all files that already exist will be replaced by those of your addon. Please keep in mind that a package installation replaces those files upon update. This is why this step is partly update safe only. You’ll need to reinstall the addon after updating.
Yes, I understand but there is the possibility for example I want to add a custom field to a search query and Zammad team add also a custom field to the same search query. If I use addons only one of this updates can coexists. The only way to fix this is to make a manually merge integrating the two custom fields in the query.
There’s no guruantee that we happen to accidently choose the same naming conventions like you do.
The same attribute names cannot co exist within the same object.
Sorry maybe I don´t explain well. When I was mention custom fields in a search query statement it is an example. Let´s put it this way: if with my Zammad Package addon I modify an already existing class and then in the new updates of Zammad you guys change this specific class, your class will override mine when I update Zammad and my class in the addon will override yours when I install again the addon.
For example I change in my Zammad package addon this class --> app/controllers/search_controller.rb. (specifically the method search_generic_backend). If you change this class in a Zammad update everytime I install the addon after this update I will lose your changes.
Correct, that’s how updates and custom addons work.
In my opinion you have these situations in both directions: using an own repo or a zammad package.
The thing is: You will always have workload on fiddling around the code changes.