Closed mihob closed 2 years ago
We were running into the same issue unfortunately, I've created a pull request with a proposed solution @angrybrad @brandonkelly , would be great if this could be fixed soon, our client uses the preview functionality a lot :)
Hey element api team, could you take a look at this issue for us? Our client is using this preview function and would love to have it working again. Many thanks at forehand!
Hi all,
Was wondering if this plugin is actively maintained still, if so, would be great to have this fix included -- otherwise we can switch to a fork without much worry for a while and look into switching to GraphQL fully.
Just released Element API 2.8.5 with the fix for this, provided by #159. Thanks a lot @FreekVR!
Description
If
x-craft-live-preview
parameter is present in request andcache
is present inelement-api config for endpoint
, the element api request results in an server error with the following log message:[error][craft\elementapi\controllers\DefaultController::actionIndex] Error resolving Element API endpoint: Setting unknown property: craft\elementapi\resources\ElementResource::cache
This in
src/DefaultController.php
seems to be the problem:cache
should probably always be removed from$config
. The error was introduced in commitfb92fef
Steps to reproduce
cache
must be present inelement-api config
for endpointx-craft-live-preview
parameter present in urlAdditional info