-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Craft CMS 4 update issues #58
Comments
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 {% set sites = craft.app.getSites().getGroupById(currentSite.groupId).getSites() | filter(site => site.baseUrl is not empty) %}
...
{% for site in sites %}
... ...which is what the |
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)"} |
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! |
Hi, I've updated to Craft CMS 4 recently and started noticing this issue on a few pages on the en-us side.
Not sure exactly why it's throwing an internal server error:
TypeError: vaersaagod\geomate\helpers\GeoMateHelper::getCurrentLinkForSite(): Return value must be of type string|bool, null returned in /app/vendor/vaersaagod/geomate/src/helpers/GeoMateHelper.php:147
I'm not sure if it has to do with it, but on Craft CMS 3 my language toggle code worked perfectly.
But in Craft CMS 4, this was throwing an error due to {% for site in sites if site.baseUrl is not empty %}
So I changed this to:
Any help is greatly appreciated.
The text was updated successfully, but these errors were encountered: