-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 when registering transformer #27
Comments
Running the latest version? |
Yep, just did a |
Can you paste the full exception stack trace please. |
[2014-05-05 11:27:26] local.ERROR: exception 'ErrorException' with message 'explode(): Empty delimiter' in C:\ampps\www\bjga\scheduler\vendor\dingo\api\src\Transformer.php:228 Stack trace: #0 [internal function]: Illuminate\Exception\Handler->handleError(2, 'explode(): Empt...', 'C:\ampps\www\bj...', 228, Array) #1 C:\ampps\www\bjga\scheduler\vendor\dingo\api\src\Transformer.php(228): explode('', '') #2 C:\ampps\www\bjga\scheduler\vendor\dingo\api\src\Transformer.php(96): Dingo\Api\Transformer->setRequestedScopes() #3 C:\ampps\www\bjga\scheduler\vendor\dingo\api\src\Http\Response.php(50): Dingo\Api\Transformer->transformResponse(Object(Scheduler\Models\Eloquent\ServiceModel)) #4 C:\ampps\www\bjga\scheduler\vendor\dingo\api\src\Routing\Router.php(166): Dingo\Api\Http\Response->morph('json') #5 C:\ampps\www\bjga\scheduler\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(738): Dingo\Api\Routing\Router->dispatch(Object(Illuminate\Http\Request)) #6 C:\ampps\www\bjga\scheduler\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(708): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request)) #7 C:\ampps\www\bjga\scheduler\vendor\dingo\api\src\Http\Middleware\RateLimit.php(96): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true) #8 C:\ampps\www\bjga\scheduler\vendor\dingo\api\src\Http\Middleware\Authentication.php(102): Dingo\Api\Http\Middleware\RateLimit->handle(Object(Illuminate\Http\Request), 1, true) #9 C:\ampps\www\bjga\scheduler\vendor\laravel\framework\src\Illuminate\Http\FrameGuard.php(38): Dingo\Api\Http\Middleware\Authentication->handle(Object(Illuminate\Http\Request), 1, true) #10 C:\ampps\www\bjga\scheduler\vendor\laravel\framework\src\Illuminate\Session\Middleware.php(72): Illuminate\Http\FrameGuard->handle(Object(Illuminate\Http\Request), 1, true) #11 C:\ampps\www\bjga\scheduler\vendor\laravel\framework\src\Illuminate\Cookie\Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true) #12 C:\ampps\www\bjga\scheduler\vendor\laravel\framework\src\Illuminate\Cookie\Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true) #13 C:\ampps\www\bjga\scheduler\vendor\stack\builder\src\Stack\StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true) #14 C:\ampps\www\bjga\scheduler\vendor\laravel\framework\src\Illuminate\Foundation\Application.php(606): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request)) #15 C:\ampps\www\bjga\scheduler\public\index.php(49): Illuminate\Foundation\Application->run() #16 {main} [] [] |
Having a hard time reproducing this. Only thing I can think of is it being on Windows as I've not tested it at all in a Windows environment. Can you try dumping out other configuration items and see if they're loaded correctly? |
I just tried to dump the version number out of the config file in the service provider's In In For whatever reason, the API config file doesn't seem to be available in |
No it shouldn't be possible to call it inside Okay so this doesn't produce anything for you? $this->app['dingo.api.transformer'] = $this->app->share(function($app)
{
dd($app['config']['api::embeds']);
return new Transformer(new Fractal, $app, $app['config']['api::embeds.key'], $app['config']['api::embeds.separator']);
}); Dumping other config keys there produce anything? |
Nothing, just an empty array no matter which of the values I try to dump. |
But you can dump the exact same thing ( |
In Strangely enough, grabbing other nested array items doesn't have the same issue (like |
I've had a go at this on Windows and am still unable to reproduce. Sorry, not much more I can do here I don't think. |
No biggie. I'll have to keep digging through things and see if I can figure it out. Thanks for your help! |
I'm trying to get transformers working and I keep getting an error exception that the delimiter is empty. I've tracked this down to the registration of the transformer in the service provider and when I dump the
$app['config']['api::embeds']
I get an empty array instead of what's in the config file. (I did a freshconfig:publish
just to be sure.) Any reason why the service provider wouldn't be able to grab those config values?The text was updated successfully, but these errors were encountered: