I am trying to upgrade Plone 6.0 project to 6.1 (simple policy package, simple theme). After upgrade, the theme is not correctly rendered and we see this error
runtime error, element 'link' [72:0]
> Variable 'portal_url' has not been declared.
[0:0]
Undefined variable [0:0]
caused by the backend.xml of Barceloneta
<!-- We can't control the bundle from here due to include. Just hard code -->
<after css:theme-children="head">
<link href="{$portal_url}/++theme++barceloneta/css/barceloneta.css"
rel="stylesheet"
/>
</after>
There were no upgrade step because it is a sort of workaround only for backend.xml and then upgrading existing projects with this was 99% unused. You (and me) got the 1%
This was the discussion:
There's a drawback: portal_url is calculated and cached on startup (at the first theme rendering exactly), so this does not support sites with multiple address. If your site addresses (VHM) are test.com and anothertest.com, then the first site win and portal_url is set to it. But using backend.xml and having also multiple site addresses is quite uncommon.
The real fix is Diazo providing the portal_url as a variable in the xsl compiled transformation.