Überprüfung von allen Aufrufen von getPrimaryInstance() außer in Navigation abgeschlossen. Sollte jetzt, soweit ich das erkennen konnte, korrekt sein.

git-svn-id: https://svn.libreccm.org/ccm/trunk@269 8810af33-2d31-482b-a856-94f89814c4df
master
quasi 2009-09-29 07:00:18 +00:00
parent c559db1ad7
commit 36e5dd7b66
6 changed files with 1009 additions and 1005 deletions

View File

@ -885,8 +885,7 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
HttpServletRequest req = Web.getRequest();
final ContentItem resolved;
if (req != null) {
resolved = ((ContentBundle) item)
.negotiate(req.getLocales());
resolved = ((ContentBundle) item).negotiate(req.getLocales());
} else {
// fallback to the primary instance when request is not available
resolved = ((ContentBundle) item).getPrimaryInstance();

View File

@ -21,6 +21,7 @@ package com.arsdigita.london.atoz;
import com.arsdigita.cms.ContentBundle;
import com.arsdigita.cms.ContentItem;
import com.arsdigita.cms.ContentPage;
import com.arsdigita.dispatcher.DispatcherHelper;
import com.arsdigita.persistence.DataQuery;
import com.arsdigita.persistence.Filter;
import com.arsdigita.persistence.OID;
@ -58,7 +59,11 @@ public class AtoZItemGenerator extends AbstractAtoZGenerator {
bundle = new ContentBundle(new BigDecimal(entries.get("id")
.toString()));
if (bundle != null) {
item = bundle.getPrimaryInstance();
/* Fix by Quasimodo*/
/* getPrimaryInstance doesn't negotiate the language of the content item */
/* item = bundle.getPrimaryInstance(); */
item = bundle.negotiate(DispatcherHelper.getRequest().getLocales());
if (item != null) {
// this is necessary because aliases refer to the non-live
// version,