Problem/Motivation

The UrlToEntity service considers a list of domains to be "internal" to the site. This list must be manually configured, which can be a maintenance burden for a multisite and/or different environments.

Proposed resolution

An option can be added that always adds the current domain to the list of domains, taken from the current request object.

User interface changes

An option is added below the list of domains in the settings form.

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

dennis_meuwissen created an issue. See original summary.

dennis_meuwissen’s picture

Status: Active » Needs review
marcoscano’s picture

Assigned: dennis_meuwissen » Unassigned
Issue tags: -url to entity, -host, -domain +Needs tests

👍 sounds good to me, I can't think of a downside. We just need test coverage for the new functionality.
Thanks!

marcoscano’s picture

Status: Needs review » Needs work
dennis_meuwissen’s picture

Status: Needs work » Needs review

Added some tests for the UrlToEntity changes and the settings form checkbox. My first ever tests for a contrib module, so I hope they are ok...

alexpott’s picture

Version: 8.x-2.x-dev » 5.x-dev
Category: Feature request » Task
Priority: Minor » Normal

I think this is a great idea - don't really feel it is a feature or needs configuration - it should just work this way out of the box.

I think we'll only implement in the 5.x branch as that is receiving all the new stuff and 8.x-2.x is basically on support only.

alexpott’s picture

Title: Option to include current domain in UrlToEntity » Automatically use current domain in UrlToEntity
Issue tags: -Needs tests
alexpott’s picture

Status: Needs review » Reviewed & tested by the community

This results in us not having to set this in config in tests - a nice proof that this is a good idea.

  • alexpott committed 2d751e03 on 5.x
    task: #3556635 Automatically use current domain in UrlToEntity
    
    By:...
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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