Skip to content

[FIX] base_fontawesome_web_editor: fix icon to image conversion#3684

Open
janni1288 wants to merge 1 commit into
OCA:17.0from
janni1288:fix-fontawesome-icon-conversion
Open

[FIX] base_fontawesome_web_editor: fix icon to image conversion#3684
janni1288 wants to merge 1 commit into
OCA:17.0from
janni1288:fix-fontawesome-icon-conversion

Conversation

@janni1288

Copy link
Copy Markdown

Closes #3457

Problem

Sending a chatter message (or any HtmlField) containing a FontAwesome
icon crashes with TypeError: Cannot read properties of null (reading '1')
when the icon's CSS rule uses FontAwesome >= 6.7.2's --fa custom
property instead of a classic content declaration.

Fix

_processRuleSelectors now synthesizes a content: "..." declaration
from --fa when no classic content declaration is present, so Odoo
core's fontToImg() can extract the glyph as it did before FA 6.7.2.

Known limitation

Icons introduced only in FontAwesome 6 (not present in Odoo's bundled
server-side font used for /web_editor/font_to_img) still can't be
rendered as a converted image. This is a separate, pre-existing
limitation unrelated to this crash fix.

FontAwesome >= 6.7.2 declares icon glyphs via the --fa custom property instead of the classic content CSS declaration. Odoo core's fontToImg() still expects content: to extract the glyph, causing a crash. Synthesize a content declaration from --fa when present.
@OCA-git-bot OCA-git-bot added series:17.0 mod:base_fontawesome_web_editor Module base_fontawesome_web_editor labels Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:base_fontawesome_web_editor Module base_fontawesome_web_editor series:17.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants