#29 — vdex import fails to populate fields on VdexVocabulary
| State | Resolved |
|---|---|
| Version: | 1.1 |
| Area | Functionality |
| Issue type | Bug |
| Severity | Medium |
| Submitted by | Tom Elliott |
| Submitted on | Nov 21, 2006 |
| Responsible | Jens W. Klein |
| Target release: |
—
|
Last modified on
Jan 08, 2009
by
Matthew Wilkes
This applies to both 1.1-beta and SVN trunk, running on windows in debug mode with: Plone 2.5.1, CMF-1.6.2, Zope (Zope 2.9.5-final, python 2.4.3, win32), Five 1.4.2, Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)], PIL 1.1.5.
Values for the following fields on the VdexVocabulary type are not populated from file data when the file is imported using the vocabulary tool:
* VocabularyIdentifier (label='VDEX Identifier')
* OrderSignificant (label='Ordersignificant')
* ProfileType (label='Profile Type')
* RegistrationStatus (label='Registration Status')
* DefaultLanguage (label='Default Language')
These fields retain the default values specified in types/vdex/schemata.py.
Terms and langstrings, however, *are* populated from file, and their fields appear to be properly populated.
Note that the failure to populate DefaultLanguage also causes incorrect assignment of VdexVocabulary title. ATVM code picks the first langstring found in the vocabName, instead of the one whose language attribute value matches the default language attribute value set in the document element.
The ATVM unit tests do not check the values of these fields closely, and therefore do not catch this problem. An experimental, partial unit test that *does* check these fields reproduces the same error. Moreover, an experimental, partial unit test that attempts to write and then read from these fields also gets the default values back; i.e., the mutators seem to fail silently to change the values stored on the object.
The example vdex files shipped in tests/data do not contain a full set of attributes suitable for testing. The steps below use an alternative, valid vdex file that differs more starkly from the defaults set in types/vdex/schemata.py.
This behavior can be observed regardless of the installation status of LinguaPlone, PloneLanguageTool or Marshall.
- Steps to reproduce:
- Download http://www.unc.edu/awmc/thesauri/AWMCLanguages.xml
Using portal_vocabularies, perform a VDEX-upload of this file
Browse to portal_vocabularies/AWMCLanguages.xml/view
VDEX Identifier should be "AWMCLanguages" but is ""
Profile Type should be "thesaurus"
Default Language should be "en" but is ""
Vocabulary name should have been set to "Standard Codes for Languages and Writing Systems Used in AWMC Publications" but instead is set to "Standardcodes für die Sprachen und Schreiben Systeme benutzt in den AWMC Publikationen"
The other fields match the source XML file, but this is because the defaults are the same as what we're using in the XML
Added byTom ElliottonMar 01, 2007 11:31 PM
Attempted with a fresh install in preparation for the ATVM sprint. portal_vocabularies now throws an "AttributeError" = "getTranslations" when attempting to upload the vdex file cited above, which *is* http://plone.org/products/atvocabularymanager/issues/34Responsible manager:
jensens
→
(UNASSIGNED)
So can't verify status of this bug ... issue 34 blocks it.
Plone 2.5.2, CMF-1.6.2, Zope (Zope 2.9.5-final, python 2.4.3, win32), Five 1.4.2, Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)], PIL 1.1.5, LinguaPlone 0.9.0, PloneLanguageTool 1.5.
All language codes used in the VDEX file were already enabled in the Plone, via PLT. Or is this a LinguaPlone bug?
2007-03-01T17:23:08 ERROR Archetypes None
Traceback (most recent call last):
File "C:\Program Files\Plone 2\Zope\lib\python\Products\Archetypes\BaseObject.py", line 174, in initializeArchetype
self.setDefaults()
File "C:\Program Files\Plone 2\Zope\lib\python\Products\Archetypes\BaseObject.py", line 457, in setDefaults
self.Schema().setDefaults(self)
File "C:\Program Files\Plone 2\Zope\lib\python\Products\Archetypes\Schema\__init__.py", line 492, in setDefaults
mapply(mutator, *args, **kw)
File "C:\Program Files\Plone 2\Zope\lib\python\Products\Archetypes\utils.py", line 159, in mapply
return method(*call_args, **kw)
File "C:\Program Files\Plone 2\Zope\lib\python\Products\LinguaPlone\utils.py", line 85, in generatedMutator
translations = [t[0] for t in self.getTranslations().values()]
AttributeError: getTranslations
------
2007-03-01T17:23:09 ERROR Zope.SiteErrorLog http://localhost/portal_vocabularies/vocabularytool_view
Traceback (innermost last):
Module ZPublisher.Publish, line 115, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 41, in call_object
Module Products.CMFFormController.FSControllerPageTemplate, line 90, in __call__
Module Products.CMFFormController.BaseControllerPageTemplate, line 28, in _call
Module Products.CMFFormController.ControllerBase, line 232, in getNext
- __traceback_info__: ['id = vocabularytool_view', 'status = success', 'button=None', 'errors={}', 'context=<VocabularyLibrary at portal_vocabularies>', 'kwargs={}', 'next_action=None', '']
Module Products.CMFFormController.Actions.TraverseTo, line 38, in __call__
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 41, in call_object
Module Products.CMFFormController.FSControllerPythonScript, line 104, in __call__
Module Products.CMFFormController.Script, line 145, in __call__
Module Products.CMFCore.FSPythonScript, line 108, in __call__
Module Shared.DC.Scripts.Bindings, line 311, in __call__
Module Shared.DC.Scripts.Bindings, line 348, in _bindAndExec
Module Products.CMFCore.FSPythonScript, line 164, in _exec
Module None, line 8, in vdex_processupload
- <FSControllerPythonScript at /Plone/vdex_processupload used for /Plone/portal_vocabularies>
- Line 8
Module Products.Archetypes.AllowedTypesByIface, line 124, in invokeFactory
Module Products.CMFCore.TypesTool, line 934, in constructContent
Module Products.CMFCore.TypesTool, line 345, in constructInstance
Module Products.CMFCore.TypesTool, line 357, in _finishConstruction
Module Products.CMFCore.CMFCatalogAware, line 145, in notifyWorkflowCreated
Module Products.CMFCore.WorkflowTool, line 354, in notifyCreated
Module Products.CMFCore.WorkflowTool, line 695, in _reindexWorkflowVariables
Module Products.Archetypes.CatalogMultiplex, line 97, in reindexObject
Module Products.Archetypes.ExtensibleMetadata, line 462, in notifyModified
Module Products.LinguaPlone.utils, line 85, in generatedMutator
AttributeError: getTranslations
Added byTom ElliottonMar 02, 2007 03:39 AM
With rsantos' patch in place for http://plone.org/products/atvocabularymanager/issues/34 this bug is now not reproducible on:
Plone 2.5.2, CMF-1.6.2, Zope (Zope 2.9.5-final, python 2.4.3, win32), Five 1.4.2, Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)], PIL 1.1.5, LinguaPlone 0.9.0, PloneLanguageTool 1.5., ATVM from svn trunk at r7545.
Recommend close as not observed / won't fix?
Added byJens W. KleinonMar 02, 2007 08:03 AM
fixed, patch from #34 applied
Issue state:
unconfirmed
→
resolved
Responsible manager:
(UNASSIGNED)
→
jensens
Add response
If you can, please log in before submitting a reaction.