loadsys / loadsys/CakePHP-Serializers

Serializers don't work great with non-table-based controllers.

Open
#127 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PHP
Stars
6
Forks
1
PR merge metrics
No merged PRs in 30d

Description

A serializer must be pre-defined in order for the dispatch filter to successfully create a serializer instance during dispatch.

Warning (2): dirname() expects parameter 1 to be string, array given [APP/Vendor/cakephp/cakephp/lib/Cake/Utility/File.php, line 87]
Warning (2): is_dir() expects parameter 1 to be a valid path, array given [APP/Vendor/cakephp/cakephp/lib/Cake/Utility/File.php, line 88]
Warning (2): basename() expects parameter 1 to be string, array given [APP/Vendor/cakephp/cakephp/lib/Cake/Utility/File.php, line 89]
( ! ) Fatal error: Call to undefined method File::schema() in /var/www/Plugin/Serializers/Lib/SerializerFactory.php on line 49
Call Stack
#   Time    Memory  Function    Location
1   0.0005  253576  {main}( )   ../index.php:0
2   0.0405  3904472 Dispatcher->dispatch( ) ../index.php:99
3   0.0555  4922520 Dispatcher->_invoke( )  ../Dispatcher.php:167
4   0.1216  8867560 Controller->render( )   ../Dispatcher.php:200
5   0.1498  9740112 CakeSerializerView->render( )   ../Controller.php:960
6   0.1500  9742056 EmberDataSerializerView->toJSON( )  ../CakeSerializerView.php:46
7   0.1505  9752032 Serialization->serialize( ) ../EmberDataSerializerView.php:26
8   0.1514  9767920 SerializerFactory->generate( )  ../Serialization.php:47
{"cake_errors":[]}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the dispatch failure described in the issue, starting at SerializerFactory.php line 49 and tracing the dispatch and render path through Dispatcher, Controller, CakeSerializerView, EmberDataSerializerView, and Serialization. Compare behavior for table-based and non-table-based controllers; done means the non-table case no longer produces the shown warnings and fatal error.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.