CRUD
CRUD copied to clipboard
[4.0] Make sure routes can be generated even if developer uses phpcbf; don't generate route and sidebar item if it already exists
Fixes #2536
Makes the route generator check for these line contents, in this order, and places the route BEFORE that line:
// end of generated Backpack routes; DO NOT delete or modify this comment;}); // this should be the absolute last line of this file});- nothing?! then the last line of the file - 1;
- no lines?! ok, then return 0;
In addition:
- it checks that the route doesn't exist before writing content;
- sidebar also checks that it doesn't exist before writing content;
Now if you're trying to generate a CRUD that already exists, the end result is similar with the model, view, controller:
A new inspection was created.