silverstripe / silverstripe-elemental

Create pages in Silverstripe CMS using content blocks
http://dna.co.nz
BSD 3-Clause "New" or "Revised" License
110 stars 115 forks source link

Unknown block types cause elemental editor to break #609

Open chillu opened 5 years ago

chillu commented 5 years ago

If you have blocks in your database that no longer correlate to available classes (e.g. because you removed a module), the editor breaks in weird ways (JavaScript errors).

Option A: Replicate the SiteTree functionality of gracefully failing back to the baseline block editor (might not be feasible?) Option B: Show a readonly "broken" block Option C: Break with an explicit exception.

I'd be happy with Option C, but at the moment the error is so obscure that it might send devs down a rabbit hole.

matthewalkr commented 4 years ago

We quite often refactor block names close to release (e.g. to remove inconsistencies between the interface and the app code which are just tech debt traps for the future). A good outcome here for us would be for the page to still be editable after the block disappears. So option A or B would be ideal. As it stands, the whole page becomes unusable.

brynwhyman commented 4 years ago

Noting that error handling on a per-block basis has since been implemented in https://github.com/dnadesign/silverstripe-elemental/pull/739. There might be some overlap with this issue.