fix(ui): seven task icons render blank after the Font Awesome 7 migration - #1338
Merged
Conversation
…tion The FA7 migration renamed every icon class in PHP and JS. It missed the icons FOG stores as DATA: taskTypes.ttIcon and taskStates.tsIcon hold a bare icon name with no prefix, seeded by commons/schema.php and rendered as `fa fa-<stored name>` by fog.task.list.js and the host and group task menus. Seven of those values are FA4 outline names FA7 dropped outright, so they now resolve to nothing and render blank: taskTypes 4 Memtest86+ plus-square-o square-plus taskTypes 5 Test Disk hdd-o hard-drive taskTypes 15 Deploy - Debug arrow-circle-o-down circle-arrow-down taskTypes 16 Capture - Debug arrow-circle-o-up circle-arrow-up taskTypes 18 Fast Wipe hourglass-o hourglass-start taskTypes 22 Virus Scan - Quarantine flag-o flag taskStates 1 Queued bookmark-o bookmark Visible in Task Management, the task list, and both task menus, on every upgraded and every fresh install. Corrected by appended schema steps rather than by editing steps 2907-2987 in place: an install that has already run those never replays them, so an in-place edit would fix a fresh install and leave every existing one broken. Each step is guarded on the old value, so an administrator who has already chosen their own icon for one of these keeps it. FOG_SCHEMA 360 -> 367. Fast/Normal/Full Wipe are read as a set, so Fast takes hourglass-start rather than any surviving hourglass: Normal already holds hourglass-2, which FA7 resolves as an alias of hourglass-half, and Full holds hourglass. The renderers that compose these values are moved off the bare `fa` prefix at the same time. They are the last call sites still on it, and they evaded the existing check because the name is concatenated on, so the literal ends at the quote and matched nothing. tests/fontawesome7-icon-names.test.php gains three gates: the seeded names are extracted from schema.php with last-write-wins and checked against the shipped stylesheet, and no renderer may concatenate onto `fa fa-`. Both were verified by mutation. The seed extraction folds away PHP string concatenation first -- without that it sees only the steps that fit on one line, which is every historical step and none of the corrections, and reads as the bug persisting. Verified against the lab database in a rolled-back transaction: 7 rows changed, 0 unresolvable icons remaining, 0 rows changed on replay. FOG_BCACHE_VER 313 -> 314 for the two changed JS files. Co-Authored-By: Claude <noreply@anthropic.com>
Carries FOGProject/fog-plugins#26, which moves the tasktypeedit icon renderer off the bare `fa` prefix -- the plugin half of the same cleanup this PR makes in core. Verified by fetching the release into the tree: stamp reads v1.6.16 and the renderer in the installed copy emits `fas fa-`. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Follow-up to #1336, which I shipped with this gap.
The bug
The FA7 migration renamed every icon class in PHP and JS. It missed the icons FOG stores as data:
taskTypes.ttIconandtaskStates.tsIconhold a bare icon name with no prefix, seeded bycommons/schema.phpand rendered asfa fa-<stored name>byfog.task.list.jsand the host and group task menus.Seven are FA4 outline names FA7 dropped outright, so they resolve to nothing and render blank:
plus-square-osquare-plushdd-ohard-drivearrow-circle-o-downcircle-arrow-downarrow-circle-o-upcircle-arrow-uphourglass-ohourglass-startflag-oflagbookmark-obookmarkVisible in Task Management, the task list, and both task menus, on every upgraded and every fresh install. The prefix was never the problem —
fais still the solid alias in FA7.Why the suite could not see it
tests/fontawesome7-icon-names.test.phpscans source for a literalfas fa-name. A name that only ever exists as a row in the database is invisible to it. That blind spot is what let #1336 through.The fix
Appended schema steps, not edits to steps 2907-2987. An install that has already run those never replays them, so an in-place edit fixes a fresh install and leaves every existing one broken. Each step is guarded on the old value, so an administrator who already picked their own icon keeps it.
FOG_SCHEMA360 → 367.Fast/Normal/Full Wipe are read as a set, so Fast takes
hourglass-startrather than any surviving hourglass: Normal holdshourglass-2(an FA7 alias ofhourglass-half) and Full holdshourglass.The renderers are also moved off the bare
faprefix — the last core call sites still on it. They evaded the existing check because the name is concatenated on, so the literal ends at the quote and matched nothing.Verification
Three new gates, both behavioural ones mutation-verified:
schema.php(last-write-wins) and checked against the shipped stylesheet — removing one correction fails it, naming the rowfa fa-— reverting one renderer fails it, naming the fileThe seed extraction folds away PHP string concatenation first. Without that it sees only the steps that fit on one line — every historical step and none of the corrections — and reports the bug as still present.
Against the lab database in a rolled-back transaction:
Full suite:
143 passed, 0 failed.FOG_BCACHE_VER313 → 314 for the two changed JS files.Related
fog-plugins carries the same shape in
tasktypeedit/js/fog.tasktypeedit.list.js, which composesfa fa-+ a stored value. Its prefix wants the same move; the stored values it renders are thetaskTypesrows this PR repairs, so no data change is needed there.