onurtashan opened a new issue, #40192:
URL: https://github.com/apache/superset/issues/40192
### Bug Description
When a certified dashboard is edited (layout changes, chart moves, etc.) and
saved,
the `certified_by` and `certification_details` fields are cleared from the
database.
### Steps to Reproduce
1. Certify a dashboard (Dashboard → ··· → Edit info → Certified by → save)
2. Enter dashboard edit mode
3. Make any layout change (move a chart, resize, etc.)
4. Click Save
5. Refresh the page
**Expected:** Certification info is preserved
**Actual:** `certified_by` and `certification_details` are empty
### Root Cause
In `saveDashboardRequest` (`dashboardState.ts`, lines 471-473):
\`\`\`typescript
certified_by: certified_by || '',
certification_details:
certified_by && certification_details ? certification_details : '',
\`\`\`
When `certified_by` is `undefined` in the Redux `dashboardInfo` state (which
can
happen if the state is not fully synchronized during layout editing), both
fields
become empty strings `''` and are included in the PUT request body.
The backend schema accepts empty strings and `DashboardDAO.update()`
unconditionally
writes whatever is in the properties dict — so the certification is wiped.
### Fix
Only include certification fields in the PUT payload if they are explicitly
defined:
\`\`\`typescript
...(certified_by !== undefined && { certified_by }),
...(certification_details !== undefined && { certification_details }),
\`\`\`
### Superset Version
Reproduced on: 6.1.0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]