Skip to content

Fixed category importer silently ignoring the alert_on_response column - #19432

Merged
snipe merged 1 commit into
grokability:developfrom
TowyTowy:fix/category-importer-alert-on-response
Aug 8, 2026
Merged

Fixed category importer silently ignoring the alert_on_response column#19432
snipe merged 1 commit into
grokability:developfrom
TowyTowy:fix/category-importer-alert-on-response

Conversation

@TowyTowy

@TowyTowy TowyTowy commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

The importer UI offers Alert on Response as a mappable column for category imports ($categories_fields in app/Livewire/Importer.php, with its own import_alert_on_response translation string), but CategoryImporter only ever read use_default_eula, require_acceptance and checkin_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 CheckoutableListener reads $category->alert_on_response to decide whether to notify the person who performed the checkout, imported categories never alert regardless of what the CSV said.

alert_on_response was added to the Category model 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 fetchHumanBoolean coercion and the same "column present vs absent" update semantics as its three siblings.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added two regression tests to tests/Feature/Importing/Api/ImportCategoriesTest.php covering both directions — creating a category with the flag set, and using update mode to clear it. Both fail on develop and 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 --test clean 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.

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>
@TowyTowy
TowyTowy requested a review from snipe as a code owner August 4, 2026 18:04
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@snipe

snipe commented Aug 6, 2026

Copy link
Copy Markdown
Member

I think this may have been accidentally fixed in #19392 (not yet merged)

@TowyTowy

TowyTowy commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

I checked #19392 and it doesn't touch app/Importer/CategoryImporter.php (its importer changes are AccessoryImporter, AssetImporter, ComponentImporter, ConsumableImporter and ItemImporter).

On current develop the boolean loop in CategoryImporter is still ['use_default_eula', 'require_acceptance', 'checkin_email'], so alert_on_response is still dropped on import even though it's fillable and cast on the Category model and editable in the UI. This one line is all that's missing.

@snipe

snipe commented Aug 8, 2026

Copy link
Copy Markdown
Member

Got it, thanks!

@snipe
snipe merged commit 747655a into grokability:develop Aug 8, 2026
9 checks passed
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