Skip to content

fix(admin): let unticking AI translate on an attribute save - #727

Merged
navneetkumar-pim-webkul merged 1 commit into
3.xfrom
fix/attribute-ai-translate-toggle
Sep 24, 2026
Merged

navneetkumar-pim-webkul merged 1 commit into
3.xfrom
fix/attribute-ai-translate-toggle

Conversation

@navneetkumar-pim-webkul

Copy link
Copy Markdown
Collaborator

Issue Reference

N/A — found internally.

Description

The attribute edit form rendered the ai_translate hidden 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 0 rendered before the checkbox, so a ticked box overrides it and an unticked box submits 0.

How To Test This?

  1. Catalog → Attributes → edit a locale-scoped text attribute with AI translate enabled.
  2. Untick AI translate and save.
    • Before: reopening the attribute shows it still enabled.
    • After: it stays disabled.
  3. 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/pest passes locally
  • vendor/bin/pint --test reports no style issues
  • Tailwind classes are reordered — N/A
  • New user-facing strings use translation keys (all 33 locales) — N/A, no new strings
  • Target branch is 3.x, the current release line (master targets the next major)

Documentation

  • My pull request requires an update on the documentation repository.

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.
Copilot AI lite review requested due to automatic review settings September 24, 2026 16:18
@navneetkumar-pim-webkul navneetkumar-pim-webkul mentioned this pull request Sep 24, 2026
2 of 6 tasks

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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
navneetkumar-pim-webkul merged commit 4743266 into 3.x Sep 24, 2026
24 checks passed
@navneetkumar-pim-webkul
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.
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.

2 participants