Skip to content

fix(bitstream): restore item UUID in edit redirect#154

Open
amadulhaxxani wants to merge 2 commits into
clarin-v7from
152-bitstream-editing-save-redirects-to-bad-url
Open

fix(bitstream): restore item UUID in edit redirect#154
amadulhaxxani wants to merge 2 commits into
clarin-v7from
152-bitstream-editing-save-redirects-to-bad-url

Conversation

@amadulhaxxani

Copy link
Copy Markdown

Problem description

When editing a bitstream (from the item bitstreams page) and clicking Save or Cancel, the user is redirected to items/edit/bitstreams instead of items/<UUID>/edit/bitstreams. The item UUID is missing from the redirect URL.

Analysis

The redirect uses this.itemId to construct the URL. This value comes from:

  • Route query parameters (itemId) – missing when navigating from the item bitstreams page edit button.
  • Async resolution from bundle.item in ngOnInit – may not have completed or may be undefined if the link is not resolved on the Bundle model.

The edit button in item-edit-bitstream-bundle.component.html only uses [routerLink] without passing query params. The fallback logic in navigateToItemEditBitstreams() was removed previously, so navigation proceeds with undefined itemId.

Copilot review

  • Requested review from Copilot

fix(bitstream): restore item UUID in edit redirect
@amadulhaxxani amadulhaxxani linked an issue Jun 17, 2026 that may be closed by this pull request
@amadulhaxxani amadulhaxxani requested a review from kosarko June 17, 2026 13:41
@kosarko kosarko requested a review from Copilot June 17, 2026 14:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes redirects after editing a bitstream so users return to the correct item bitstreams edit page (/items/<UUID>/edit/bitstreams or /entities/<type>/<UUID>/edit/bitstreams) instead of a URL missing the item UUID.

Changes:

  • Pass itemId (and entityType) as query params when navigating from the item bitstreams table to the bitstream edit page.
  • Reintroduce fallback logic in the bitstream edit page to resolve itemId from the owning bundle’s item link when query params are missing.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/app/item-page/edit-item-page/item-bitstreams/item-edit-bitstream-bundle/item-edit-bitstream-bundle.component.html Adds query params (itemId, entityType) to the “Edit bitstream” routerLink so redirects can reconstruct the correct item edit route.
src/app/bitstream-page/edit-bitstream-page/edit-bitstream-page.component.ts Restores item resolution logic in navigateToItemEditBitstreams() to prevent redirects from losing the item UUID when query params aren’t present.

fix(bitstream): improve fallback navigation and error handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bitstream editing -> Save redirects to bad URL

2 participants