-
Notifications
You must be signed in to change notification settings - Fork 55
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
After drag and drop implementation, cover breaks if you remove the referenced item in a tile #588
Comments
thanks for your report! we are going to fix this before making a new release. |
...would it be the case to add an upgradeStep that:
What do you think? |
we are talking about what tile? |
found it, |
This is just as an example, every tile that references to a content by uuid will have this problem if the content is excluded from ZODB. Do you agree with the upgradeStep? |
I think every tile can check if the content don't exist and then set as |
no need to create an upgrade step |
Indeed, much more simple! Great idea. |
Existem tiles do tipo "Header" que referenciam, através do uuid, conteúdos inexistentes. Após a implementação de arrastar e soltar entre tiles na próxima versão 1.0a13 de collective.cover em collective/collective.cover@adb1a67 se um objeto possui um uuid a um objeto que não existe, isso quebra a tela "Compor." Essa correção também precisa ser efetuada no collective.cover e será feita em collective/collective.cover#588 Portais já criados, que por ventura já tenham persistido esse tile e o usuário apenas mudou o título (e não refez a capa) não terão esse erro uma vez que uma lógica que seta "None" caso seja inválido será feita como definido em collective/collective.cover#588 (comment) Dessa forma, não é necessário um upgradeStep em brasil.gov.portal.
Will you add the implementation of setting "None" in the same pull request? |
The problem was another.. I added a method to add portal_types into data attribute, and didn't check if the object exists. Tested with all tiles that you can drop an image or file. |
After the commit adb1a67, if you normally add a File to a tile in compose view, them remove the File from folder_contents and go to compose again you get
The error happens here adb1a67#diff-37e197e3d8e3a93bbdc7cb51b15f57a3R156: there's an uuid in the tile, but the object that has that uuid doesn't exist anymore.
Don't know what is the best solution here: if obj is None, return None? Say a warning and return None? Throw an exception, but just for the tile (like it happens in the cover view if a tile throws an exception)? Create a subscriber when deleting items to see if there's any reference in tiles? @rodfersou
This has to be fixed before a new release. The cover isn't broken after removing the item, but
/compose
breaks.The text was updated successfully, but these errors were encountered: