Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Ensure that relative urls are respected

Aaron Contreras3e57d488b8af
diff --git a/frontend/src/stimulus/controllers/dynamic/work-packages/progress/preview-progress.controller.ts b/frontend/src/stimulus/controllers/dynamic/work-packages/progress/preview-progress.controller.ts
index 9bf30325a46..091f5cdf8ef 100644
--- a/frontend/src/stimulus/controllers/dynamic/work-packages/progress/preview-progress.controller.ts
+++ b/frontend/src/stimulus/controllers/dynamic/work-packages/progress/preview-progress.controller.ts
@@ -104,8 +104,9 @@ export default class PreviewProgressController extends Controller {
private ensureValidPathname(formAction:string):string {
const wpPath = new URL(formAction);
- if (wpPath.pathname === '/work_packages/progress') {
- wpPath.pathname = '/work_packages/new/progress';
+ if (wpPath.pathname.endsWith('/work_packages/progress')) {
+ // Replace /work_packages/progress with /work_packages/new/progress
+ wpPath.pathname = wpPath.pathname.replace('/work_packages/progress', '/work_packages/new/progress');
}
return wpPath.toString();