Microsite domain paths are doubled with Domain Source

Created on 3 June 2024, 11 months ago
Updated 11 September 2024, 7 months ago

If you duplicate the conditions - Redirect installed, "Enforce clean and canonical URLs" enabled - and then apply the patch for πŸ› Microsite redirect to the default domain when "Enforce clean and canonical URLs." in the redirect module settings is enabled Active you find that the microsite links for nodes assigned to the microsite domain with the domain_source field will double up the microsite path when rendered.

For instance, if the microsite Atom's domain path is "/atom" , the front page of the site is set to /node/6, and node 6 is assigned to the microsite domain Atom, then when you go to the Atom domain front page - https://my.host/atom - the "View" link of node 6 is linking to /atom/atom/node/6.

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States brad.bulger

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

Comments & Activities

  • Issue created by @brad.bulger
  • πŸ‡ΊπŸ‡ΈUnited States brad.bulger

    There's an additional unrelated problem, that I have to fix to do anything about this issue. In DomainMicrositePathProcessor::processOutbound(), there is a line:

    $domain_source = array_shift(array_column($entity->get('field_domain_source')->getValue(), 'target_id'));
    

    The argument for array_shift() is passed by reference, so it has to be a variable. The array_column() call has to be stored and then passed to array_shift().

    $target_ids = array_column($entity->get('field_domain_source')->getValue(), 'target_id');
    $domain_source = array_shift($target_ids);
    
  • πŸ‡ΊπŸ‡ΈUnited States brad.bulger

    Domain Source isn't dependent on Domain Access (at least it isn't anymore). I separated the changes made for the fields of each module so that it will work for either or both.

  • πŸ‡ΊπŸ‡ΈUnited States drpldrp San Francisco, CA

    Fixed in 2.0.0-beta6.

  • Status changed to Fixed 7 months ago
  • πŸ‡ΊπŸ‡ΈUnited States drpldrp San Francisco, CA
Production build 0.71.5 2024