Scope of Domain Source module

Created on 21 May 2017, over 7 years ago
Updated 26 July 2024, 4 months ago

There is certain behavior when we use Domain Source module in a project with Domain Access module.

Following are the points which can describe the scenario:

  1. Action Links for nodes in Content overview page contains selected Domain source as Base url instead of active Domain url. This is fine since it is mentioned earlier that in Drupal8 links/route are based on canonical URL.

  2. On adding comments on a node http://domain-2/test-node which has accesses on both "Domain-1" & "Domain-2" but having domain source on http:/domain-1/test-node,

    redirecting to a URL with Domain-1 as base URL: http:/domain-1/test-node#comment-1 giving below error:

    Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it

    • If a Node is opened on a Domain other than its source domain then actions like adding comment on the node should lead to active domain as base source URL not the Domain source URL
    • Even though on adding all the domain records in "settings.php" as trusted hosts this error is not going.
  3. On editing the same node on "Domain-2" other than its domain source ("Domain-1") does not lead to successful ajax requests, by giving below error:
    jquery.min.js:4 POST http://init.local:8888/vznrw-develop/en/node/547/edit?ajax_form=1&_wrapper_format=drupal_ajax 403 (Forbidden)
    
    VM428 edit:1 XMLHttpRequest cannot load http://init.local:8888/vznrw-develop/en/node/547/edit?ajax_form=1&_wrapper_format=drupal_ajax. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8888' is therefore not allowed access. The response had HTTP status code 403.
    
    ajax.js:965 Uncaught 
    Drupal.AjaxError {message: "↵An AJAX HTTP request terminated abnormally.↵Debug…=1↵StatusText: error↵ResponseText: ↵ReadyState: 0", name: "AjaxError"}
    
    message
    An AJAX HTTP request terminated abnormally.↵Debugging information follows.↵Path: http://init.local:8888/vznrw-develop/en/node/547/edit?ajax_form=1↵StatusText: error
    
    Error at http://localhost:8888/vznrw-develop/core/misc/ajax.js?v=8.3.2:181:32 at http://localhost:8888/vznrw-develop/core/misc/ajax.js?v=8.3.2:13
    

    where,
    Domain-1 = "http://init.local:8888"
    Domain-2 = "http://localhost:8888"

    this happens on just clicking "Add another item" button for any multi-value field. If a node has given access on domains other than its source domain then at least editing should work with in its all.

So all these scenarios has puzzled me a little bit. That should we use Domain Source module or not.

What is required in our project =>

  1. Nodes can be assigned to Domain Source so that we have canonical URLs for SEO
  2. But if a node is assigning access and edit on other domains then links for that node at all places like views, actions, including Content Overview page should be with its active domain as base url not the domain source.
  3. Editing and actions like post comment save redirection should also lead to its accessible active domain not the Domain Source.

Does above all could be provided without using Domain Source module?
What is the scope or usage of Domain Source module ? When to use and when not?

A README.txt might be helpful in this case.

🐛 Bug report
Status

Fixed

Version

1.0

Component

- Domain Source

Created by

🇩🇪Germany nghai

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇱Netherlands florisg

    I stumbled upon this issue when mixed content http(s) errors occurred in editor screens.
    No need to re-open this issue.
    For reference when people find this again to help them solve their problem.

    Thank you maintainers for having this module in Drupal 8+
    These issues are merely configuration.

    In example not setting the domain source or allowing it to be accessible from other domains.
    There is even a config option to fix these AJAX errors when behind proxy or localhost
    You find it under /admin/config/domain/domain_source

Production build 0.71.5 2024