isobar-nz / silverstripe-catalogmanager

Catalog administration via a LeftAndMain like interface. Lets you create and edit pages outside of the site tree
36 stars 26 forks source link

Hide add new button and show message if no parents exist #57

Closed hchokshi closed 6 years ago

hchokshi commented 6 years ago

Currently, the package throws an exception when the add new button is clicked and no parent page candidate exists. This causes a 500 error and shows an error page to the user that gives them no information on how to resolve the issue.

This PR hides the add new button and shows a warning level message to the user advising them the object types they could create to have a valid parent page.

An example of the message / hidden add button component:

screen shot 2018-07-05 at 6 19 40 pm