Steps to reproduce

  1. When stub entity is created with a random title path alias is generated for it.
  2. After that when the data in stub entity is replaced with the real data, title is changing and it causes generation of redirect from alias generation in step 1 to new.

Proposed resolution

On the phase of stub entity creation skip path alias generation.

CommentFileSizeAuthor
#4 2986304-4.patch1019 bytesaxicdv
#2 2986304-2.patch4.36 KBaxicdv

Comments

axicdv created an issue. See original summary.

axicdv’s picture

Status: Active » Needs review
StatusFileSize
new4.36 KB
jeqq’s picture

Project: Replication » Multiversion
Status: Needs review » Needs work

@axicdv Thank you for this fix!

The fix idea looks good but we can avoid duplicating that code in so many places. The simplest way to do it, is to do that check and set the skip value right before saving the entity in ContentEntityStorageTrait::save(), in Multiversion module (before try/catch statement).

How the code should look:

     // We prohibit creation of the url alias for entities with a random label,
    // because this can lead to unnecessary redirects.
    if ($entity->_rev->is_stub && isset($entity->path->pathauto)) {
      $entity->path->pathauto = PathautoState::SKIP;
    }

Moving the issue to Multiversion.

axicdv’s picture

Status: Needs work » Needs review
StatusFileSize
new1019 bytes

Status: Needs review » Needs work

The last submitted patch, 4: 2986304-4.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

timmillwood’s picture

Status: Needs work » Needs review

  • jeqq committed da895a8 on 8.x-1.x authored by axicdv
    Issue #2986304 by axicdv, jeqq, timmillwood: Path alias generated for...
jeqq’s picture

Status: Needs review » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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