Open aaronskiba opened 3 months ago
Here is a list of controller actions that call render
as well as their corresponding paths (when provided in the codebase). These are "non-GET actions" whose paths do not have a corresponding GET method. As a result, when using the language selector on these paths, a 500 error should be triggered.
# app/controllers/contributors_controller.rb
# DELETE /plans/:plan_id/contributors/:id
def destroy
render :edit
end
# PUT /plans/:plan_id/contributors/:id
def update
render :edit
end
# app/controllers/guidance_groups_controller.rb
# POST /org/admin/guidancegroup/:id/admin_create
def admin_create
render :admin_edit
render :admin_new
end
# PUT /org/admin/guidancegroup/:id/admin_update
def admin_update
render :admin_edit
end
# app/controllers/guidances_controller.rb
# POST /org/admin/guidance/:id/admin_create
def admin_create
render :new_edit
end
# PUT /org/admin/guidance/:id/admin_update
def admin_update
render :new_edit
end
# app/controllers/org_admin/departments_controller.rb
# POST /departments
# POST /departments.json
def create
render :new
end
# PUT /departments/1
def update
render :edit
end
# app/controllers/org_admin/users_controller.rb
def update
render :edit
end
# PATCH/PUT /notifications/1
# PATCH/PUT /notifications/1.json
def update
render :edit
end
# DELETE /notifications/1
# DELETE /notifications/1.json
def destroy
render :edit
end
# app/controllers/super_admin/themes_controller.rb
def update
render :edit
end
def destroy
render :edit
end
# app/controllers/super_admin/users_controller.rb
# PUT /super_admin/users/:id
def update
render :edit
end
# PUT /super_admin/users/:id/merge
def merge
render :edit
end
# PUT /super_admin/users/:id/archive
def archive
render :edit
end
Please complete the following fields as applicable:
What version of the DMPRoadmap code are you running? (e.g. v2.2.0)
4.0.2+portage-4.0.2
Expected behaviour:
Actual behaviour:
Diagnosis
app/controllers/session_locales_controller.rb
By default,
redirect_back
performs a GET request onrequest.referrer
request.referrer
URL paths without a corresponding GET HTTP method.This use of
render :name_of_action
within other controller actions seems to be causing these 500 errors.e.g.
app/controllers/super_admin/api_clients_controller.rb
After performing the
update
action, theedit
view is rendered. However, the URL path remains at/api_clients/:id
. But there is no controller action corresponding toGET /api_clients/:id
. Thus, a 500 error is triggered when trying to change languages via the language dropdown (screenshot below):