[OzzModz] Country Flags by IP Address

[OzzModz] Country Flags by IP Address 2.2.1 Patch Level 3

No permission to download
How to make only text in postbit? Without flag. "France", "Italy", etc
 
Last edited:
@Ozzy47

I'm seeing this upon cron run: Deprecated: Required parameter $response follows optional parameter $options in /src/addons/Snog/Flags/CloudFlare/CloudflareMiddleware.php on line 77
 
Ozzy47 updated [OzzModz] Country Flags by IP Address with a new update entry:

[OzzModz] Country Flags by IP Address 2.2+ Update 2.2.0

Changelog:
  • Now requires XF 2.2+
  • PHP 8 compatibility
  • Removed useless Cloudflare Middleware
  • Refactor Maxmind API integration
  • Fix: check "last-modified" header for GeoIP Database file before updating
  • GeoIP Database file moved to "internal-data" and mounted to own filesystem for compatibility with XF setups with external storage

Read the rest of this update entry...
 
Seams to be causing white pages on my site after upgrade, disabled and pages load.
Tried both default and custom styles.

I'm pretty sure this is the problem.
Code:
src/addons/Siropu/AdsManagerLite/Vendor/MaxMind/geoip2/geoip2/src/Model/City.php:116

Thoughts?

My PHP info -> PHP Version 8.0.24

Xen 2.2.1

fv1.JPG

Server error log
  • ErrorException: Fatal Error: Declaration of GeoIp2\Model\City::__isset($attr) must be compatible with GeoIp2\Model\AbstractModel::__isset(string $attr): bool
  • src/addons/Siropu/AdsManagerLite/Vendor/MaxMind/geoip2/geoip2/src/Model/City.php:116
  • Generated by: CJ
  • Nov 1, 2022 at 2:43 PM

Stack trace​

#0 [internal function]: XF::handleFatalError()
#1 {main}

Request state​

array(4) {
["url"] => string(39) "/community/forums/sand-dirt-and-mud.50/"
["referrer"] => string(58) "https://jeep-cj.com/community/forums/sand-dirt-and-mud.50/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}



deb1.JPG
 
Seams to be causing white pages on my site after upgrade, disabled and pages load.
Tried both default and custom styles.

My PHP info -> PHP Version 8.0.24

Xen 2.2.1

View attachment 275818

Server error log
  • ErrorException: Fatal Error: Declaration of GeoIp2\Model\City::__isset($attr) must be compatible with GeoIp2\Model\AbstractModel::__isset(string $attr): bool
  • src/addons/Siropu/AdsManagerLite/Vendor/MaxMind/geoip2/geoip2/src/Model/City.php:116
  • Generated by: CJ
  • Nov 1, 2022 at 2:43 PM

Stack trace​

#0 [internal function]: XF::handleFatalError()
#1 {main}

Request state​

array(4) {
["url"] => string(39) "/community/forums/sand-dirt-and-mud.50/"
["referrer"] => string(58) "https://jeep-cj.com/community/forums/sand-dirt-and-mud.50/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}



View attachment 275826

@Painbaker
 
Server error log
  • ErrorException: Fatal Error: Declaration of GeoIp2\Model\City::__isset($attr) must be compatible with GeoIp2\Model\AbstractModel::__isset(string $attr): bool
  • src/addons/Siropu/AdsManagerLite/Vendor/MaxMind/geoip2/geoip2/src/Model/City.php:116
It seems that Ads Manager Lite add-on using a very old geoip2 library version to support XF < 2.1 and PHP < 7.2.

I can only advise to remove "composer_autoload" line from our add-on in add-on.json (along with a comma so as not to break the syntax).

From:

JSON:
    "icon": "fa-flag",
    "composer_autoload": "vendor/composer"
}

To:

JSON:
    "icon": "fa-flag"
}

Then execute php cmd.php xf-addon:sync Snog/Flags to apply changes


We can't downgrade this library in our add-on, because it will also possibly conflict with other add-ons that use a newer version.
 
Last edited:
Thanks, I'll find out if Siropu has thoughts of upgrading the Ads Manager Lite add-on.

I changed the file to on the server to
Code:
{
    "legacy_addon_id": "Snog_CountryFlags",
    "title": "[OzzModz] Country Flags by IP Address",
    "description": "Displays the flag of the country members are in using their IP Address location",
    "version_id": 2020000,
    "version_string": "2.2.0",
    "dev": "Ozzy47/Snog",
    "dev_url": "https://snogssite.com",
    "faq_url": "",
    "support_url": "https://snogssite.com/threads/country-flags-by-ip-address.2524/",
    "extra_urls": [],
    "require": {
        "XF": [
            2020000,
            "XenForo 2.2.0 Beta"
        ]
    },
    "icon": "fa-flag"
}
{
    "legacy_addon_id": "Snog_CountryFlags",
    "title": "[OzzModz] Country Flags by IP Address",
    "description": "Displays the flag of the country members are in using their IP Address location",
    "version_id": 2020000,
    "version_string": "2.2.0",
    "dev": "Ozzy47/Snog",
    "dev_url": "https://snogssite.com",
    "faq_url": "",
    "support_url": "https://snogssite.com/threads/country-flags-by-ip-address.2524/",
    "extra_urls": [],
    "require": {
        "XF": [
            2020000,
            "XenForo 2.2.0 Beta"
        ]
    },
    "icon": "fa-flag"
}
But it still causes the site to not load.
Any thoughts? Thanks for the help.

Code:
Server error log
[LIST]
[*]ErrorException: Fatal Error: Declaration of GeoIp2\Model\City::__isset($attr) must be compatible with GeoIp2\Model\AbstractModel::__isset(string $attr): bool
[*]src/addons/Siropu/AdsManagerLite/Vendor/MaxMind/geoip2/geoip2/src/Model/City.php:116
[*]Generated by: CJ
[*]Nov 1, 2022 at 3:33 PM
[/LIST]
[HEADING=2]Stack trace[/HEADING]
#0 [internal function]: XF::handleFatalError()
#1 {main}
[HEADING=2]Request state[/HEADING]
array(4) {
  ["url"] => string(39) "/community/forums/sand-dirt-and-mud.50/"
  ["referrer"] => string(58) "https://jeep-cj.com/community/forums/sand-dirt-and-mud.50/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
Did the command complete successfully? php cmd.php xf-addon:sync Snog/Flags


You need to replace the addon.json content with:

JSON:
{
    "legacy_addon_id": "Snog_CountryFlags",
    "title": "[OzzModz] Country Flags by IP Address",
    "description": "Displays the flag of the country members are in using their IP Address location",
    "version_id": 2020000,
    "version_string": "2.2.0",
    "dev": "Ozzy47/Snog",
    "dev_url": "https://snogssite.com",
    "faq_url": "",
    "support_url": "https://snogssite.com/threads/country-flags-by-ip-address.2524/",
    "extra_urls": [],
    "require": {
        "XF": [
            2020000,
            "XenForo 2.2.0 Beta"
        ]
    },
    "icon": "fa-flag"
}

(one time, don't add twice)

PS: With the next updates of this add-on you just need to delete this line with comma before it:
Code:
,    "composer_autoload": "vendor/composer"
 
@Ozzy47 Server error log:

Code:
ErrorException: Fatal Error: Declaration of GeoIp2\Model\City::__isset($attr) must be compatible with GeoIp2\Model\AbstractModel::__isset(string $attr): bool src/addons/Siropu/AdsManager/Vendor/MaxMind/geoip2/geoip2/src/Model/City.php:116

Generated by: Tanzu Nov 2, 2022 at 4:12 PM

Stack trace

#0 [internal function]: XF::handleFatalError()
#1 {main}

Request state

array(4) {
  ["url"] => string(11) "/whats-new/"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
Top Bottom