File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,10 +75,11 @@ export const itemPageResolver: ResolveFn<RemoteData<Item>> = (
7575 map ( ( rd : RemoteData < Item > ) => {
7676 store . dispatch ( new ResolvedAction ( state . url , rd . payload ) ) ;
7777 if ( rd . hasSucceeded && hasValue ( rd . payload ) ) {
78+ const itemRoute = router . parseUrl ( getItemPageRoute ( rd . payload ) ) . toString ( ) ;
7879 // Check if custom url not empty and if the current id parameter is different from the custom url redirect to custom url
7980 if ( hasValue ( rd . payload . metadata ) && isNotEmpty ( rd . payload . metadata [ 'cris.customurl' ] ) ) {
8081 if ( route . params . id !== rd . payload . metadata [ 'cris.customurl' ] [ 0 ] . value ) {
81- const newUrl = state . url . replace ( route . params . id , rd . payload . metadata [ 'cris.customurl' ] [ 0 ] . value ) ;
82+ const newUrl = itemRoute . replace ( route . params . id , rd . payload . metadata [ 'cris.customurl' ] [ 0 ] . value ) ;
8283 router . navigateByUrl ( newUrl ) ;
8384 }
8485 } else {
@@ -88,7 +89,6 @@ export const itemPageResolver: ResolveFn<RemoteData<Item>> = (
8889 // or semicolons) and thisRoute has been encoded with that function. If we want to compare
8990 // it with itemRoute, we have to run itemRoute through Angular's version as well to ensure
9091 // the same characters are encoded the same way.
91- const itemRoute = router . parseUrl ( getItemPageRoute ( rd . payload ) ) . toString ( ) ;
9292
9393 if ( ! thisRoute . startsWith ( itemRoute ) ) {
9494 const itemId = rd . payload . uuid ;
You can’t perform that action at this time.
0 commit comments