Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Call to a member function canView() on null #622

Closed
emteknetnz opened this issue Feb 26, 2019 · 4 comments
Closed

Error: Call to a member function canView() on null #622

emteknetnz opened this issue Feb 26, 2019 · 4 comments

Comments

@emteknetnz
Copy link
Member

emteknetnz commented Feb 26, 2019

dnadesign/silverstripe-elemental - 4.0.x-dev - 37d13f1
SilverStripe 4.3.1

Error is from Raygun, not sure what triggered this.

Reported url is /admin/graphql

#0 DNADesign\Elemental\GraphQL\ReadOneAreaResolver::resolve called at [:0]
#1 ::call_user_func_array called at [/var/www/<dirname>/vendor/silverstripe/graphql/src/Scaffolding/Scaffolders/OperationScaffolder.php:427]
#2 SilverStripe\GraphQL\Scaffolding\Scaffolders\OperationScaffolder::SilverStripe\GraphQL\Scaffolding\Scaffolders\{closure} called at [:0]
#3 ::call_user_func called at [/var/www/<dirname>/vendor/webonyx/graphql-php/src/Executor/Executor.php:488]
#4 GraphQL\Executor\Executor::resolveOrError called at [/var/www/<dirname>/vendor/webonyx/graphql-php/src/Executor/Executor.php:449]
#5 GraphQL\Executor\Executor::resolveField called at [/var/www/<dirname>/vendor/webonyx/graphql-php/src/Executor/Executor.php:227]
#6 GraphQL\Executor\Executor::executeFieldsSerially called at [/var/www/<dirname>/vendor/webonyx/graphql-php/src/Executor/Executor.php:249]
#7 GraphQL\Executor\Executor::executeFields called at [/var/www/<dirname>/vendor/webonyx/graphql-php/src/Executor/Executor.php:174]
#8 GraphQL\Executor\Executor::executeOperation called at [/var/www/<dirname>/vendor/webonyx/graphql-php/src/Executor/Executor.php:93]
#9 GraphQL\Executor\Executor::execute called at [/var/www/<dirname>/vendor/webonyx/graphql-php/src/GraphQL.php:56]
#10 GraphQL\GraphQL::executeAndReturnResult called at [/var/www/<dirname>/vendor/silverstripe/graphql/src/Manager.php:354]
#11 SilverStripe\GraphQL\Manager::SilverStripe\GraphQL\{closure} called at [/var/www/<dirname>/vendor/silverstripe/graphql/src/Middleware/HTTPMethodMiddleware.php:30]
#12 SilverStripe\GraphQL\Middleware\HTTPMethodMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/graphql/src/Manager.php:137]
#13 SilverStripe\GraphQL\Manager::SilverStripe\GraphQL\{closure} called at [/var/www/<dirname>/vendor/silverstripe/graphql/src/Middleware/CSRFMiddleware.php:25]
#14 SilverStripe\GraphQL\Middleware\CSRFMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/graphql/src/Manager.php:137]
#15 SilverStripe\GraphQL\Manager::SilverStripe\GraphQL\{closure} called at [/var/www/<dirname>/vendor/silverstripe/graphql/src/Manager.php:140]
#16 SilverStripe\GraphQL\Manager::callMiddleware called at [/var/www/<dirname>/vendor/silverstripe/graphql/src/Manager.php:357]
#17 SilverStripe\GraphQL\Manager::queryAndReturnResult called at [/var/www/<dirname>/vendor/silverstripe/graphql/src/Manager.php:332]
#18 SilverStripe\GraphQL\Manager::query called at [/var/www/<dirname>/vendor/silverstripe/graphql/src/Controller.php:103]
#19 SilverStripe\GraphQL\Controller::index called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/RequestHandler.php:323]
#20 SilverStripe\Control\RequestHandler::handleAction called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Controller.php:284]
#21 SilverStripe\Control\Controller::handleAction called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/RequestHandler.php:202]
#22 SilverStripe\Control\RequestHandler::handleRequest called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Controller.php:212]
#23 SilverStripe\Control\Controller::handleRequest called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Director.php:361]
#24 SilverStripe\Control\Director::SilverStripe\Control\{closure} called at [/var/www/<dirname>/vendor/silverstripe/versioned/src/VersionedHTTPMiddleware.php:41]
#25 SilverStripe\Versioned\VersionedHTTPMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:62]
#26 SilverStripe\Control\Director::SilverStripe\Control\Middleware\{closure} called at [/var/www/<dirname>/vendor/silverstripe/intercom/code/IntercomMiddleware.php:41]
#27 SilverStripe\Intercom\IntercomMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:62]
#28 SilverStripe\Control\Director::SilverStripe\Control\Middleware\{closure} called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Security/BasicAuthMiddleware.php:68]
#29 SilverStripe\Security\BasicAuthMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:62]
#30 SilverStripe\Control\Director::SilverStripe\Control\Middleware\{closure} called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Security/AuthenticationMiddleware.php:61]
#31 SilverStripe\Security\AuthenticationMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:62]
#32 SilverStripe\Control\Director::SilverStripe\Control\Middleware\{closure} called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/CanonicalURLMiddleware.php:188]
#33 SilverStripe\Control\Middleware\CanonicalURLMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:62]
#34 SilverStripe\Control\Director::SilverStripe\Control\Middleware\{closure} called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPCacheControlMiddleware.php:42]
#35 SilverStripe\Control\Middleware\HTTPCacheControlMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:62]
#36 SilverStripe\Control\Director::SilverStripe\Control\Middleware\{closure} called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/ChangeDetectionMiddleware.php:27]
#37 SilverStripe\Control\Middleware\ChangeDetectionMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:62]
#38 SilverStripe\Control\Director::SilverStripe\Control\Middleware\{closure} called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/FlushMiddleware.php:29]
#39 SilverStripe\Control\Middleware\FlushMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:62]
#40 SilverStripe\Control\Director::SilverStripe\Control\Middleware\{closure} called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/RequestProcessor.php:66]
#41 SilverStripe\Control\RequestProcessor::process called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:62]
#42 SilverStripe\Control\Director::SilverStripe\Control\Middleware\{closure} called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/SessionMiddleware.php:20]
#43 SilverStripe\Control\Middleware\SessionMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:62]
#44 SilverStripe\Control\Director::SilverStripe\Control\Middleware\{closure} called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/AllowedHostsMiddleware.php:60]
#45 SilverStripe\Control\Middleware\AllowedHostsMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:62]
#46 SilverStripe\Control\Director::SilverStripe\Control\Middleware\{closure} called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/TrustedProxyMiddleware.php:176]
#47 SilverStripe\Control\Middleware\TrustedProxyMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:62]
#48 SilverStripe\Control\Director::SilverStripe\Control\Middleware\{closure} called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:65]
#49 SilverStripe\Control\Director::callMiddleware called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Director.php:370]
#50 SilverStripe\Control\Director::handleRequest called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/HTTPApplication.php:48]
#51 SilverStripe\Control\HTTPApplication::SilverStripe\Control\{closure} called at [:0]
#52 ::call_user_func called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/HTTPApplication.php:66]
#53 SilverStripe\Control\HTTPApplication::SilverStripe\Control\{closure} called at [:0]
#54 ::call_user_func called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Core/Startup/ErrorControlChainMiddleware.php:73]
#55 SilverStripe\Core\Startup\ErrorControlChainMiddleware::SilverStripe\Core\Startup\{closure} called at [:0]
#56 ::call_user_func called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Core/Startup/ErrorControlChain.php:235]
#57 SilverStripe\Core\Startup\ErrorControlChain::step called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Core/Startup/ErrorControlChain.php:225]
#58 SilverStripe\Core\Startup\ErrorControlChain::execute called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Core/Startup/ErrorControlChainMiddleware.php:92]
#59 SilverStripe\Core\Startup\ErrorControlChainMiddleware::process called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:62]
#60 SilverStripe\Control\HTTPApplication::SilverStripe\Control\Middleware\{closure} called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/Middleware/HTTPMiddlewareAware.php:65]
#61 SilverStripe\Control\HTTPApplication::callMiddleware called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/HTTPApplication.php:67]
#62 SilverStripe\Control\HTTPApplication::execute called at [/var/www/<dirname>/vendor/silverstripe/framework/src/Control/HTTPApplication.php:49]
#63 SilverStripe\Control\HTTPApplication::handle called at [/var/www/<dirname>/public/index.php:26]
@sminnee
Copy link
Member

sminnee commented Feb 26, 2019

Looks like https://github.com/dnadesign/silverstripe-elemental/blob/4.0/src/GraphQL/ReadOneAreaResolver.php#L15 is being passed an invalid ID.

In the first instance it could throw an error along the lines of "Can't find ElementArea {$args['ID']}". That might shed some light on why this was triggered.

@ScopeyNZ
Copy link
Contributor

ScopeyNZ commented Feb 26, 2019

Yeah we'll be happy to accept a patch that at least asserts the area exists before checking permission.

Nevermind I just did it: #623

With this patch it'll throw a different error. You probably want there to be no error but without additional detail there's no way I know to know what's going on 😅 .

@robbieaverill
Copy link
Contributor

Fixed by #623?

@robbieaverill
Copy link
Contributor

The fix is what I would've expected to do to fix this error, so closing as "fixed"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants