New condition in AliasRepository->lookupBySystemPath to load aliases that has not "alias" null

Created on 17 April 2023, over 1 year ago
Updated 18 April 2023, over 1 year ago

Problem/Motivation

Empty path alias name messing up processPath function

if I create path alias that has null as alias field, AliasRepository does not add criteria for "alias" field to not be null, as a result it returns object that has not set alias field, then in the UrlGenerator->processPath expect "alias" to be set and passes it to processOutbound

Steps to reproduce

Create path alias record that has alias field null, then try to load that page

Proposed resolution

Add one condition in lookupBySystemPath function to query which excludes path aliases that has alias null:

    $select = $this->getBaseQuery()
      ->fields('base_table', ['id', 'path', 'alias', 'langcode'])
      ->condition('base_table.path', $this->connection->escapeLike($path), 'LIKE')
      ->condition('base_table.alias', NULL, 'IS NOT NULL');

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

9.5

Component
PathΒ  β†’

Last updated 6 days ago

  • Maintained by
  • πŸ‡¬πŸ‡§United Kingdom @catch
Created by

πŸ‡¬πŸ‡ͺGeorgia chilaa

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.

Production build 0.71.5 2024