integral icon indicating copy to clipboard operation
integral copied to clipboard

BUG: Deleting all pages causes error when viewing front end

Open phil9690 opened this issue 6 years ago • 1 comments

Environment

  • Ruby 2.4.1
  • Rails 5.2.1
  • Integral v1.0.1

Description of issue

Deleting all pages causes the front end to break.

Current behaviour

Error Couldn't find Integral::Page with 'id'=1 [WHERE integral_pages.deleted_at IS NULL] is thrown when all the pages are deleted and a user tries to navigate to the front end.

Expected behaviour

  • Option A. For the user to be blocked from deleting all pages.
  • Option B. Have a demo page that only becomes present when there are no pages available, or friendly error page for non logged in users saying there is no content and another page for logged in users/admins to create their first page.

phil9690 avatar Nov 05 '18 19:11 phil9690

I'd go with option A.

Before Integral allows the user to delete a page it should first check if that page is the homepage. If it is return error message.

patricklindsay avatar Nov 08 '18 00:11 patricklindsay