Jump to content

"LOCATION_UNKNOWN" Error.


Go to solution Solved by Stuart Grimshaw,

Recommended Posts

Posted (edited)

Following on from the Laravel topic earlier this year, I'm trying to invoke the GraphQL class from my Laravel app and I'm getting the following error:

[2024-05-10 10:35:05] dev.ERROR: LOCATION_UNKNOWN {"exception":"[object] (RuntimeException(code: 0): LOCATION_UNKNOWN at /Users/stuart/Projects/brfcs/brfcs/ips_a1ee4/system/Session/Session.php:61)

Even the simple example in the other thread gives the same error, the main difference from February is I've updated to the latest version and installed the dev tools.

Edited by Stuart Grimshaw
Added link to thread.
Link to comment
Share on other sites

This is the block of code that's throwing the error:

if( class_exists( 'IPS\Dispatcher', FALSE ) )
{
    $location = ( \IPS\Dispatcher::hasInstance() ) ? mb_ucfirst( \IPS\Dispatcher::i()->controllerLocation ) : 'Front';
    $classname = 'IPS\Session\\' . $location;
}
else
{
    throw new \RuntimeException('LOCATION_UNKNOWN');
}

that's a clip from Session.php. In my Laravel controller I'm callingt the GraphQL command as described in the documentation

Here's a copy of the controller:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Inertia\Inertia;

class InvisionController extends Controller
{
    /**
     * Returns a JSON string of the users account information in the response.
     *
     * @return \Inertia\Response
     */
    public function show(Request $request)
    {
        $query = '{core{me}}';
        $result = \IPS\Api\GraphQL::execute($query);
        // $result = \IPS\Member::loggedIn()->name;

        return Inertia::render('Invision', ['result' => $result]);
    }
}

Could it be related to the fact this controller is using Inertia to render it's view? The error though occurs before it gets to that point doesn't it, when it calls `GraphQL::execute()`

Link to comment
Share on other sites

The reason I was asking about oauth is that I'm trying to integrate the Strapi based news section of our website with the forums so that our forum users can comment on articles. If they are already logged in to the forum, I don't want them to then have to log in again to leave a comment, or have the oauth journey ask them if they want to give permission for what is to them the same website.

I'm thinking now that I might "just" have Strapi use the GraphQL API with an access key as a system user to create a new thread in a forum when it publishes an article, retreive the existing comments to display, but then redirect users to the actual thread to leave a comment.

I don't like that approach, but we have a deadline and it would at least enable the feature for us, albeit with a clunky way of getting back to the article after you leave a comment.

Is there a better way to acheive what I'm trying to do?

Link to comment
Share on other sites

  • 2 weeks later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...