Resource icon

Standard Library by Xon 1.22.5

No permission to download
There seems to be a typo in the version number (2.21.15) - here and on your site as well. ;)
 
Xon updated Standard Library by Xon with a new update entry:

1.22.2 - Feature update

  • Workaround unexpected behavior in \XF::options() and strongly typed property hints (generated by XF CLI command xf-dev:generate-options-stub) which may cause bugs in some add-ons
  • Update choices.js v11.1.0
    • Remove role="textbox" from search input, per a11y practices
    • Add choices.search-kmp.js build, more advanced than a simple prefix match but less complex than using FUSE for search
    • Support <option label="..."...

Read the rest of this update entry...
 
Updated a few addons to latest version this morning and now seeing this server error while running XF2.3.6

I am unable to see user IP addresses, member IP tab within ACP fails to load as does IP addresses in moderator menu on the front end

Not sure if this should be posted here or over on @digitalpoint cloudflare app pages as the error references both ?
Disabling either addon restores normal functionality, turn them both on together and errors return

Code:
Server error log
Error: Template public:member_ip_list error: Call to undefined method SV\StandardLib\XF\Template\TemplaterXF21Patch::filterGeo() src/addons/DigitalPoint/Cloudflare/XF/Template/Templater.php:41
Generated by: Pauly 27 Mar 2025 at 07:05
Stack trace
#0 src/XF/Template/Templater.php(1186): DigitalPoint\Cloudflare\XF\Template\Templater->filterGeo(Object(SV\StandardLib\XF\Template\Templater), [invalid], false)
#1 internal_data/code_cache/templates/l3/s2/public/member_ip_list.php(25): XF\Template\Templater->filter([invalid], Array, false)
#2 src/XF/Template/Templater.php(1799): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#3 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('member_ip_list', Array)
#4 src/XF/Mvc/Renderer/Json.php(86): XF\Template\Template->render()
#5 src/XF/Mvc/Renderer/Json.php(70): XF\Mvc\Renderer\Json->renderHtmlFallback('XF:Member\\UserI...', 'public:member_i...', Array)
#6 src/XF/Mvc/Dispatcher.php(471): XF\Mvc\Renderer\Json->renderView('XF:Member\\UserI...', 'public:member_i...', Array)
#7 src/XF/Mvc/Dispatcher.php(453): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#8 src/XF/Mvc/Dispatcher.php(412): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Json), Object(XF\Mvc\Reply\View))
#9 src/XF/Mvc/Dispatcher.php(66): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'json')
#10 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#11 src/XF.php(806): XF\App->run()
#12 index.php(23): XF::runApp('XF\\Pub\\App')
#13 {main}
Request state
array(4) {
  ["url"] => string(136) "/members/xxxx.9999/user-ips?_xfResponseType=json&_xfWithData=1&_xfRequestUri=%2F&_xfToken=1743059113%2Cafa305d347101d2a8ef41c63b4d26a32"
  ["referrer"] => string(24) "https://www.t6forum.com/"
  ["_GET"] => array(5) {
    ["/members/xxxx_9999/user-ips"] => string(0) ""
    ["_xfResponseType"] => string(4) "json"
    ["_xfWithData"] => string(1) "1"
    ["_xfRequestUri"] => string(1) "/"
    ["_xfToken"] => string(43) "1743059113,afa305d347101d2a8ef41c63b4d26a32"
  }
  ["_POST"] => array(0) {
  }
}
 
Last edited:
I'm unsure how my add-on is triggering that as none of my add-ons touch the filterGeo method, I'm guessing how @digitalpoint is using get_parent_class is resulting in unexpected behavior.

Can you run this linux CLI command? It should see if any other add-on is implementing the method:
Code:
grep -Ri filterGeo src/addons
 
This is the output

Code:
 grep -Ri filterGeo src/addons
