Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After removing the AliasPart from a content type, the indexed content items are still queried by the alias handle #16410

Closed
dmourtzoukos opened this issue Jul 9, 2024 · 4 comments
Milestone

Comments

@dmourtzoukos
Copy link

Describe the bug

After removing the AliasPart from a content type, the indexed content items are still queried by the alias handle

Orchard Core version

1.8.3

To Reproduce

Steps to reproduce the behavior:

  1. Create a Content Type with an Alias Part.
  2. Create a Content Item of this type and give it an alias.
  3. Create a Controller method that gets an alias as a parameter and a view that calls the GetContentItemByAliasAsync (which queries the AliasPartIndex) for the passed alias.
  4. Navigate to this page and pass the alias of the Content Item created on step 2. The Content Item will be displayed on the page.
  5. Remove the Alias Part from the Content Type.
  6. Navigate again to the page of step 4. The Content Items still gets displayed.

Expected behavior

After removing the Alias Part from the Content Type, the page should not display the Content Item, since the Content Type doesn't contain an Alias Part anymore.

Copy link
Contributor

github-actions bot commented Jul 9, 2024

Thank you for submitting your first issue, awesome! 🚀 We're thrilled to receive your input. If you haven't completed the template yet, please take a moment to do so. This ensures that we fully understand your feature request or bug report. On what happens next, see the docs.

@Piedone Piedone added the Alias label Jul 9, 2024
@Piedone
Copy link
Member

Piedone commented Jul 9, 2024

While this bug is about Alias Part, the same would happen with any part. In general, if you remove a content part from a content type, its data for previously created items are not deleted. So, both data in the content items' documents and corresponding rows in index tables remain.

When publishing these items the next time, the data should be removed, however (or shouldn't be retained for the new version).

So, if you want to fix this issue right now, a workaround is to (programmatically) republish all affected content items. The longer-term solution is #8316. I don't think anything is needed for Alias Part, specifically, and this issue can be closed. But thank you for taking the time to detail your inquiry!

@sebastienros sebastienros added this to the 2.x milestone Jul 11, 2024
Copy link
Contributor

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

@sebastienros
Copy link
Member

Let's follow up with #8316

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants