From 0b3af0af7459be70716a2f71b2e30c944d113fc4 Mon Sep 17 00:00:00 2001 From: jensp Date: Sat, 21 May 2011 08:03:39 +0000 Subject: [PATCH] =?UTF-8?q?Problem=20beim=20Verlinken=20von=20Personen=20u?= =?UTF-8?q?nd=20Sprachvarianten=20gel=C3=B6st.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@927 8810af33-2d31-482b-a856-94f89814c4df --- .../cms/contenttypes/GenericOrganizationalUnit.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java index 56788c64e..ed3d7b796 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java @@ -19,6 +19,7 @@ */ package com.arsdigita.cms.contenttypes; +import com.arsdigita.cms.ContentBundle; import com.arsdigita.cms.ContentPage; import com.arsdigita.domain.DataObjectNotFoundException; import com.arsdigita.persistence.DataCollection; @@ -119,7 +120,16 @@ public class GenericOrganizationalUnit extends ContentPage { public void addPerson(GenericPerson person, String role, String status) { Assert.exists(person, GenericPerson.class); - DataObject link = add(PERSONS, person); + GenericPerson personToLink = person; + + ContentBundle bundle = person.getContentBundle(); + if ((bundle != null) && (bundle.hasInstance(this.getLanguage()))) { + personToLink = (GenericPerson) bundle.getInstance(this.getLanguage()); + } + + Assert.exists(personToLink, GenericPerson.class); + + DataObject link = add(PERSONS, personToLink); link.set(ROLE, role); link.set(STATUS, status);