-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy card: "show as thumb" attachment setting is not cloned #5364
Comments
I may be wrong but I think the trouble code is there: Lines 587 to 593 in e73a44d
When a card is inserted, there may be a control that disable this option to show 'attachements' if the card has no attachment. then attachment are created in the next block. But then should try a |
OK, I got it. When the card is inserted, the coverId key of the new card points to the previous attachment file _id. When attachments have been copied, one should look for the _id of the new card new attachments whose key "meta.copyFrom" is equal to the current coverId key. Then, change this key, with this _id. The trouble is copyFile is async. The best would be copyFile to return the _id of the new attachment in a Promise, and to wait for this Promise only for the copy of the cover attachment. I didn't go further because it would imply waiting, and I know wekan is really concerned with scalability (copying a board means possibly copying a lot of cards). Another way would be copyFile to handle this coverId change when called from the copy card function... Sounds strange... We could also consider, the situation completely differently and handle it at display time. If coverId points to an attachment not belonging to the current card, look for current card attachments whose "meta.copyFrom" is equal to the current coverId and then correct it. This should be efficient. And if not enough, we could add a flag on the new card after copy to trigger this only once, but I think this is needless. When displaying a card anyway, the Card object is built with all the data we need, and it's no more than a condition test. Your opinions? |
Server Setup Information
Problem description
Reproduction Steps
Clone a board, open it, image are not shown in cards. Look at board setting and check if thumbs are set to be shown: it is. Go on the card and request attachment to be shown and it appears. So it's just this information that hasn't been "copied".
Other
That's not a major trouble as we use clone to archive board. I'll try to look at it in the code if I get the time.
The text was updated successfully, but these errors were encountered: