Repository navigation
fix(admin): let unticking AI translate on an attribute save - #727
Merged
Merged
Conversation
The attribute edit form rendered the ai_translate hidden input after the checkbox with the stored value, so PHP kept the hidden value on submit and an enabled attribute could never be switched off. The fallback is now a constant 0 rendered before the checkbox, so a ticked box overrides it.
2 of 6 tasks
Copilot started reviewing on behalf of
navneetkumar-pim-webkul
September 24, 2026 16:20
View session
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The fix is covered by regression tests and has no unresolved review issues.
Review effort: Lite
Findings: None
What changed in this PR
Fixes the admin attribute form so disabling AI translation is saved correctly.
Changes:
- Moves the hidden fallback before the checkbox.
- Adds regression coverage for enabled and disabled states.
| File | Description |
|---|---|
packages/Webkul/Admin/tests/Feature/Catalog/AttributeTest.php |
Verifies the fallback renders before the checkbox. |
packages/Webkul/Admin/src/Resources/views/catalog/attributes/edit.blade.php |
Corrects checkbox value ordering. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
navneetkumar-pim-webkul
deleted the
fix/attribute-ai-translate-toggle
branch
September 24, 2026 16:36
navneetkumar-pim-webkul
added a commit
that referenced
this pull request
Sep 24, 2026
Six merged pull requests since v3.1.1 carried no changelog entry: the gallery unsaved badge and worker timeout handler (#713), the import filter re-render (#720), the worker timeout alarm (#722), the channel name on PostgreSQL (#725), the price input height (#726), and the export view events (#717, #718). The two fixes pending in #727 and #728 are included so the cut merges after them. The model recommendation entry described the cheap-tier ranking that #724 replaced with newest-per-family; it now describes the shipped behaviour. 3.1.2 is a patch release, so everything is filed under bug fixes and improvements; no feature section. Core::VERSION, package.json and the UPGRADE.md walkthrough move to 3.1.2 together, as they did for 3.1.1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue Reference
N/A — found internally.
Description
The attribute edit form rendered the
ai_translatehidden input after the checkbox, carrying the stored value. PHP keeps the last value for a repeated field name, so the hidden input always won on submit: an attribute with AI translate enabled could never be switched off.The fallback is now a constant
0rendered before the checkbox, so a ticked box overrides it and an unticked box submits0.How To Test This?
vendor/bin/pest packages/Webkul/Admin/tests/Feature/Catalog/AttributeTest.php. The new dataset test fails on both cases before the fix.Screenshots
N/A — no visual change.
Checklist
vendor/bin/pestpasses locallyvendor/bin/pint --testreports no style issues3.x, the current release line (mastertargets the next major)Documentation