kanboard_plugin_coverimage icon indicating copy to clipboard operation
kanboard_plugin_coverimage copied to clipboard

Cover images not duplicated

Open PapeCoding opened this issue 4 years ago • 11 comments

Unfortunately the cover images are not duplicated, if I duplicate the card via the menu. I am not sure, if the attachments are duplicated by Kanboard in the first place

PapeCoding avatar Jul 29 '20 09:07 PapeCoding

I will take a look into this after my vacation.

TimoStahl avatar Jul 31 '20 06:07 TimoStahl

@BlueTeck @PapeCoding

The easiest solution here is, just install MetaMagik as well. It is already setup to duplicate metadata, and that is all that is needed.

If you wanted to take the same approach and build those overrides into coverimage, the foreseeable issues are incompatibility with MetaMagik and Group_assign down the road. Although, it could be done in a way to keep compatibility if need, just...more work.

creecros avatar Feb 18 '21 15:02 creecros

added a simple model to duplicate metadata when duplicating within a project. if you duplicate to another project, thats not going to work, but could add that code later (again, install metamagik and it will work when duplicating to another project as well). it takes metamagik into account, and should maintain compatibility even with group_assign.

creecros avatar Feb 18 '21 16:02 creecros

Although duplication within a project is enough for use case, I would like to have the "clean" solution, that this plugin is somehow self-contained and does not require MetaMagik, if it is not needed anywhere else.

But thank you for your work!

PapeCoding avatar Feb 18 '21 16:02 PapeCoding

well, the good news is, its only one more model to take into account to have it work when duplicating to another project, and the code will be the pretty much the same, i just don't have the time to do it right now. i've also learned how to do it, without completely overriding the original models, so that's even better news, and what i really need to do is go back to metamagik and group_assign and update those models, but again, time....maybe @BlueTeck will get the time before me, but i'll be out til monday most likely.

creecros avatar Feb 18 '21 16:02 creecros

Totally forgot this issue... I don't like dependencies to other plugins. I will take at look at it next week. If there is no clean solution at the moment, I will implement a new hook in the kanboard core.

TimoStahl avatar Feb 19 '21 08:02 TimoStahl

it's not dependent on MetaMagik, that was just a solution I offered while he wait.

at this point, all you need to do is add a TaskProjectDuplicatonModel, and it will look pretty much exactly how I added the TaskDuplicationModel. I can do it tonight.

creecros avatar Feb 19 '21 12:02 creecros

@BlueTeck Should be all set now. Unless I missed something.

creecros avatar Feb 19 '21 16:02 creecros

also Travis is failing because the php.ini in kanboards tests folder is no longer there. No idea why.

creecros avatar Feb 19 '21 17:02 creecros

Hello @creecros, sorry, that it took me so long to respond. I just tested the change you made and it unfortunately does not work for me. Am I doing something wrong?

  1. Create Task
  2. Attach Document
  3. Set Document as coverimage
  4. Duplicate Task to other Project / Duplicate Task

If I do this, the duplicated task does not have an attached document nor a cover image.

My current version is running on 1.2.18 and does not give any erroneous output.

PapeCoding avatar Apr 24 '21 11:04 PapeCoding

just wait for @BlueTeck update. it will be compatible with 1.2.19.

creecros avatar Apr 24 '21 12:04 creecros