Skip to content

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

Merged
kosarko merged 3 commits into
clarin-v7from
152-bitstream-editing-save-redirects-to-bad-url
Jun 19, 2026
Merged

fix(bitstream): restore item UUID in edit redirect#154
kosarko merged 3 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.

amadulhaxxani and others added 2 commits June 18, 2026 13:19
fix(bitstream): improve fallback navigation and error handling
@kosarko kosarko merged commit b4d2fac into clarin-v7 Jun 19, 2026
8 checks passed
@port-pr

port-pr Bot commented Jun 19, 2026

Copy link
Copy Markdown

Backport branch created but failed to create PR.
Request to create PR rejected with status 403.

Please create the PR manually:

Or via GitHub CLI:

gh pr create --repo dataquest-dev/dspace-angular --base dtq-dev --head ufal:backport-154-to-dtq-dev --title "[Port dtq-dev] fix(bitstream): restore item UUID in edit redirect" --body "Port of #154 by @amadulhaxxani to `dtq-dev`."

(see action log for full error response)

milanmajchrak pushed a commit to dataquest-dev/dspace-angular that referenced this pull request Jun 23, 2026
…1319)

* fix(bitstream): restore item UUID in edit redirect

fix(bitstream): restore item UUID in edit redirect

* fix(bitstream): improve fallback navigation and error handling

fix(bitstream): improve fallback navigation and error handling

* proper cleanup on destroy

(cherry picked from commit b4d2fac)

Co-authored-by: Amad Ul Hassan <hassan@ufal.mff.cuni.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bitstream editing -> Save redirects to bad URL

3 participants