Questions tagged as ['uri']
I am working with books in drupal 8. I want to display a specific page("table of contenets") on the sidebar whenever any page of that book is accessed. "table of contents" is a book page. every page of book has two id's.
- page_id
- book_id
Page_id is unique for every page but book id is same for all pages. I believe contextual filter based on book_id might solve my issue. but I don't know how to add c ...
I have GeoJSON feed, created with a view in Drupal 7, that I want to filter on a path value in the url of the loaded page (/path/%). The feed is loaded as an Openlayers map on a page. The feed seem to work with its own feed-url and is not aware of the site url. Contextual filters in the view don't work either. I can use hook_views_query_alter or hook_views_pre_view. But I don't know how to bring the val ...
I am trying to get the base url of the drupal 8 website in a queue process but I am getting http://default as the base url. What am I missing here?
public function testUrl() {
global $base_url;
var_dump($base_url);
$host = \Drupal::request()->getSchemeAndHttpHost();
var_dump($host); // output - http://default
$host2 = \Drupal::request()->getHost();
var_dump($host2); ...
Occasionally I am encountering an error along these lines:
The website encountered an unexpected error. Please try again later.InvalidArgumentException: The URI 'XYZ' is invalid. You must use a valid URI scheme. in Drupal\Core\Url::fromUri() (line 290 of core/lib/Drupal/Core/Url.php).
We are migrating data frequently and one thing that can happen is link field URIs can come in like that. The core Link ...
I'm using the following jsonapi GET request to retrieve product variations for a product:
/jsonapi/commerce_product/default/0ea927c7-b62d-45c9-8bec-dc3d16215276/variations?include=field_images
However, the response does not include the file url for the media:
{
"type": "media--image",
"id": "6af50149-ae35-4a3b-802d-b21c5d863235",
"links": {
"self": {
"href": "http://myurl/en/jsonapi/media/image/6 ...

I recently upgraded from Drupal 8 to Drupal 9 and noticed a problem that occurs when the URL has a query string. For example for the following URL Drupal throws a 404 page not found.
https://example.com/2021/07/how-drive-cruise-ship&ct=ga&cd=EAEYACoTMzczMDU5MTUxNjcwNDQyMzUxNzIcN2RiZjYwOGY4MzE2NmM3OTpjby51azplbjpHQg&usg=AFQjCNEa2-Hx3zqnQ59AJFnde_ORtLTvgA
In Drupal 7, the following URLs show the same node.
- http://www.example.com/node/5
- http://www.example.com/node/5/randomtext1
- http://www.example.com/node/5/randomtext2
- http://www.example.com/node/5/randomtext3
This doesn't happen in Drupal 8.
How can those URLs be disabled?