Content
View differences
Updated by Christophe Bliard 3 months ago
### Steps to reproduce
1. Create a work package
2. Log unit costs to it
3. Delete the work package, either from work package list or work package page
1. From work package list, right click on work package and select "Delete"
2. From work package page, click three dots menu, select "Delete"
4. On "Confirm deletion of work package" dialog, click "Delete" button
5. Because the work package has cost entries attached, the bulk delete page opens asking what to do with the cost entry.
6. Do not select anything and click "Delete" button
### What is the buggy behavior?
* ~~Error Error 500 page displayed~~ The 500 error does not occur anymore displayed
### What is the expected behavior?
1. No 500 error
2. Redisplay the same page prompting for a choice
3. Disable button if nothing is selected
### Logs Quick analysis and stack trace
It tries to redisplay the same page, but fails to interpret the hidden `:back_url` parameter because it is url encoded.
On first display of the page, it uses the referer to set a hidden `back_url` parameter, on submit, it uses the provided `back_url` parameter but this one is url encoded.
```text
=> {controller: "work_packages", action: "index", project_id: "demo-project"}
>> Rails.application.routes.recognize_path('https://qa.openproject-stage.com/projects/my-project/work_packages')
=> {controller: "work_packages", action: "index", project_id: "my-project"}
>> Rails.application.routes.recognize_path('https%3A%2F%2Fqa.openproject-stage.com%2Fprojects%2Fmy-project%2Fwork_packages')
/share/ruby/3.4.7/lib/ruby/gems/3.4.0/gems/irb-1.15.3/lib/irb.rb:415:in 'full_message': No route matches "/https%3A%2F%2Fqa.openproject-stage.com%2Fprojects%2Fmy-project%2Fwork_packages" (ActionController::RoutingError)
```
backtrace:
```text
app/helpers/work_packages_helper.rb:210 WorkPackagesHelper#back_url_is_wp_show?
app/views/work_packages/bulk/destroy.html.erb:32
lib/open_project/form_tag_helper.rb:39 OpenProject::FormTagHelper#styled_form_tag
app/views/work_packages/bulk/destroy.html.erb:31
app/controllers/work_packages/bulk_controller.rb:76 block (2 levels) in WorkPackages::BulkController#destroy
app/controllers/work_packages/bulk_controller.rb:74 WorkPackages::BulkController#destroy
```
AppSignal error (when the 500 error was happening): error: https://appsignal.com/openproject-gmbh/sites/674718f1d2a5e4a7cb8b2298/exceptions/incidents/1069/samples/674718f1d2a5e4a7cb8b2298-33377048988927274217635558801
###
### Screenshots and other files
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/861138/content"> 500 error (does not occur anymore)<img <img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/861141/content">
### Environment information
_Please check and fill out the following details to help us identify in what versions and distributions of OpenProject the error occurs_
**OpenProject installation type**
* Hosted cloud edition
* Packaged installation
* What distribution?
* Docker All-in-one container
* Docker-compose installation
* Other (please specify)
**OpenProject version**
16.6.1
**Browser**
* [ ] Chrome
* [x] Firefox
* [ ] Safari
* [ ] Mobile Safari
* [ ] Other (please specify)
**Operating System**
* [ ] Windows
* [x] Mac OS X
* [ ] Mobile iOS
* [ ] Mobile Android
* [ ] Linux (please specify distro)
* [ ] Chrome OS
* [ ] Other (please specify)
<br>
1. Create a work package
2. Log unit costs to it
3. Delete the work package, either from work package list or work package page
1. From work package list, right click on work package and select "Delete"
2. From work package page, click three dots menu, select "Delete"
4. On "Confirm deletion of work package" dialog, click "Delete" button
5. Because the work package has cost entries attached, the bulk delete page opens asking what to do with the cost entry.
6. Do not select anything and click "Delete" button
### What is the buggy behavior?
* ~~Error
### What is the expected behavior?
1. No 500 error
2. Redisplay the same page prompting for a choice
3. Disable button if nothing is selected
### Logs
On first display of the page, it uses the referer to set a hidden `back_url` parameter, on submit, it uses the provided `back_url` parameter but this one is url encoded.
```text
=> {controller: "work_packages", action: "index", project_id: "demo-project"}
>> Rails.application.routes.recognize_path('https://qa.openproject-stage.com/projects/my-project/work_packages')
=> {controller: "work_packages", action: "index", project_id: "my-project"}
>> Rails.application.routes.recognize_path('https%3A%2F%2Fqa.openproject-stage.com%2Fprojects%2Fmy-project%2Fwork_packages')
/share/ruby/3.4.7/lib/ruby/gems/3.4.0/gems/irb-1.15.3/lib/irb.rb:415:in 'full_message': No route matches "/https%3A%2F%2Fqa.openproject-stage.com%2Fprojects%2Fmy-project%2Fwork_packages" (ActionController::RoutingError)
```
backtrace:
```text
app/helpers/work_packages_helper.rb:210 WorkPackagesHelper#back_url_is_wp_show?
app/views/work_packages/bulk/destroy.html.erb:32
lib/open_project/form_tag_helper.rb:39 OpenProject::FormTagHelper#styled_form_tag
app/views/work_packages/bulk/destroy.html.erb:31
app/controllers/work_packages/bulk_controller.rb:76 block (2 levels) in WorkPackages::BulkController#destroy
app/controllers/work_packages/bulk_controller.rb:74 WorkPackages::BulkController#destroy
```
###
### Screenshots and other files
<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/861138/content"> 500 error (does not occur anymore)<img
### Environment information
_Please check and fill out the following details to help us identify in what versions and distributions of OpenProject the error occurs_
**OpenProject installation type**
* Hosted cloud edition
* Packaged installation
* What distribution?
* Docker All-in-one container
* Docker-compose installation
* Other (please specify)
**OpenProject version**
16.6.1
**Browser**
* [ ] Chrome
* [x] Firefox
* [ ] Safari
* [ ] Mobile Safari
* [ ] Other (please specify)
**Operating System**
* [ ] Windows
* [x] Mac OS X
* [ ] Mobile iOS
* [ ] Mobile Android
* [ ] Linux (please specify distro)
* [ ] Chrome OS
* [ ] Other (please specify)
<br>