Comments (4)
Can you share your elementapi.php
file?
from element-api.
Hi,
Referring to endpoints elementapi.php
list/slug:{slug}.json
list/handle:{handle}/slug:{slug}.json
I am using two classes ListTransformer and DetailTransformer
The purpose of the two different classes is that I may be able to select collection versus single instance results. Its still in its infancy though but has a good road map.
These two classes extend FieldTransformer
When I was referring to data through the ListTransformer I was receiving paginated meta keys as well and no errors.
Then using the DetailTransformer class I was using 'first' => true, and errors were resulting.
I was printing the objects that were being returned in ListTransformer and DetailTransformer prior to being converted to JSON and structurally they were exactly the same except when passing to Fractal it chokes.
There is a temporary fix on single instance results in DetailTransformer class
return array('data' => $result);
from element-api.
Ahh, looks like that's going to be pretty difficult to try and replicate locally. If you enable devMode, do you get a full stack trace with the error? Might give some insight into where it's coming from (3rd party plugin related, etc.). Also, if you've got xDebug installed, probably worth setting some strategic breakpoints in ElementApiController and stepping through to see what's happening.
from element-api.
Ok rabbit hole incident expecting an array and was passing an object, confusion was with the collections being objects within an array.
Thanks
from element-api.
Related Issues (20)
- CORS problem on v2.8.2, but not 2.7.0 HOT 1
- Element API endpoints now always throw 500 instead of 404 error HOT 5
- Server Error on Live Preview HOT 4
- ElementApi returns 500 if site handle is not found HOT 3
- EVENT_BEFORE_SEND_DATA event not working HOT 6
- Cache false not working HOT 1
- 500 errors after upgrade to Craft 3.7.47.1 and plugin 2.8.6 HOT 6
- Error resolving Element API endpoint after updating to V2.8.6 HOT 2
- OrderBy custom fields does not give correct results HOT 2
- Element API tries to access GeneralConfig::baseUrl HOT 1
- 404 Not Found — JSON URL / UrlHelper HOT 1
- Or condition criteria not working as in template HOT 16
- All requests blocked while generating image transforms
- JS fetch request works from Craft frontend, but not from a different subdomain
- Output of Float Numbers - Rounding Not Enforced HOT 2
- Endpoint Caching While in Dev Mode HOT 3
- `postDate` is not respected as cache TTL HOT 2
- Pagination No Longer Working after Update to v4.1.0 HOT 3
- Fixed order based on slug HOT 1
- Element API endpoint url for multisites?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from element-api.