FIX: missing class, backwards compatibility with PHP7.4

This commit is contained in:
Tony Air 2023-12-14 02:58:44 +02:00
parent 34a0f71edc
commit 986f9435dd
2 changed files with 3 additions and 2 deletions

View File

@ -35,7 +35,7 @@ class ObjectGraphQlEx extends Extension
//$var = URLLinkablePlugin::config()->get('single_field_name');
$var = 'url';
if ($curr::class === GraphQLController::class) {
if (get_class($curr) === GraphQLController::class) {
$vars = json_decode($curr->getRequest()->getBody(), true)['variables'];
if (isset($vars[$var])) {
$link = $vars[$var];

View File

@ -18,6 +18,7 @@ use SilverStripe\GraphQL\Schema\Schema;
use SilverStripe\ORM\ArrayList;
use SilverStripe\View\ArrayData;
use SilverStripe\View\SSViewer;
use SilverStripe\View\ViewableData;
if (!interface_exists(ModelQueryPlugin::class)) {
return;
@ -219,7 +220,7 @@ class URLLinkablePlugin implements ModelQueryPlugin
protected static function findAction($controller, $request)
{
$handlerClass = $controller::class;
$handlerClass = get_class($controller);
// We stop after RequestHandler; in other words, at ViewableData
while ($handlerClass && $handlerClass != ViewableData::class) {