src/addons/DigitalPoint/Cloudflare/XF/Template/Templater.php:                   'geo' => 'filterGeo',
src/addons/DigitalPoint/Cloudflare/XF/Template/Templater.php:   public function filterGeo($templater, $value, &$escape, $item = null)
src/addons/DigitalPoint/Cloudflare/XF/Template/Templater.php:           if ($ipObject === null && method_exists(get_parent_class($this), 'filterGeo'))
src/addons/DigitalPoint/Cloudflare/XF/Template/Templater.php:                   $ipObject = parent::filterGeo($templater, $binaryValue, $escape, $item);
 
I'm unsure how my add-on is triggering that as none of my add-ons touch the filterGeo method, I'm guessing how @digitalpoint is using get_parent_class is resulting in unexpected behavior.

Can you run this linux CLI command? It should see if any other add-on is implementing the method:
Code:
grep -Ri filterGeo src/addons
Ya... switched back to is_callable() because get_parent_class() apparently does unexpected things with XenForo's class extension system. Specifically, if there's a class extension for a class with an execution order higher than my Cloudflare one, you end up with the error.

If SV\StandardLib\XF\Template\TemplaterXF21Patch has an execution order > 1000, then when it's running filterGeo(), somehow it thinks the parent class of filterGeo is DigitalPoint\Cloudflare\XF\Template\Templater, even though it's executing code from that class.

It seems weird to me, but I'm just chalking it up to how XenForo's class extension system works.

TLDR: is_callable() returns a different (the correct parent class,) while get_parent_class() returns the wrong parent class with XenForo class extensions, depending on execution order of class extensions.
 
Hi,

Tried to upgrade via command line but error;

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...', '/root/..', 13)
#1 src/XF/App.php(164): require('/root/...')
#2 src/XF/Container.php(30): XF\App->XF\{closure}(Object(XF\Container))
#3 src/XF/App.php(3307): XF\Container->offsetGet('config')
#4 src/XF/App.php(1862): XF\App->container('config')
#5 src/XF/Cli/App.php(25): XF\App->setup()
#6 src/XF.php(485): XF\Cli\App->setup(Array)
#7 src/XF/Cli/Runner.php(54): XF::setupApp('XF\\Cli\\App')
#8 cmd.php(15): XF\Cli\Runner->run()
#9 {main}

I had issues upgrading last time but this resolved it for past upgrades: https://xenforo.com/community/threads/upgrading-throws-config-error.223288/#post-1692567 but how am I supposed to upgrade this addon now -- that line is still the same?
 
Last edited:
Your config file is setup poorly and contains a reference to $_SERVER which has an unguarded access:

Instead of
PHP:
if ($_SERVER['REMOTE_ADDR'] == '...')
Use
PHP:
if (($_SERVER['REMOTE_ADDR'] ?? '') == '...')

The contents of $_SERVER change depending on if it called from the CLI or the web. There just is no IP for the request if invoked from the CLI
 
  • Like
Reactions: Bob
Xon updated Standard Library by Xon with a new update entry:

1.22.5 - Maintenance & Bugfix update

  • Partial workaround for buggy XF2.3 behavior around repository uniqueness. Does not affect call sites to \XF::repository, only Helper::repository
  • Fix incorrectly using SqlJoinTrait would swallow the actual error
  • Improve detection of excluding non-required joins when using EarlyJoinFinderTrait. This affects Multi Prefix is optimizing for matching on a single prefix, and also Extended Ignore
  • Remove usage of assert() for XF Cloud...

Read the rest of this update entry...
 
Last edited:
I have 1.22.4 for use with Attachment Improvements. Do I need to upgrade it to 1.22.5?
I would recommend updating. This contains a workaround for some buggy XF2.3 behavior which can break some of my add-ons (missed adding that to the release notes)
 
In my account it says update available, but I can't quite see where to download it. Do I just use "Download" in the licence section again? Or is that just for the original addon?

Edit - it;s ok I can see above the download button it mentions the new version, so found the right download. I've installed as "overwrite files" - is that correct?
 
Back
Top Bottom