Dodano hidden marker custom_field_name_present w formularzu edycji produktu.
Zmieniono warunek w ProductRepository z array_key_exists('custom_field_name')
na array_key_exists('custom_field_name_present') — jQuery .serialize() pomijał
klucz pustej tablicy gdy wszystkie pola usunięte. Test jednostkowy dodany.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.9 KiB
2.9 KiB
phase, plan, subsystem, tags, requires, provides, affects, tech-stack, key-files, key-decisions, patterns-established, duration, completed
| phase | plan | subsystem | tags | requires | provides | affects | tech-stack | key-files | key-decisions | patterns-established | duration | completed | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 14-custom-fields-delete-bug | 01 | admin |
|
|
|
|
|
|
~10min | 2026-04-16 |
Phase 14 Plan 01: Custom fields delete bug fix — Summary
Naprawiono bug uniemożliwiający usunięcie wszystkich dodatkowych pól produktu — hidden marker gwarantuje wywołanie saveCustomFields() niezależnie od ilości pól.
Performance
| Metric | Value |
|---|---|
| Duration | ~10min |
| Completed | 2026-04-16 |
| Tasks | 2 completed |
| Files modified | 3 |
Acceptance Criteria Results
| Criterion | Status | Notes |
|---|---|---|
| AC-1: Usunięcie wszystkich custom fields | Pass | saveCustomFields() wywoływany dzięki markerowi, else branch kasuje wszystkie rekordy |
| AC-2: Częściowe usunięcie nadal działa | Pass | Logika saveCustomFields() dla niepustych list bez zmian |
| AC-3: Dodawanie pól nadal działa | Pass | Marker nie wpływa na insert/update path |
Accomplishments
- Dodano hidden field
custom_field_name_presentwrenderCustomFieldsBox()— zawsze obecny w POST - Zmieniono warunek w
ProductRepository:1339zcustom_field_namenacustom_field_name_present - Dodano test jednostkowy potwierdzający delete all path (821 testów, 0 regresji)
Files Created/Modified
| File | Change | Purpose |
|---|---|---|
autoload/admin/Controllers/ShopProductController.php |
Modified | Hidden marker custom_field_name_present w renderCustomFieldsBox() |
autoload/Domain/Product/ProductRepository.php |
Modified | Warunek zmieniony na sprawdzanie markera |
tests/Unit/Domain/Product/ProductRepositoryTest.php |
Modified | Test testSaveCustomFieldsDeletesAllWhenEmpty |
Decisions Made
| Decision | Rationale | Impact |
|---|---|---|
| Hidden marker zamiast wysyłania pustego array | jQuery .serialize() pomija puste pola array — marker jest niezawodny | Backward compat z API partial update (brak markera = skip) |
Deviations from Plan
None — plan executed exactly as written.
Issues Encountered
None.
Next Phase Readiness
Ready:
- Bug naprawiony, test przechodzi, zero regresji
Concerns:
- None
Blockers:
- None
Phase: 14-custom-fields-delete-bug, Plan: 01 Completed: 2026-04-16