Skip to content
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

Fix cover cannot be edited on copied card #1246

Merged
merged 1 commit into from Oct 1, 2017
Merged

Conversation

nztqa
Copy link
Contributor

@nztqa nztqa commented Sep 25, 2017

#1218
Remove the cover from the copied card


This change is Reviewable

@xet7
Copy link
Member

xet7 commented Sep 25, 2017

@nztqa

When I tried this, card content (description, images, checklists etc) were not copied to new card anymore. Only card name was copied.

You could try to look at move card code how it does work moving everything, if something similar could be done to copy card.

@nztqa
Copy link
Contributor Author

nztqa commented Sep 25, 2017

It works normally in my environment
wekan_cover-iloveimg-compressed

@xet7
Copy link
Member

xet7 commented Sep 25, 2017

I did copy it to different list than the original list. It did not work for me in that case.

@nztqa
Copy link
Contributor Author

nztqa commented Sep 25, 2017

@xet7

It has nothing to do with this PR.
That is another matter.
Console log in browser.

WriteError({"code":11000,"index":0,"errmsg":"E11000 duplicate key error collection: wekan.checklists index: c2_items.$._id dup key: { : \"N685pxNPyaYax8MHi0\" }","op":{"cardId":"WAfHjMYuDGdo8cQgH","title":"list5","sort":0,"createdAt":"2017-09-25T13:21:04.253Z","items":[{"_id":"N685pxNPyaYax8MHi0","title":"one","isFinished":false,"sort":0},{"_id":"N685pxNPyaYax8MHi1","title":"two","isFinished":false,"sort":1},{"_id":"N685pxNPyaYax8MHi2","title":"three","isFinished":false,"sort":2}],"_id":"A7Pa4N6qEFJZeEZm9","userId":"uMQ4krMnjQ5W6TLzW"}})

Please try it

db.checklists.dropIndex( "index name" )

# in this case
db.checklists.dropIndex( "c2_items.$._id" )

@xet7
Copy link
Member

xet7 commented Sep 30, 2017

@nztqa

When I don't add your pull request code, and copy card to same list, copied card cover can not be edited.

When I add your pull request, and copy card to same list, card cover image attachment is not visible at all.

I have these indexes, what should I do with these? How with mongo shell I could fix those? Could you add code to fix those previously copied cards so covers become editable, and I would not need to edit mongodb manually on mongodb shell?

> db.checklists.getIndexes()
[
	{
		"v" : 1,
		"key" : {
			"_id" : 1
		},
		"name" : "_id_",
		"ns" : "admin.checklists"
	},
	{
		"v" : 1,
		"key" : {
			"cardId" : 1,
			"createdAt" : 1
		},
		"name" : "cardId_1_createdAt_1",
		"ns" : "admin.checklists"
	}
]

Thanks! :)

@nztqa
Copy link
Contributor Author

nztqa commented Sep 30, 2017

@xet7

There is no function to copy attached files in #1204.
Therefore, when the card cover is copied, data inconsistency has occurred.
This PR removes the card cover from the copied card and keeps the data clean.

@xet7
Copy link
Member

xet7 commented Oct 1, 2017

Thanks for explaining! :)

@xet7 xet7 merged commit 860ae6f into wekan:devel Oct 1, 2017
@nztqa nztqa deleted the fix-copy-card branch October 2, 2017 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants