Fixed category importer silently ignoring the alert_on_response column - #19432
Conversation
The importer UI offers "Alert on Response" as a mappable column for category imports (app/Livewire/Importer.php, categories_fields), but CategoryImporter only ever read use_default_eula, require_acceptance and checkin_email. Anything the user mapped to alert_on_response was dropped: new categories were always created with the column default, and update-mode imports could never change it. alert_on_response was added to the Category model in grokability#17116, four days after the category importer landed in grokability#17062, and the importer's flag list was never extended to match. Adds it to the existing boolean-flag loop so it gets the same fetchHumanBoolean handling and the same present/absent CSV semantics as its three siblings. Co-Authored-By: Claude <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
|
I think this may have been accidentally fixed in #19392 (not yet merged) |
|
I checked #19392 and it doesn't touch On current develop the boolean loop in CategoryImporter is still |
|
Got it, thanks! |
Description
The importer UI offers Alert on Response as a mappable column for category imports (
$categories_fieldsinapp/Livewire/Importer.php, with its ownimport_alert_on_responsetranslation string), butCategoryImporteronly ever readuse_default_eula,require_acceptanceandcheckin_email.The result is that anything a user maps to that column is silently dropped — new categories are always created with the column default, and update-mode imports can never change the value. Because
CheckoutableListenerreads$category->alert_on_responseto decide whether to notify the person who performed the checkout, imported categories never alert regardless of what the CSV said.alert_on_responsewas added to theCategorymodel in #17116, four days after the category importer landed in #17062. That PR extended the importer's UI field list but not the importer's flag list, so the two have been out of sync since.The fix adds it to the existing boolean-flag loop, so it gets the same
fetchHumanBooleancoercion and the same "column present vs absent" update semantics as its three siblings.Type of change
How Has This Been Tested?
Added two regression tests to
tests/Feature/Importing/Api/ImportCategoriesTest.phpcovering both directions — creating a category with the flag set, and using update mode to clear it. Both fail ondevelopand pass with this change.DB_CONNECTION=sqlite php artisan test tests/Feature/Importing tests/Unit/Importer tests/Feature/Livewire/ImporterTest.php→ 232 passed.vendor/bin/pint --testclean on the changed files.This change was prepared with the assistance of AI (Claude). The bug was reproduced with a failing test before the fix, and the full importer test suite was run locally to check for regressions.