- Issue created by @jeremyskinner
- First commit to issue fork.
- 🇩🇪Germany marcus_johansson
It seems like the issue is that when the comment is saved, the task save is not triggered afterwards, so it doesn't ever run this presave until someone resaves it.
This push I did fixes this, however since the comments list, but not the whole view is reloaded via ajax, you won't see it until you reload the page. Follow up issue or should that be fixed here?
- 🇬🇧United Kingdom jeremyskinner
hi marcus, this change doesn't fix the issue with attachments, in my case I'm not working with comments at all. Here's a reproduction:
// Load a file that already exists. $file = \Drupal\file\Entity\File::load(1); // Create a new task. $mytask = \Drupal\minikanban\Entity\Task::create(); // Add the file to the task and save. $mytask->get('attachements')->appendItem($file); $mytask->save(); // Should be 1, actual 0 because it's overwritten in Task::preSave line 156. print $mytask->get('attachements')->count();
- 🇩🇪Germany marcus_johansson
Sorry, I should have read the description clearer - we catched a bug this way though. The fix now makes sure that any incoming or already manually saved attachement should be kept.
So it takes the current attachments and adds any potential attachements from the description or a comment.
This means that if you remove a file from the description, it will still be kept as an attachment. A follow up task could be that its possible manually to remove attachments.
- First commit to issue fork.
- 🇬🇧United Kingdom andrewbelcher
Rebased, fixed typo in line with 🐛 Fix typo in "Attachments" field Active and merged, thanks!
-
andrewbelcher →
committed 75d72c77 on 1.0.x authored by
marcus_johansson →
Issue #3529811: Attachments on tasks are overwritten
-
andrewbelcher →
committed 75d72c77 on 1.0.x authored by
marcus_johansson →
-
justanothermark →
committed 6642b77b on 1.0.x authored by
marcus_johansson →
Issue #3529811 by marcus_johansson, andrewbelcher, jeremyskinner:...
-
justanothermark →
committed 6642b77b on 1.0.x authored by
marcus_johansson →
Automatically closed - issue fixed for 2 weeks with no activity.