Skip to content

refactor!: remove variables doctype from page in favour of scripts - #228

Open
ruchamahabal wants to merge 1 commit into
frappe:developfrom
ruchamahabal:remove-variables
Open

refactor!: remove variables doctype from page in favour of scripts#228
ruchamahabal wants to merge 1 commit into
frappe:developfrom
ruchamahabal:remove-variables

Conversation

@ruchamahabal

Copy link
Copy Markdown
Member

No description provided.

@ruchamahabal
ruchamahabal marked this pull request as ready for review August 11, 2026 05:13
@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 3/5

This 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

Fix All in Claude Code Fix All in Codex

Reviews (1): Last reviewed commit: "refactor!: remove variables doctype from..." | Re-trigger Greptile

Comment on lines +52 to +53
_report_unmigrated(page, variables)
return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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!

Fix in Claude Code Fix in Codex

Comment on lines +204 to 205
await codeStore.setPageResources(page, true)
await codeStore.setPageScript(page, Boolean(page.is_standard))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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

Fix in Claude Code Fix in Codex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant