#279 — ZMI Setting "Allow content language fallback." is not reflected in Portal Setup diffs.

by Armin Stross-Radschinski last modified Aug 09, 2011 08:10 PM
State Unconfirmed
Version: 4.x
Area Functionality
Issue type Bug
Severity Medium
Submitted by Armin Stross-Radschinski
Submitted on Aug 09, 2011
Responsible
Target release:
The language fallback for LinguaPlone is not working as expected.

Language neutral content is not showing up in all language specific folders created by the initial procedure.

When trying to go through trials of setups (including the one described in issue #262) the following symptom was discovered:

The ZMI Setting "Allow content language fallback." in the Plone Language Tool at /Plone/portal_languages is not reflected in Portal Setup or diffs.

Missing to see the property recognizable by portal setup may not be a failure but it seems not to be inside LinguaPlone but inside Plone 4.1 core.

Not sure if this is relevant to the issue #262 but may be the reason why the feature is not working. This setting is not stored in the portal properties. I searched for it elsewhere but did not get close for now.
Steps to reproduce:
Plone 4.109 installed with LinguaPlone 4.0.4 and slc.linguatools 1.4.0 via buildout.

Starting with a vanilla site.

First create a snapshot of your configuration after a vanilla LinguaPlone install with the Generic Setup Tool at  /Plone/portal_setup/manage_snapshots

In the ZMI in the Plone site root's Plone Language Tool at /Plone/portal_languages change the following values:

...
Part:
"Content Control Settings"
set 2. [] "Allow content language fallback." to [X]
set 3. [] "Create content initially as neutral language." to [X]

Save the form!

Create a second snapshot of the new configuration with the Generic Setup Tool at  /Plone/portal_setup/manage_snapshots

Create a diff between the two configurations with Generic Setup Tool at  /Plone/portal_setup/manage_showDiff


The result is:

Index: portal_languages.xml
===================================================================
--- portal_languages.xml 2011/08/09 10:50:52.438809 GMT+2
+++ portal_languages.xml 2011/08/09 10:51:45.353099 GMT+2
@@ -9,7 +9,7 @@
  <use_content_negotiation value="True"/>
  <use_combined_language_codes value="False"/>
  <display_flags value="False"/>
- <start_neutral value="False"/>
+ <start_neutral value="True"/>
  <use_subdomain_negotiation value="False"/>
  <authenticated_users_only value="False"/>
  <supported_langs>

As you can see the setting for "Allow content language fallback." is not reflected!

If you try this with vanilla Plone 4.109 without installing any add-on you get the same form, can select the same options and save.

Comparing the snapshots will create a similar result:

Index: portal_languages.xml
===================================================================
--- portal_languages.xml 2011/08/09 11:35:50.012687 GMT+2
+++ portal_languages.xml 2011/08/09 11:36:38.459848 GMT+2
@@ -9,7 +9,7 @@
  <use_content_negotiation value="False"/>
  <use_combined_language_codes value="False"/>
  <display_flags value="False"/>
- <start_neutral value="False"/>
+ <start_neutral value="True"/>
  <use_subdomain_negotiation value="False"/>
  <authenticated_users_only value="False"/>
  <supported_langs>
Added by Armin Stross-Radschinski on Aug 09, 2011 08:10 PM
After doing some research & grepping the sources I can provide the following additional information:

The management of the settings seems to take place in:
Products.PloneLanguageTool-3.2.3-py2.6.egg/Products/PloneLanguageTool/LanguageTool.py

...
    # These apply to existing instances when code is upgraded
    # Mutable class default explains careful copying of list below...
...

line: 66
    allow_content_language_fallback = 0
...
    manage_configForm = PageTemplateFile('www/config', globals())

    def __init__(self):
        # These apply to new instances
...
Line: 96
        self.allow_content_language_fallback = 0
...
    security.declareProtected(ManagePortal, 'manage_setLanguageSettings')
    def manage_setLanguageSettings(self, defaultLanguage, supportedLanguages,
...
line: 121
                                   setAllowContentLanguageFallback=None,
...
        """Stores the tool settings."""
line: 180ff
        if setAllowContentLanguageFallback:
            self.allow_content_language_fallback = 1
        else:
            self.allow_content_language_fallback = 0
...

The webinterface template in the ZMI is located here:
Products.PloneLanguageTool/Products/PloneLanguageTool/www/config.zpt

There is a inconsistency in the handling of the settings silently reported here:

at Generic Setup Tool at /PloneLanguageToolTest/portal_setup
"[Manage] steps registry" Tab

...
This form allows one to manage the persistent import and export step registries. Steps registered via ZCML are not shown here.
Import steps

There are no import steps with an invalid step handler.

There are no import steps that are both registered via ZCML and listed in the persistent step registry.
Export steps

There are no export steps with an invalid step handler.
Doubly registered steps

These export steps are both registered via ZCML and listed in the persistent step registry.
Sel. Title / Description Handler
    Plone Language Tool
Export language settings. Products.PloneLanguageTool.exportimport.exportLanguageTool

No responses can be added.