dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
864 stars 467 forks source link

All Widgets are being rendered when converting to json without having to pass the render flag #25523

Open wezell opened 1 year ago

wezell commented 1 year ago

Parent Issue

No response

Problem Statement

When making an API call to content or a list of content, we are automatically trying to render the widgets in that content. We should only be doing this if the api call has specified to return rendered content - this is currently causing issues in authoring as there is a widget that is doing $request.sendRedirect("https://google.com") and things like that that mungs up the underlying API request object.

Steps to Reproduce

Create a new code widget with the value ${request.session.invalidate()}. Hit this widget from the backend using the content API - e.g. using a url like

https://demo.dotcms.com/api/content/id/d89d04a50c0724428d86fd12194194be And it will cause you to logout.

You should have to pass /render/true or ?render=true in order for velocity to try to render the content. Also, we should not be reusing the underlying API request when doing the render and instead should be using a MockRequest that has the same properties to avoid any underlying funk.

Acceptance Criteria

Have to pass /render/true or ?render=true in order for velocity to try to render the content.

dotCMS Version

23.06

Proposed Objective

Reliability

Proposed Priority

Priority 2 - Important

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

erickgonzalez commented 1 year ago

Reproducible on 23.01 LTS but no on 22.03 LTS

wezell commented 1 year ago

Caused by the changes here: #21079

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] commented 3 days ago

PRs: