Fixed Less error when calling certain templates

Affected version
2.2.5

Kirby

Well-known member
Reopening this bug report:
Code:
XF\CssRenderException: Error rendering template public:core_datalist.less: .iconicIcon is undefined in public:core_datalist.less (on or near line 3973) src/XF/CssRenderException.php:87
Generiert durch: Unbekanntes Benutzerkonto 8. Juli 2021 um 15:21 Uhr
Stracktrace
 3970 |     {
 3971 |         > a.iconic > i
 3972 |         {
*3973*|             .iconicIcon(false);
 3974 |         }
 3975 |
 3976 |         > .iconic
------------

#0 src/XF/CssRenderer.php(416): XF\CssRenderException::createFromLessException(Object(Less_Exception_Compiler), 'public:core_dat...', '// Note that th...')
#1 src/XF/CssRenderer.php(350): XF\CssRenderer->renderToCss('public:core_dat...', '// Note that th...')
#2 src/XF/CssRenderer.php(258): XF\CssRenderer->renderTemplate('public:core_dat...', NULL)
#3 src/XF/CssRenderer.php(116): XF\CssRenderer->renderTemplates(Array, Array, Array)
#4 src/XF/CssWriter.php(53): XF\CssRenderer->render(Array)
#5 css.php(30): XF\CssWriter->run(Array, 5, 3, '')
#6 {main}

-------------

Previous Less_Exception_Compiler: .iconicIcon is undefined in anonymous-file-0.less - src/vendor/oyejorge/less.php/lib/Less/Tree/Mixin/Call.php:149
#0 src/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(147): Less_Tree_Mixin_Call->compile(Object(Less_Environment))
#1 src/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(88): Less_Tree_Ruleset->EvalMixinCalls(Object(Less_Tree_Ruleset), Object(Less_Environment), 1)
#2 src/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(94): Less_Tree_Ruleset->compile(Object(Less_Environment))
#3 src/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(94): Less_Tree_Ruleset->compile(Object(Less_Environment))
#4 src/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(94): Less_Tree_Ruleset->compile(Object(Less_Environment))
#5 src/vendor/oyejorge/less.php/lib/Less/Parser.php(199): Less_Tree_Ruleset->compile(Object(Less_Environment))
#6 src/XF/CssRenderer.php(412): Less_Parser->getCss()
#7 src/XF/CssRenderer.php(350): XF\CssRenderer->renderToCss('public:core_dat...', '// Note that th...')
#8 src/XF/CssRenderer.php(258): XF\CssRenderer->renderTemplate('public:core_dat...', NULL)
#9 src/XF/CssRenderer.php(116): XF\CssRenderer->renderTemplates(Array, Array, Array)
#10 src/XF/CssWriter.php(53): XF\CssRenderer->render(Array)
#11 css.php(30): XF\CssWriter->run(Array, 5, 3, '')
#12 {main}

Mixin iconicIcon() does get defined in core_input.less but is being used in core_datalist.less
 
Last edited:

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.7).

Change log:
Steps to avoid accessing a Less mixin from one file defined in another. Move to setup.less but retain reference to the original for backwards compatibility for now.
There may be a delay before changes are rolled out to the XenForo Community.
 

jscherbel

Member
How do I fix this? Updated to 2.2.7 patch 1 and have it now.

Edit: Just realized my error is actually on m-iconicIcon though...

Went ahead and added the following to setup.less based on the changelog note above but not sure if that will cause any issues but at least the CSS is rendering :)

--
//Added after upgrade to 2.2.7 issue
.m-iconicIcon(@setPosition: true)
{
//test
}

--
  • XF\CssRenderException: Error rendering template public:core.less: .m-iconicIcon is undefined in public:core.less (on or near line 6808)
  • src/XF/CssRenderException.php:89
  • Generated by: Unknown account
  • Oct 2, 2021 at 1:02 PM

Stack trace​

6805 |
6806 | + i
6807 | {
6808| .m-iconicIcon();
 
Last edited:

Chris D

XenForo developer
Staff member
This is due to an outdated template.

You should be notified about these on the admin control panel home page. I suspect this is a modified setup.less template. If that is not showing up as outdated then you may need to revert any changes made to it.
 
Top