Giter Club home page Giter Club logo

Comments (3)

mmikkel avatar mmikkel commented on August 28, 2024

Thanks for reporting that @mateostabio. That exception is due to a bug in GeoMate which is triggered by the stricter typing in PHP 8 – I'll get that fixed ASAP.

The exception will only happen when a site's baseUrl is null/empty, so to circumvent the issue until I can get this patched you might want to filter out any sites without URLs:

{% set sites = craft.app.getSites().getGroupById(currentSite.groupId).getSites() | filter(site => site.baseUrl is not empty) %}
...
{% for site in sites %}
...

...which is what the {% for site in sites if site.baseUrl is not empty %} conditional accomplished previously, but Twig has removed support for if statements within {% for %} tags in v. 3, which is what Craft 4 ships with.

from geomate.

mateostabio avatar mateostabio commented on August 28, 2024

Thanks for the quick reply! But it's still throwing this error:

2023-03-24 12:40:56 [web.ERROR] [TypeError] vaersaagod\geomate\helpers\GeoMateHelper::getCurrentLinkForSite(): Return value must be of type string|bool, null returned {"trace":["#0 /app/vendor/vaersaagod/geomate/src/services/RedirectService.php(114): vaersaagod\geomate\helpers\GeoMateHelper::getCurrentLinkForSite(Object(craft\models\Site), true)","#1 /app/vendor/vaersaagod/geomate/src/services/RedirectService.php(43): vaersaagod\geomate\services\RedirectService->getRedirectInfo()","#2 /app/vendor/vaersaagod/geomate/src/GeoMate.php(179): vaersaagod\geomate\services\RedirectService->autoRedirect()","#3 /app/vendor/vaersaagod/geomate/src/GeoMate.php(127): vaersaagod\geomate\GeoMate->redirectCheck()","#4 [internal function]: vaersaagod\geomate\GeoMate->vaersaagod\geomate\{closure}(Object(yii\base\Event))","#5 /app/vendor/yiisoft/yii2/base/Component.php(633): call_user_func(Object(Closure), Object(yii\base\Event))","#6 /app/vendor/craftcms/cms/src/base/ApplicationTrait.php(1560): yii\base\Component->trigger('init')","#7 /app/vendor/craftcms/cms/src/web/Application.php(106): craft\web\Application->_postInit()","#8 /app/vendor/yiisoft/yii2/base/BaseObject.php(109): craft\web\Application->init()","#9 /app/vendor/yiisoft/yii2/base/Application.php(204): yii\base\BaseObject->__construct(Array)","#10 [internal function]: yii\base\Application->__construct(Array)","#11 /app/vendor/yiisoft/yii2/di/Container.php(419): ReflectionClass->newInstanceArgs(Array)","#12 /app/vendor/yiisoft/yii2/di/Container.php(170): yii\di\Container->build('craft\\web\\Appli...', Array, Array)","#13 /app/vendor/yiisoft/yii2/BaseYii.php(365): yii\di\Container->get('craft\\web\\Appli...', Array, Array)","#14 /app/vendor/craftcms/cms/src/Craft.php(54): yii\BaseYii::createObject(Array, Array)","#15 /app/vendor/craftcms/cms/bootstrap/bootstrap.php(252): Craft::createObject(Array)","#16 /app/vendor/craftcms/cms/bootstrap/web.php(40): require('/app/vendor/cra...')","#17 /app/web/index.php(11): require('/app/vendor/cra...')","#18 {main}"],"memory":8570400,"exception":"[object] (TypeError(code: 0): vaersaagod\geomate\helpers\GeoMateHelper::getCurrentLinkForSite(): Return value must be of type string|bool, null returned at /app/vendor/vaersaagod/geomate/src/helpers/GeoMateHelper.php:147)"}

from geomate.

mmikkel avatar mmikkel commented on August 28, 2024

Sorry, on further thought I guess that fix wouldn't have worked regardless as the issue was a return type conflict internally in GeoMate.

Should be fixed in GeoMate 2.1.1 though!

from geomate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.