glowfic-constellation / glowfic

The Glowfic Constellation
https://www.glowfic.com
MIT License
17 stars 11 forks source link

GalleriesIcon should require an icon #596

Open Throne3d opened 7 years ago

Throne3d commented 7 years ago

From #567:

Relatedly, galleries_icon should require an icon, but doing this breaks the ability to delete icons from a gallery using nested parameters, for some reason.

Marri commented 7 years ago

For historical record, the reason:

We allow editing gallery_icons and icons via the gallery edit page. When you try to destroy an icon, it technically saves the gallery_icon with the delete=true flag on the icon. This means that it saves the gallery_icon before it gets to the icon's delete callback (which would destroy the gallery_icon) and so, since it doesn't know that the gallery_icon will be deleted, it becomes Very Upset that the icon is nil.

Possible workaround is to always set destroy for gallery_icons when the icon is set as destroyed, since that's going to happen anyway and then it might care less about validation?

On Sat, Nov 25, 2017 at 1:00 PM, Edward Jones notifications@github.com wrote:

From #567 https://github.com/Marri/glowfic/pull/567:

Relatedly, galleries_icon should require an icon, but doing this breaks the ability to delete icons from a gallery using nested parameters, for some reason.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Marri/glowfic/issues/596, or mute the thread https://github.com/notifications/unsubscribe-auth/AAs60u-JnG7cyGxxONsCqNq0sRhK6eShks5s6FWhgaJpZM4QqgU1 .