lukaskleinschmidt / kirby-sortable

Making subpage managing a breeze
79 stars 6 forks source link

Removed Modules break the panel #18

Closed medienbaecker closed 7 years ago

medienbaecker commented 7 years ago

I noticed that the removal of the last module of a page breaks the panel. Only when deleting the module via the page/module sidebar, though. When deleting it in the field I guess some sort of "hook" gets triggered and it works as intended. Seems like the field looks at the saved modules sequence that's saved to the page content and doesn't check if the module exists. If I remove a module and another last one still exists it doesn't happen.

Can you reproduce this @lukaskleinschmidt?

I think the field should remove its content responsible for the modules sorting when there are no modules anymore.

EDIT: If I remove these lines that seem to sort the modules according to the sequence found in the content file, the error disappears.

EDIT 2: I think I solved it with this commit: https://github.com/medienbaecker/kirby-field-modules/commit/f6ea8e1524174afd674b7056f07d112633a3da96.

lukaskleinschmidt commented 7 years ago

Thanks for the heads up.