creecros / MetaMagik

Custom Fields for Kanboard - Plugin MetaMagik
MIT License
98 stars 16 forks source link

Custom Fields content lost when moving to another Swimlane #40

Closed basti79 closed 5 years ago

basti79 commented 5 years ago

Hi,

when i move a Task to another swimlane in the project the contents of my custom field get lost. I can re-fill the information, so the field itself is available, but all contents seem to vanish.

Thanks in advance.

Greets, Sebastian.

creecros commented 5 years ago

Interesting. I'll take a look.

creecros commented 5 years ago

@basti79 I was unable to reproduce, and to be honest, am not sure how it would even remotely be possible for the metadata to vanish by just moving to a swimlane. It just doesn't work that way. Metadata is stored in the taskmetadata table, and the relationship is the task id. Only way to break the chain would be for the task id to change.

I tried: Moving task to different swimlane via the board Moving task to different swimlane via "Move Position" Moving task to a different project and different swimlane via "Move to different project"

The custom fields never vanished and remained intact.

Maybe provide some more details?

i.e.

basti79 commented 5 years ago

@creecros Thanks for your work, first let me answer your questions:

The actual news: By reproducing this problem I found out it's linked to an automatic action "Assign a color when the task is moved to a specific swimlane". Without this everything is ok, but when automatically changing the color when moving to a specific swimlane and then using the board to drag-and-drop the task the field contents are lost.

Greets Sebastian.

creecros commented 5 years ago

Ok, I reproduced it. Let me look into it.

creecros commented 5 years ago

I have little understanding of Pimple...but it appears that the model override: https://github.com/creecros/MetaMagik/blob/8b5f5cf8f872fc13811a246e5e342e9c8012fdef/Plugin.php#L24-L27

does not affect Actions. I'm guessing there is another container that needs that override, no clue as to how to call it, change it, etc...

I'll have to study. Maybe @fguillot might help answer this question for me?

However there is a work around. Make your own action, and use the NewTaskModificationModel supplied in the plugin.

creecros commented 5 years ago

@basti79

After performing several tests, I figured out what is going on. The model is actually overriden, but I built the model with Modifcations from the TaskModification Form, not via an Action, so the $values do not contain the metadata to replace them. Hence, they disappear.

I should be able to fix this, stay tuned, it's getting late tonight, so maybe tomorrow.

creecros commented 5 years ago

This should fix it: https://github.com/creecros/MetaMagik/releases/tag/1.2.6

Please report back if you see any other issues.