Resource icon

Standard Library by Xon 1.22.4

No permission to download
This is not an XF2.3 compatible release, the javascript needs updating and some template bits reviewing. But implementing ajax pagination took much longer than expected and kept running into weird edge cases :(
 
PHP 8.4 support? Wow, the first Alpha is not even released :)
I maintain a list of trivial clean-up tasks when I perform when I'm touching an add-on, and this was one of them. It is just updating from function foo(int $bar = null) to function foo(?int $bar = null). Finding those to update is the hard part over the actual change

It might be possible additional php 8.4 changes will be required, but I haven't seen anything in the proposed changes for 8.4 which would be an issue.
 
@Xon Server error log on XF 2.3.0

Code:
TypeError: Template public:sv_bbcode_modinterrupt_svg.css error: Unsupported operand types: string - string internal_data/code_cache/templates/l1/s2/public/sv_bbcode_modinterrupt_svg.css.php:22

Generated by: Unknown account Jul 6, 2024 at 10:51 PM

Stack trace

#0 src/XF/Template/Templater.php(1792): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, NULL)
#1 src/XF/Template/Templater.php(1866): XF\Template\Templater->renderTemplate('sv_bbcode_modin...', Array)
#2 internal_data/code_cache/templates/l1/s2/public/sv_bbcode_modinterrupt_alert.svg.php(12): XF\Template\Templater->includeTemplate('public:sv_bbcod...', Array)
#3 src/XF/Template/Templater.php(1792): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, NULL)
#4 src/addons/SV/SvgTemplate/svgRenderer.php(312): XF\Template\Templater->renderTemplate('sv_bbcode_modin...', Array, false)
#5 src/addons/SV/SvgTemplate/svgRenderer.php(246): SV\SvgTemplate\svgRenderer->renderTemplate('public:sv_bbcod...', NULL)
#6 src/XF/CssRenderer.php(135): SV\SvgTemplate\svgRenderer->renderTemplates(Array, Array, Array)
#7 src/XF/CssWriter.php(60): XF\CssRenderer->render(Array)
#8 src/addons/SV/SvgTemplate/svgWriter.php(47): XF\CssWriter->run(Array, 2, 1, '')
#9 svg.php(52): SV\SvgTemplate\svgWriter->run(Array, 2, 1, '', 1720282279)
#10 {main}

Request state

array(4) {
  ["url"] => string(57) "/data/svg/2/1/1720282279/sv_bbcode_modinterrupt_alert.svg"
  ["referrer"] => string(476) "/css.php?css=public%3Abb_code.less%2Cpublic%3Adbtech_shop.less%2Cpublic%3Adbtech_shop_postbit.less%2Cpublic%3Aeditor.less%2Cpublic%3Alightbox.less%2Cpublic%3Amessage.less%2Cpublic%3Anotices.less%2Cpublic%3Ashare_controls.less%2Cpublic%3Asiropu_ads_manager_ad.less%2Cpublic%3Astructured_list.less%2Cpublic%3AsvLazyImageLoader.less%2Cpublic%3Asv_bbcode_modinterrupt.less%2Cpublic%3Aextra.less&s=2&l=1&d=1720282279&k=c048f6595aba8703c7daebcd13bb9ac2c28845d7"
  ["_GET"] => array(4) {
    ["svg"] => string(28) "sv_bbcode_modinterrupt_alert"
    ["s"] => string(1) "2"
    ["l"] => string(1) "1"
    ["d"] => string(10) "1720282279"
  }
  ["_POST"] => array(0) {
  }
}
@Xon Server error log on XF 2.3.0

Code:
Less_Exception_Compiler: parse_less_func(@someVar: unit(lightness(hsl(var(--xf-contentBg)))); #test { color: @someVar; }) render error: error evaluating function `unit` The first argument to unit must be a number. index: 10 src/vendor/oyejorge/less.php/lib/Less/Tree/Call.php:80

Generated by: Unknown account Jul 6, 2024 at 10:51 PM

Stack trace

#0 src/vendor/oyejorge/less.php/lib/Less/Tree/Expression.php(46): Less_Tree_Call->compile(Object(Less_Environment))
#1 src/vendor/oyejorge/less.php/lib/Less/Tree/Value.php(25): Less_Tree_Expression->compile(Object(Less_Environment))
#2 src/vendor/oyejorge/less.php/lib/Less/Tree/Rule.php(76): Less_Tree_Value->compile(Object(Less_Environment))
#3 src/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(95): Less_Tree_Rule->compile(Object(Less_Environment))
#4 src/vendor/oyejorge/less.php/lib/Less/Parser.php(181): Less_Tree_Ruleset->compile(Object(Less_Environment))
#5 src/addons/SV/StandardLib/XF/CssRenderer.php(29): Less_Parser->getCss()
#6 src/addons/SV/RedisCache/XF/CssRenderer.php(216): SV\StandardLib\XF\CssRenderer->parseLessColorFuncValue('@someVar: unit(...', false)
#7 src/addons/SV/StandardLib/TemplaterHelper.php(527): SV\RedisCache\XF\CssRenderer->parseLessColorFuncValue('unit(lightness(...', false)
#8 src/XF/Template/Templater.php(1220): SV\StandardLib\TemplaterHelper->fnParseLessFunc(Object(SV\LazyImageLoader\XF\Template\Templater), false, 'unit(lightness(...')
#9 internal_data/code_cache/templates/l1/s2/public/sv_bbcode_modinterrupt_svg.css.php(16): XF\Template\Templater->func('parse_less_func', Array, false)
#10 src/XF/Template/Templater.php(1792): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, NULL)
#11 src/XF/Template/Templater.php(1866): XF\Template\Templater->renderTemplate('sv_bbcode_modin...', Array)
#12 internal_data/code_cache/templates/l1/s2/public/sv_bbcode_modinterrupt_alert.svg.php(12): XF\Template\Templater->includeTemplate('public:sv_bbcod...', Array)
#13 src/XF/Template/Templater.php(1792): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, NULL)
#14 src/addons/SV/SvgTemplate/svgRenderer.php(312): XF\Template\Templater->renderTemplate('sv_bbcode_modin...', Array, false)
#15 src/addons/SV/SvgTemplate/svgRenderer.php(246): SV\SvgTemplate\svgRenderer->renderTemplate('public:sv_bbcod...', NULL)
#16 src/XF/CssRenderer.php(135): SV\SvgTemplate\svgRenderer->renderTemplates(Array, Array, Array)
#17 src/XF/CssWriter.php(60): XF\CssRenderer->render(Array)
#18 src/addons/SV/SvgTemplate/svgWriter.php(47): XF\CssWriter->run(Array, 2, 1, '')
#19 svg.php(52): SV\SvgTemplate\svgWriter->run(Array, 2, 1, '', 1720282279)
#20 {main}

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

Previous Less_Exception_Compiler: The first argument to unit must be a number. - src/vendor/oyejorge/less.php/lib/Less/Functions.php:567
#0 src/vendor/oyejorge/less.php/lib/Less/Tree/Call.php(76): Less_Functions->unit(Object(XF\Less\Tree\HslColorVariable))
#1 src/vendor/oyejorge/less.php/lib/Less/Tree/Expression.php(46): Less_Tree_Call->compile(Object(Less_Environment))
#2 src/vendor/oyejorge/less.php/lib/Less/Tree/Value.php(25): Less_Tree_Expression->compile(Object(Less_Environment))
#3 src/vendor/oyejorge/less.php/lib/Less/Tree/Rule.php(76): Less_Tree_Value->compile(Object(Less_Environment))
#4 src/vendor/oyejorge/less.php/lib/Less/Tree/Ruleset.php(95): Less_Tree_Rule->compile(Object(Less_Environment))
#5 src/vendor/oyejorge/less.php/lib/Less/Parser.php(181): Less_Tree_Ruleset->compile(Object(Less_Environment))
#6 src/addons/SV/StandardLib/XF/CssRenderer.php(29): Less_Parser->getCss()
#7 src/addons/SV/RedisCache/XF/CssRenderer.php(216): SV\StandardLib\XF\CssRenderer->parseLessColorFuncValue('@someVar: unit(...', false)
#8 src/addons/SV/StandardLib/TemplaterHelper.php(527): SV\RedisCache\XF\CssRenderer->parseLessColorFuncValue('unit(lightness(...', false)
#9 src/XF/Template/Templater.php(1220): SV\StandardLib\TemplaterHelper->fnParseLessFunc(Object(SV\LazyImageLoader\XF\Template\Templater), false, 'unit(lightness(...')
#10 internal_data/code_cache/templates/l1/s2/public/sv_bbcode_modinterrupt_svg.css.php(16): XF\Template\Templater->func('parse_less_func', Array, false)
#11 src/XF/Template/Templater.php(1792): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, NULL)
#12 src/XF/Template/Templater.php(1866): XF\Template\Templater->renderTemplate('sv_bbcode_modin...', Array)
#13 internal_data/code_cache/templates/l1/s2/public/sv_bbcode_modinterrupt_alert.svg.php(12): XF\Template\Templater->includeTemplate('public:sv_bbcod...', Array)
#14 src/XF/Template/Templater.php(1792): XF\Template\Templater->{closure}(Object(SV\LazyImageLoader\XF\Template\Templater), Array, NULL)
#15 src/addons/SV/SvgTemplate/svgRenderer.php(312): XF\Template\Templater->renderTemplate('sv_bbcode_modin...', Array, false)
#16 src/addons/SV/SvgTemplate/svgRenderer.php(246): SV\SvgTemplate\svgRenderer->renderTemplate('public:sv_bbcod...', NULL)
#17 src/XF/CssRenderer.php(135): SV\SvgTemplate\svgRenderer->renderTemplates(Array, Array, Array)
#18 src/XF/CssWriter.php(60): XF\CssRenderer->render(Array)
#19 src/addons/SV/SvgTemplate/svgWriter.php(47): XF\CssWriter->run(Array, 2, 1, '')
#20 svg.php(52): SV\SvgTemplate\svgWriter->run(Array, 2, 1, '', 1720282279)
#21 {main}

Request state

array(4) {
  ["url"] => string(57) "/data/svg/2/1/1720282279/sv_bbcode_modinterrupt_alert.svg"
  ["referrer"] => string(476) "/css.php?css=public%3Abb_code.less%2Cpublic%3Adbtech_shop.less%2Cpublic%3Adbtech_shop_postbit.less%2Cpublic%3Aeditor.less%2Cpublic%3Alightbox.less%2Cpublic%3Amessage.less%2Cpublic%3Anotices.less%2Cpublic%3Ashare_controls.less%2Cpublic%3Asiropu_ads_manager_ad.less%2Cpublic%3Astructured_list.less%2Cpublic%3AsvLazyImageLoader.less%2Cpublic%3Asv_bbcode_modinterrupt.less%2Cpublic%3Aextra.less&s=2&l=1&d=1720282279&k=c048f6595aba8703c7daebcd13bb9ac2c28845d7"
  ["_GET"] => array(4) {
    ["svg"] => string(28) "sv_bbcode_modinterrupt_alert"
    ["s"] => string(1) "2"
    ["l"] => string(1) "1"
    ["d"] => string(10) "1720282279"
  }
  ["_POST"] => array(0) {
  }
}
This is actually an issue with Advanced bb-codes pack add-on usage of a template function (parse_less_func) added by in this add-on. Will look into it, but a lot of my add-ons are still not fully ready for XF2.3

This appears to be an XF2.3 change in behavior for how some of the LESS functions work, I'm looking into a workaround
 
Last edited:
It sounds like you're still working on XF2.3 compatibility, Xon? I'm holding off on upgrading my sites at the moment, as having your various mods working is well worth the wait. :)
 
