Briskine / briskine

Write faster with templates and keyboard shortcuts.
https://www.briskine.com/
GNU General Public License v3.0
108 stars 23 forks source link

Blank attachment automatically added when adding a tag #183

Closed RomainLapeyre closed 8 years ago

RomainLapeyre commented 8 years ago

Reproduce:

--> When you save the template with the new tag, it adds a blank attachment to the template. Then, you can't insert the template anymore, which is the main issue.

image

db0_ _gorgias_ _quicktext
RomainLapeyre commented 8 years ago

2 customers have this issue, we need to fix it.

ticruz38 commented 8 years ago

As I told you, I have no idea why adding tags on multiple template end up by adding an empty file link. However a quick fix would be to check in the file list for empty link and remove them automatically. If you want me to introduce that bug fix I can do that.

RomainLapeyre commented 8 years ago

Thanks for responding this fast @ticruz38. It's not a tag pb, it's when a template is saved (with or without tags), sometimes it adds "[null]" as the attachment value in the DB instead of "null". Does that help?

ticruz38 commented 8 years ago

Yes it does, should be an easy fix

Le mer. 18 mai 2016 10:25, RomainLapeyre notifications@github.com a écrit :

Thanks for responding this fast @ticruz38 https://github.com/ticruz38. It's not a tag pb, it's when a template is saved (with or without tags), sometimes it adds "[null]" as the attachment value in the DB instead of "null". Does that help?

— You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub https://github.com/gorgias/gorgias-chrome/issues/183#issuecomment-219959100

ticruz38 commented 8 years ago

Well: for newest templates we submit default values with empty array for attachments, for updated templates we require values and submit those values for building our template. Both object are submitted to angular.copy for some reason. The bug may come form that function returning either an empty array or an array filling with one null value.

my fix would be to submit default values with null value on attachment property instead of an empty array when there is no attachments in the template. So we do not get that [null] array anymore.

ticruz38 commented 8 years ago

checkout the pull request => https://github.com/gorgias/gorgias-chrome/pull/188 try to reproduce the bug on my branch... shouldnt be there anymore!