Repository navigation
fix(core): allow clearing the channel name on PostgreSQL - #725
Merged
Merged
Conversation
The channel name became optional in #569, but channel_translations.name stayed NOT NULL. Clearing the name on edit writes NULL, which PostgreSQL rejects with a not-null violation; MySQL only hid it because the app runs it non-strict, which silently stores an empty string. Make the column nullable and have the channel datagrid fall back to the default locale's name when the requested one is NULL as well as empty.
Copilot started reviewing on behalf of
navneetkumar-pim-webkul
September 24, 2026 14:40
View session
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Add focused regression coverage for fallback display when the requested translation name is null.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
This pull request fixes PostgreSQL failures when clearing channel names by allowing nullable translations and handling null names in the channel grid.
Changes:
- Adds a nullable
channel_translations.namemigration with rollback backfill. - Adds regression coverage for clearing channel names.
- Updates grid fallback handling with
COALESCE.
| File | Summary |
|---|---|
packages/Webkul/Core/src/Database/Migrations/2026_09_24_172527_make_name_nullable_in_channel_translations_table.php |
Makes channel translation names nullable. |
packages/Webkul/Admin/tests/Feature/Settings/ChannelTest.php |
Tests clearing a channel name. |
packages/Webkul/Admin/src/DataGrids/Settings/ChannelDataGrid.php |
Handles null names during locale fallback. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
2 of 6 tasks
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
Fixes https://git.webkul.com/unopim/UnoPim/-/issues/1370
Description
On PostgreSQL, removing a channel's Name/Label on edit fails with:
#569 made the channel name optional, but
channel_translations.namestayedNOT NULL. On save,ConvertEmptyStringsToNullturns the cleared field intonull.ChannelRepository::removeEmptyTranslationskeeps that payload for a locale that already has a translation (on purpose, so clearing persists), so the update writesNULL. MySQL/MariaDB hid this becauseconfig/database.phpruns them with'strict' => false, which silently stores''. PostgreSQL has no equivalent mode.channel_translations.namenullable.down()backfillsNULLto''before restoringNOT NULL. It uses the schema builder only, so it is prefix-safe on MySQL, MariaDB and PostgreSQL.ChannelDataGridfell back to the default locale's name only for an empty name (CHAR_LENGTH(TRIM(NULL))isNULL), so it now wraps the requested name inCOALESCE(..., '').How To Test This?
laravel.log.vendor/bin/pest packages/Webkul/Admin/tests/Feature/Settings/ChannelTest.php. The new test "should clear the channel name when it is removed on update" fails before the fix on PostgreSQL. Run it withphpunit.pgsql.xml; MySQL non-strict passes it even without the fix.Screenshots
After the fix on PostgreSQL, clearing the name saves successfully. Before the fix, the same save showed the generic save error and logged the 23502 violation.
Checklist
vendor/bin/pestpasses locally (ChannelTest + ChannelActivationTest: 30 passed on PostgreSQL 16 and on MySQL 8)vendor/bin/pint --testreports no style issues3.xAlso run: PHPStan on the changed files (no errors), Rector dry-run (no changes), and the migration's rollback and re-run on PostgreSQL. Playwright was not run.
Documentation