refactor!: remove variables doctype from page in favour of scripts - #228
refactor!: remove variables doctype from page in favour of scripts#228ruchamahabal wants to merge 1 commit into
Conversation
Confidence Score: 3/5This PR is not safe to merge until exported variables are preserved and resources are initialized with migrated page-script state. The migration can permanently remove exported-page state, while the new page-load order evaluates resource inputs before replacement refs exist. Files Needing Attention: studio/studio/doctype/studio_page/patches/migrate_variables_to_page_script.py; frontend/src/stores/studioStore.ts Reviews (1): Last reviewed commit: "refactor!: remove variables doctype from..." | Re-trigger Greptile |
| _report_unmigrated(page, variables) | ||
| return |
There was a problem hiding this comment.
Exported variables are deleted
When an exported page has legacy variables, this branch only logs manual migration instructions before execute() deletes the source DocType, causing its persisted state and variable-backed behavior to disappear until a developer reconstructs it.
Context Used: Guidelines for reviewing Frappe Framework applicat... (source)
Knowledge Base Used:
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| await codeStore.setPageResources(page, true) | ||
| await codeStore.setPageScript(page, Boolean(page.is_standard)) |
There was a problem hiding this comment.
Resources initialize without page state
When a resource filter or API parameter references a migrated page-script ref, setPageResources evaluates it before setPageScript creates that ref and does not rebuild the resource afterward, causing the initial request to omit the value and return incorrect data or fail.
Knowledge Base Used: Frontend State Stores
No description provided.