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
Issue fork jsonapi_query_builder-3515617
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
Comment #3
mglamanComment #4
mglamanThere 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...
Comment #9
balsamaStarted 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:
Comment #10
mglamanLooks good to me! Combines needed fixes from https://git.drupalcode.org/project/jsonapi_query_builder/-/merge_requests/1 and https://git.drupalcode.org/project/jsonapi_query_builder/-/merge_requests/2 plus more fixes.
Comment #12
grasmash commentedComment #13
skinio commentedGreat fix. Please make it as a release becouse v1.0.1 witch is installed as default is way behind :/