cms icon indicating copy to clipboard operation
cms copied to clipboard

[3.7.47]: Entry `uri` contains weird "_temp_{junk}/nice-entry-title" URL after having duplicated content

Open kruncher opened this issue 1 year ago • 3 comments

What happened?

Description

The CMS had the following entries in a structure:

  • Example page
    • Second page of guide

For the purposes of testing having more content the "Example page" entry was duplicated (children included).

The root page was duplicated whilst viewing the "English" version of the site. The issue occurs when querying entries from the "Welsh" version of the site.

When doing a GraphQL query I now see the following on the duplicated entry:

"uri": "__temp_hkjoqrkmfbuqlfjkytcrnricnzkdyiotqhoz-2/second-page-of-guide-2",

This is a multi-site setup where the entries are set to "Save entries to all sites enabled for this section". The "Entry URI Format" for both the English and Welsh sites is {parent.uri}/{slug}

Steps to reproduce

Inside a two-language site:

  1. Construct simple page hierarchy.
  2. Duplicate root page (and children) in "English" site.
  3. Run GraphQL query with $site set to name of "Welsh" site:
    query Test($site: [String]) {
        entries(site: $site) {
            uri
        }
    }
    

Expected behavior

Duplicate entry should have a more appropriate uri.

Actual behavior

Queried uri has some sort of temporary identifier.

Craft CMS version

3.7.47

PHP version

7.2.34

Operating system and version

Linux 5.10.25-linuxkit

Database type and version

MySQL 8.0.25

Image driver and version

Imagick 3.4.4 (ImageMagick 7.0.10-48)

Installed plugins and versions

  • Google Cloud Storage 1.4.1
  • Redactor 2.10.10
  • Super Table 2.7.2
  • Webhooks 2.4.1

kruncher avatar Jul 19 '22 09:07 kruncher

I’m unable to reproduce this. Are you seeing it consistently? Are you waiting for the “Updating element slugs and URIs” queue job to complete before running the GraphQL query? (That job is responsible for setting all of the descendant entry URIs, when a parent entry is saved.)

brandonkelly avatar Jul 25 '22 12:07 brandonkelly

There are no queued jobs in the CMS and this issue is persistent (in the sense, the query always returns this). Is there a way to force the "Updating element slugs and URIs" job to occur again?

kruncher avatar Jul 26 '22 08:07 kruncher

Yep, just resave the parent entry and that job should get added again.

brandonkelly avatar Jul 26 '22 14:07 brandonkelly

Resaving did resolve the immediate issue although not sure what the original cause would have been.

kruncher avatar Sep 23 '22 10:09 kruncher

Alright, well I’m going to go ahead and close this for now since we can’t figure out how to reproduce. We can revisit if more details come to light though.

brandonkelly avatar Oct 04 '22 20:10 brandonkelly