Yes, I've been working on XF2.3 compatibility for my add-ons. I was hoping for a release for this add-on this week but it may be next week. This will unblock updating a bunch of my add-ons in sort order followed by the more complex search addons hopefully within the month.
 
While this add-on works with XF2.3, 1.21.0 will update a number of javascript files to support XF2.3 and XF2.2 which are required for a number of my other add-ons.
 
While this add-on works with XF2.3, 1.21.0 will update a number of javascript files to support XF2.3 and XF2.2 which are required for a number of my other add-ons.
I'm a bit confused as Standard Library doesn't say it supports 2.3 however If I'm using User Essentials and Persistent Alerts which 2.3 compatible and require SL, does that mean those are OK to use with 2.3?
 
StandardLib itself is fine to use with XF2.3. There will be a future update for this add-on when I release a number of updates dependant on the next SL version.

User Essentials needs another check since apparently something broke with XF2.3.0, and Persistent Alerts isn't something I've tested with XF2.3.
 
and Persistent Alerts isn't something I've tested with XF2.3.
However the resource page does show as compatible with 2.3 and my tests so for show that it worked insofar as my test user got alerts that appeared to be persistent.
 
Hi,

I tried to upgrade to latest version via command line, but got an error. Potentially issue is not with addon?

Please see:

