Ticket #12468 (confirmed Bug)

Opened 4 years ago

Last modified 4 years ago

portal_state variable in plone.app.theming parameters does not use context

Reported by: frisi Owned by: ldr
Priority: major Milestone: 4.x
Component: Diazo (plone.app.theming) Version: 4.1
Keywords: Cc:

Description (last modified by frisi) (diff)

when using portal_state as a variable to define parameters, the result is not as expected:

consider these 3 parameters defined in the manifest.cfg file:

[theme:parameters]
impress1 = string:${portal_state/navigation_root_url}/impressum
impress2 = string:${context_state/current_base_url}/impressum
impress3 = python:context.restrictedTraverse('@@plone_portal_state').navigation_root_url() + '/impressum'

in rules.xml we use the variable as a link tarket of #footer a.impress:

<prepend css:theme="#footer .impress"><xsl:attribute name="href"><xsl:value-of select="$impress"/></xsl:attribute></prepend>

now we use the theme on the folder portal/navroot/subfolder (where navroot is marked as INavigationRoot) we get the following results for the different variables:

impress1 = portal/impressum
impress2 = portal/navroot/subfolder/impressum
impress3 = portal/navroot/impress

impress2 and impress3 behave as expected, whereas impress1 should lead to the same result as impress3.

it seems that the context of the portal_state variable default to the portal instead of the current context (as context_state does it).

plone 4.1.3 with plone.app.theming-1.0b9

Change History

comment:1 Changed 4 years ago by kleist

Please always specifiy which Plone version an issue is about. Thanks!

comment:2 Changed 4 years ago by frisi

  • Description modified (diff)

how could i forget? thanks for the reminder

Last edited 4 years ago by frisi (previous) (diff)

comment:3 Changed 4 years ago by ldr

  • Status changed from new to closed
  • Version set to 4.1
  • Resolution set to fixed

comment:4 Changed 4 years ago by frisi

  • Status changed from closed to reopened
  • Resolution fixed deleted

the context is correct in 1.0 final release now.

however, there's still some strange behaviour. see the example below:

impress1 = string:${portal_state/navigation_root_url}/foo
impress2 = string:${portal_state/navigation_root_path}/foo

for navigation_root_url the string expression is not correctly evaluated (/foo is missing). for path it works:

impress1 -> http://nohost/Plone/navroot
impress2 -> Plone/navroot/foo

comment:5 Changed 4 years ago by kleist

  • Milestone set to 4.x

comment:6 Changed 4 years ago by kleist

  • Status changed from reopened to confirmed
Note: See TracTickets for help on using tickets.