Problem/Motivation

If the path prefix for JSON:API has been customized, the module will break. See https://git.drupalcode.org/project/jsonapi_query_builder/-/blob/1.0.x/sr...

  public function explorer() {
    $base_url = Url::fromRoute('<front>', [], ['absolute' => TRUE])->toString();
    $jsonapi_url = $base_url . 'jsonapi';

Steps to reproduce

Proposed resolution

Generate the URL from the jsonapi.resource_list route with setAbsolute.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mglaman created an issue. See original summary.

mglaman’s picture

Status: Active » Needs review
mglaman’s picture

Status: Needs review » Needs work

There is to this in App.js

https://git.drupalcode.org/project/jsonapi_query_builder/-/blob/1.0.x/js...

I don't know why jsonapi is hardcoded here. Especially when a URL object could be used to pop the path from the absolute URL passed in. It's also duplicated in https://git.drupalcode.org/project/jsonapi_query_builder/-/blob/1.0.x/js...

grasmash made their first commit to this issue’s fork.

balsama made their first commit to this issue’s fork.

balsama’s picture

Status: Needs work » Needs review

Started a new branch that allows this to work with customizations to jsonapi.base_path and when running Drupal in a subdirectory.
Here's a demo of it running:

  1. In a subdirectory with no modifications to jsonapi.base_path
  2. In a subdirectory with jsonapi.base_path set to /foo
  3. In a subdirectory with jsonapi.base_path set to /foo/bar

Only local images are allowed.

mglaman’s picture

Status: Needs review » Reviewed & tested by the community

grasmash’s picture

Status: Reviewed & tested by the community » Fixed
skinio’s picture

Great fix. Please make it as a release becouse v1.0.1 witch is installed as default is way behind :/

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.