Code:
An exception occurred: [ErrorException] [E_WARNING] Undefined array key "REMOTE_ADDR" in src/config.php on line 13
#0 src/config.php(13): XF::handlePhpError(2, '[E_WARNING] Und...', '/home/...', 13)
#1 src/XF/App.php(264): require('/home/wj...')
#2 src/XF/Container.php(33): XF\App->XF\{closure}(Object(XF\Container))
#3 src/XF/App.php(3834): XF\Container->offsetGet('config')
#4 src/XF/App.php(2228): XF\App->container('config')
#5 src/XF/Cli/App.php(25): XF\App->setup()
#6 src/XF.php(771): XF\Cli\App->setup(Array)
#7 src/XF/Cli/Runner.php(58): XF::setupApp('XF\\Cli\\App')
#8 cmd.php(17): XF\Cli\Runner->run()
#9 {main}

line 12/13 of config are;
Code:
if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; }
$_SERVER["REMOTE_ADDR"] = ( isset($_SERVER["HTTP_X_REAL_IP"]) ? $_SERVER["HTTP_X_REAL_IP"] : $_SERVER["REMOTE_ADDR"] );

Thank you
 
Last edited:
Those errors are unrelated to this add-on.

I strongly recommend removing those line in your config, as that is quite insecure and will trust arbitrary headers for what is the client's IP.

Note; Xenforo will securely handle HTTP_CF_CONNECTING_IP/HTTP_X_REAL_IP for you.
 
  • Like
Reactions: Maa
Those errors are unrelated to this add-on.

I strongly recommend removing those line in your config, as that is quite insecure and will trust arbitrary headers for what is the client's IP.

Note; Xenforo will securely handle HTTP_CF_CONNECTING_IP/HTTP_X_REAL_IP for you.
Thank you, I thought it wasn't related, but it only occurred after trying to upgrade the addon. I have raised it with XF in another thread. I have tagged you if you have any recommended fixes please. Removing the lines gives all the users the same IP.
 
Xon updated Standard Library by Xon with a new update entry:

1.21.1 - XenForo 2.3 support

  • XF2.3 support
    • Various .js files should work with XF2.1/XF2.2/XF2.3
  • Fix hasDesiredAddOnVersion could error if the target addon was in a processing state
  • Fix Standard Lib: Log parse_less_func debug info option not working
  • Backport <xf:macro name="template::macro syntax to to XF2.1
  • Update parse_less_color to not return CSS variables where possible
  • Bundle choices.js as a near drop-in replacement...

Read the rest of this update entry...
 
Back
Top Bottom