Open williamhibberd opened 9 months ago
I suspect this issue may be related to caching. Today, I conducted some tests on a new database, which unfortunately led to encountering additional problems.
While configuring my sites, which support seven different languages, I encountered an issue with the depreciation of the Portuguese language code, 'pt'. Despite setting the language to 'pt-PT,' I continued to encounter the deprecation error.
In an attempt to resolve this, I considered deleting the Portuguese site and adding it again. However, this approach resulted in encountering the aforementioned 'Impossible to access an attribute ("groupId") on a null variable' error once again.
Hey @williamhibberd, could you give us a bit more context regarding the setup of the sites and sitegroups in your install?
Regarding the renaming & removing of sites, were there any propagation jobs still running in the queue at the time you get the error? (and are you still seeing the error once all these jobs have finished running?)
Sure I have recorded this screen cast to show you what is going on: https://www.loom.com/share/b8f7bcdaecaa48cc995414322e8e4bc5
Thanks for that, I can reproduce the issue on our end.
The problem lies in entry.section.siteSettings
, which still includes settings for the site that was deleted. These settings get clean up once Craft's internal garbage collection runs but before that they contain data for a site that doesn't exist anymore. I'll see how we can work around that and if we should report this as an issue with Craft itself.
Ok brilliant so if I run php craft gc/run
it should resolve my issues
Garbage collection worked for the first issue, but I am still having problems with translating to pt-PT. I don't want to hassle, but just letting you know.
Ok brilliant so if I run
php craft gc/run
it should resolve my issues
Yes, that should do the trick.
Garbage collection worked for the first issue, but I am still having problems with translating to pt-PT. I don't want to hassle, but just letting you know.
We're currently passing the full locale to DeepL as it is set in Craft, in your case that is pt-PT
. Which DeepL stopped supporting, but they do still support pt
. We'll look at a fix where we fall back to to the shorter locale.
I'll report back when we have a fix!
The error indicates that the situation might be reversed. It appears that 'pt' is not supported, but the locale 'pt-PT' is. Despite configuring the locale to 'pt-PT,' the error persists.
throw new DeepLException('targetLang="pt" is deprecated, please use "pt-PT" or "pt-BR" instead.');
Using verson 1.1 of the plugin, I am getting an error when visiting an entry in the CMS.
Impossible to access an attribute ("groupId") on a null variable.
The line in the error message that references
groudId
{% set otherSites = entry.section.siteSettings|filter(v => v.siteId != selectedSite.id and craft.app.sites.getSiteById(v.siteId).groupId == selectedSite.groupId) %}
The plugin seemed to be working fine before I renamed my default site from
DEFAULT
toen
Full error message: