bigfork / silverstripe-fail-whale Goto Github PK
View Code? Open in Web Editor NEWSilverStripe error pages, just without the pages.
License: BSD 3-Clause "New" or "Revised" License
SilverStripe error pages, just without the pages.
License: BSD 3-Clause "New" or "Revised" License
Is there a reason why ErrorDocument::render() calls renderWith() with two slightly different signatures? In the PageController block the call includes $this as the second argument, the other call doesn't. If that's not intentional maybe renderWith() could just be called once for both cases? In that case we also just have to add the fallback template once.
if (class_exists(\PageController::class)) {
...
}
$templatesFound[] = [ Controller::class ];
return $controller->renderWith(array_merge(...$templatesFound), $this);
None of the following templates could be found: Array ( [0] => Bigfork\SilverStripeFailWhale\Model\ErrorDocument_404...
Ideal outcome: display a warning on the dev/build
output instead... if feasible
I'd propose to append the framework Controller template to the array in order to fallback to that if nothing else found (like the framework does).
ErrorDocument::render():
...
$templatesFound[] = $page->getViewerTemplates();
// Fallback to framework template in case no themes defined (prevent template-not-found warning)
$templatesFound[] = [ Controller::class ];
It would seem we'd need to include that twice, once for if PageController exists and once if not;
if (class_exists(\PageController::class)) {
...
$templatesFound[] = [ Controller::class ];
return $controller->renderWith(array_merge(...$templatesFound), $this);
}
$templatesFound[] = [ Controller::class ];
return $this->renderWith(array_merge(...$templatesFound));
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.