Index: main/plugin-link-directory/i18n/messages_en.xml
===================================================================
--- main/plugin-link-directory/i18n/messages_en.xml	(revision 29666)
+++ main/plugin-link-directory/i18n/messages_en.xml	(working copy)
@@ -163,8 +163,8 @@
     <message key="PLUGINS_LINKDIRECTORY_SERVICE_DISPLAY_THEMES">Themes: </message>
     <message key="PLUGINS_LINKDIRECTORY_SERVICE_NO_ENTRY">No link in the directory.</message>
     
-    <message key="PLUGINS_LINKDIRECTORY_DELETED_THEME_TITLE">Deleted themes</message>
-    <message key="PLUGINS_LINKDIRECTORY_DELETED_THEME_TEXT">{amount} deleted theme(s) still referenced by this service. Reconfigure the application to get rid of this error.</message>
+    <message key="PLUGINS_LINKDIRECTORY_DELETED_THEME_TITLE">Deleted or unexisting themes</message>
+    <message key="PLUGINS_LINKDIRECTORY_DELETED_THEME_TEXT">{amount} deleted theme(s) is (are) still referenced by this service. Reconfigure the application to get rid of this error.</message>
     <message key="PLUGINS_LINK_DIRECTORY_DELETED_THEME_NAMES">The following themes referenced in the file "link-themes.xml" do not exist: </message>
     
     <message key="PLUGINS_LINKDIRECTORY_CONFIGURE_LINKS">Customize</message>
Index: main/plugin-link-directory/i18n/messages_fr.xml
===================================================================
--- main/plugin-link-directory/i18n/messages_fr.xml	(revision 29666)
+++ main/plugin-link-directory/i18n/messages_fr.xml	(working copy)
@@ -160,7 +160,7 @@
     <message key="PLUGINS_LINKDIRECTORY_SERVICE_DISPLAY_THEMES">Thématiques : </message>
     <message key="PLUGINS_LINKDIRECTORY_SERVICE_NO_ENTRY">Aucun lien dans l'annuaire.</message>
     
-    <message key="PLUGINS_LINKDIRECTORY_DELETED_THEME_TITLE">Thématiques supprimées</message>
+    <message key="PLUGINS_LINKDIRECTORY_DELETED_THEME_TITLE">Thématiques supprimées ou inexistantes</message>
     <message key="PLUGINS_LINKDIRECTORY_DELETED_THEME_TEXT">Il y a {amount} thématique(s) supprimée(s) toujours référencée(s) par ce service. Reconfigurez le service pour ne plus avoir cette erreur.</message>
     <message key="PLUGINS_LINK_DIRECTORY_DELETED_THEME_NAMES">Les thématiques suivantes référencées dans le fichier "link-themes.xml" n'existent pas : </message>
 
Index: main/plugin-link-directory/pages/services/directory/directory_1.0.xsl
===================================================================
--- main/plugin-link-directory/pages/services/directory/directory_1.0.xsl	(revision 29666)
+++ main/plugin-link-directory/pages/services/directory/directory_1.0.xsl	(working copy)
@@ -64,6 +64,8 @@
         <xsl:call-template name="common-service-body-nonempty-content-title-content">
             <xsl:with-param name="title" select="$header"/>
         </xsl:call-template>
+        
+        <xsl:call-template name="wrong-or-deleted-themes"/>
     </xsl:template>
     
     <xsl:template name="common-service-body-empty">
@@ -78,8 +80,6 @@
     
     <xsl:template name="common-service-body-nonempty-content-content">
         
-        <xsl:call-template name="wrong-or-deleted-themes"/>
-        
         <div id="link-directory-{$uniqueId}">
         	<xsl:attribute name="class">link-directory-body<xsl:if test="/links/link/@pictureType != ''"><xsl:text> pictures</xsl:text></xsl:if></xsl:attribute>
             <ul class="links">
Index: main/plugin-link-directory/pages/services/directory/thumbnails_1.1.xsl
===================================================================
--- main/plugin-link-directory/pages/services/directory/thumbnails_1.1.xsl	(revision 29666)
+++ main/plugin-link-directory/pages/services/directory/thumbnails_1.1.xsl	(working copy)
@@ -68,9 +68,13 @@
             <xsl:with-param name="title" select="$header"/>
         </xsl:call-template>    
 
+        <!-- Display an error if the selected themes are invalid -->
+        <xsl:call-template name="wrong-or-deleted-themes"/> 
+        
     </xsl:template>
     
     <xsl:template name="common-service-body-empty">
+        
         <div class="ametys-cms-service {$common-service-css-class-name} wrapper">
             <xsl:call-template name="common-service-body-nonempty-content-title"/>
             <p>
@@ -80,10 +84,7 @@
     </xsl:template>
     
     <xsl:template name="common-service-body-nonempty-content-content">
-        
-        <!-- Display the errors if any -->
-        <xsl:call-template name="wrong-or-deleted-themes"/>   
-        
+    
         <!-- Display the links in thumbnails mode -->
         <xsl:call-template name="links-thumbnails">
             <xsl:with-param name="links" select="/links/link"/>
Index: main/plugin-link-directory/pages/services/directory/utils/config_utils.xsl
===================================================================
--- main/plugin-link-directory/pages/services/directory/utils/config_utils.xsl	(revision 29666)
+++ main/plugin-link-directory/pages/services/directory/utils/config_utils.xsl	(working copy)
@@ -184,15 +184,26 @@
      <!--  Rendering of the errors -->
     <xsl:template name="wrong-or-deleted-themes">
         <xsl:call-template name="wrong-or-deleted-themes-impl">
-            <xsl:with-param name="data" select="/links/deleted-themes"/>
+            <xsl:with-param name="target" select="'service'"/>
         </xsl:call-template>
     </xsl:template>
     
-         <!--  Rendering of the errors -->
+    
     <xsl:template name="wrong-or-deleted-themes-impl">
-        <xsl:param name="data"/>
+        <xsl:param name="target"/>
         
-        <xsl:if test="$data">
+        <xsl:variable name="data">
+            <xsl:choose>
+                <xsl:when test="$target = 'service'">
+                    <xsl:value-of select="/links/deleted-themes"/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:value-of select="/cms/inputData/linkDirectory/wrong-themes"/>
+                </xsl:otherwise>
+            </xsl:choose>
+        </xsl:variable>
+
+        <xsl:if test="$data != ''">
             <xsl:if test="$rendering-context = 'back'">
                 <div class="ametys-cms-zone-error">
                    <div class="ametys-cms-zone-item-error">
@@ -207,10 +218,18 @@
                                             <strong><i18n:text i18n:key="PLUGINS_LINKDIRECTORY_DELETED_THEME_TITLE" i18n:catalogue="plugin.link-directory"/></strong>
                                             <br/>
                                             <em>
-                                                <i18n:translate>
-                                                    <i18n:text i18n:key="PLUGINS_LINKDIRECTORY_DELETED_THEME_TEXT" i18n:catalogue="plugin.link-directory"/>
-                                                    <i18n:param name="amount"><xsl:value-of select="$data"/></i18n:param>
-                                                </i18n:translate>
+                                                <xsl:choose>
+	                                                <xsl:when test="$target = 'service'">
+	                                                   <i18n:translate>
+   	                                                       <i18n:text i18n:key="PLUGINS_LINKDIRECTORY_DELETED_THEME_TEXT" i18n:catalogue="plugin.link-directory"/>
+	                                                       <i18n:param name="amount"><xsl:value-of select="$data"/></i18n:param>
+		                                               </i18n:translate>
+	                                                </xsl:when>
+	                                                <xsl:otherwise>
+	                                                    <i18n:text i18n:key="PLUGINS_LINK_DIRECTORY_DELETED_THEME_NAMES" i18n:catalogue="plugin.link-directory"/>
+                                                        <xsl:value-of select="$data"></xsl:value-of>
+	                                                </xsl:otherwise>
+	                                            </xsl:choose>
                                             </em>
                                         </td>
                                     </tr>
Index: main/plugin-link-directory/pages/services/directory/utils/inputdata_utils.xsl
===================================================================
--- main/plugin-link-directory/pages/services/directory/utils/inputdata_utils.xsl	(revision 29666)
+++ main/plugin-link-directory/pages/services/directory/utils/inputdata_utils.xsl	(working copy)
@@ -60,6 +60,8 @@
         <xsl:param name="showThemes" select="'false'"/>
         <xsl:param name="showUrl" select="'false'"/>
         <xsl:param name="showTitle" select="'true'"/>
+        
+        <xsl:call-template name="wrong-or-deleted-themes"/>
     
         <xsl:call-template name="links-thumbnails">
             <xsl:with-param name="links" select="/cms/inputData/linkDirectory/links/link"/>
@@ -92,8 +94,8 @@
     <!-- Handle wrong/deleted themes and configuration errors -->
     <xsl:template name="wrong-or-deleted-themes">
         <xsl:call-template name="wrong-or-deleted-themes-impl">
-            <xsl:with-param name="data" select="/cms/inputData/linkDirectory/links/wrong-themes"/>
+            <xsl:with-param name="target" select="'inputdata'"/>
         </xsl:call-template>
     </xsl:template>
     
-</xsl:stylesheet>
\ No newline at end of file
+</xsl:stylesheet>
Index: main/plugin-link-directory/pages/services/directory/utils/thumbnails_utils.xsl
===================================================================
--- main/plugin-link-directory/pages/services/directory/utils/thumbnails_utils.xsl	(revision 29689)
+++ main/plugin-link-directory/pages/services/directory/utils/thumbnails_utils.xsl	(working copy)
@@ -32,9 +32,6 @@
         <xsl:param name="showUrl"/>
         <xsl:param name="showTitle">true</xsl:param>
         
-        <!-- Display an error if the selected themes are invalid -->
-        <xsl:call-template name="wrong-or-deleted-themes"/>
-        
         <xsl:variable name="links-raw">
             <xsl:call-template name="separate-links">
                 <xsl:with-param name="links" select="$links"/>
Index: main/plugin-link-directory/src/org/ametys/plugins/linkdirectory/DirectoryHelper.java
===================================================================
--- main/plugin-link-directory/src/org/ametys/plugins/linkdirectory/DirectoryHelper.java	(revision 29666)
+++ main/plugin-link-directory/src/org/ametys/plugins/linkdirectory/DirectoryHelper.java	(working copy)
@@ -56,14 +56,11 @@
 import org.ametys.plugins.repository.UnknownAmetysObjectException;
 import org.ametys.plugins.repository.metadata.BinaryMetadata;
 import org.ametys.plugins.repository.query.expression.Expression;
-import org.ametys.plugins.repository.query.expression.OrExpression;
 import org.ametys.runtime.group.GroupsManager;
 import org.ametys.runtime.plugins.core.userpref.UserPreferencesException;
 import org.ametys.runtime.plugins.core.userpref.UserPreferencesManager;
 import org.ametys.runtime.user.User;
 import org.ametys.runtime.user.UsersManager;
-import org.ametys.runtime.util.I18nUtils;
-import org.ametys.runtime.util.I18nizableText;
 import org.ametys.web.WebConstants;
 import org.ametys.web.renderingcontext.RenderingContext;
 import org.ametys.web.renderingcontext.RenderingContextHandler;
@@ -98,9 +95,6 @@
     /** The site manager */
     private static SiteManager _siteManager;
     
-    /** I18nUtils */
-    private static I18nUtils _i18nUtils;
-    
     /** The rendering context handler */
     private static RenderingContextHandler _renderingContextHandler;
     
@@ -126,7 +120,6 @@
         _ametysObjectResolver = (AmetysObjectResolver) manager.lookup(AmetysObjectResolver.ROLE);
         _usersManager = (UsersManager) manager.lookup(UsersManager.ROLE + ".FO");
         _groupsManager = (GroupsManager) manager.lookup(GroupsManager.ROLE + ".FO");
-        _i18nUtils = (I18nUtils) manager.lookup(I18nUtils.ROLE);
         _renderingContextHandler = (RenderingContextHandler) manager.lookup(RenderingContextHandler.ROLE);
         _siteManager = (SiteManager) manager.lookup(SiteManager.ROLE);
         _userPreferencesManager = (UserPreferencesManager) manager.lookup(UserPreferencesManager.ROLE + ".FO");
@@ -268,7 +261,7 @@
      */
     public static String getThemeQuery(String siteName, String language, Expression expression)
     {
-        return getLinksNodePath(siteName, language) + "/element(*, " + DefaultLinkFactory.LINK_NODE_TYPE + ")[" + expression.build() + "]";
+        return getThemesNodePath(siteName, language) + "/element(*, " + DefaultThemeFactory.THEME_NODE_TYPE + ")[" + expression.build() + "]";
     }
     
     /**
@@ -323,27 +316,34 @@
      */
     public static List<DefaultLink> getLinks(List<String> themesIds, String login, String siteName, String language)
     {
+        Site site = _siteManager.getSite(siteName);
+        TraversableAmetysObject linksNode = getLinksNode(site, language);
+        AmetysObjectIterable<AmetysObject> links = linksNode.getChildren();
+        
         if (themesIds.isEmpty())
         {
-            Site site = _siteManager.getSite(siteName);
-            TraversableAmetysObject linksNode = DirectoryHelper.getLinksNode(site, language);
-            AmetysObjectIterable<AmetysObject> links = linksNode.getChildren();
             return IteratorUtils.toList(links);
         }
         else
         {
-            int configuredThemeIdsSize = themesIds.size();
-            
-            Expression[] expressions = new Expression[configuredThemeIdsSize];
-            for (int i = 0; i < themesIds.size(); i++)
+            List<DefaultLink> configuredThemeLinks = new ArrayList<DefaultLink> ();
+
+            while (links.hasNext())
             {
-                expressions[i] = new ThemeExpression(themesIds.get(i));
+                DefaultLink link = (DefaultLink) links.next();
+                String[] linkThemes = link.getThemes();
+                
+                for (String themeId : themesIds)
+                {
+                    if (ArrayUtils.contains(linkThemes, themeId))
+                    {
+                        configuredThemeLinks.add(link);
+                        break;
+                    }
+                }
             }
             
-            String xPathQuery = getLinksQuery(siteName, language, new OrExpression(expressions));
-            AmetysObjectIterable<AmetysObject> configuredThemeLinks = _ametysObjectResolver.query(xPathQuery);
-            
-            return IteratorUtils.toList(configuredThemeLinks);
+            return configuredThemeLinks;
         }
     }
     
@@ -477,6 +477,7 @@
     {
         AttributesImpl attrs = new AttributesImpl();
         attrs.addCDATAAttribute("id", link.getId());
+        attrs.addCDATAAttribute("lang", link.getLanguage());
         
         attrs.addCDATAAttribute("url", StringUtils.defaultString(link.getUrl()));
         attrs.addCDATAAttribute("title", StringUtils.defaultString(link.getTitle()));
@@ -535,7 +536,7 @@
     }
     
     /**
-     * Get the actual ids of the configured themes
+     * Get the actual ids of the themes configured properly, their names if they were not 
      * @param configuredThemesNames the normalized ids of the configured themes
      * @param siteName the site's name
      * @param language the site's language
@@ -570,20 +571,39 @@
     }
     
     /**
+     * Retrieve theme ids from theme names
+     * @param site
+     * @param language
+     * @param configuredThemesNames
+     * @return the themes ids corresponding to the theme names
+     */
+    public static List<String> getThemesIdsFromThemesNames(Site site, String language, List<String> configuredThemesNames)
+    {
+        List<String> configuredThemesIds = new ArrayList<String> ();
+        for (int i = 0; i < configuredThemesNames.size(); i++)
+        {
+            ModifiableTraversableAmetysObject themesNode = DirectoryHelper.getThemesNode(site, language);
+            String configuredThemeName = configuredThemesNames.get(i);
+            
+            if (themesNode.hasChild(configuredThemeName))
+            {
+                AmetysObject configuredThemeNode = themesNode.getChild(configuredThemeName);
+                configuredThemesIds.add(configuredThemeNode.getId());
+            }
+        }
+        return configuredThemesIds;
+    }
+    
+    /**
      * Verify the existence of a theme
-     * @param siteName the site's name
-     * @param language the site's language
-     * @param expression 
+     * @param themeId the id of the theme
      * @return true if the theme exists, false otherwise
      */
-    public static boolean themeExists(String siteName, String language, Expression expression)
+    public static boolean themeExists(String themeId)
     {
-        String xPathQuery = getThemeQuery(siteName, language, expression);
-        AmetysObjectIterable<AmetysObject> theme = _ametysObjectResolver.query(xPathQuery);
-        
-        return theme.hasNext();
+        return _ametysObjectResolver.hasAmetysObjectForId(themeId);
     }
-
+    
     /**
      * Get the site's name
      * @param request the request
Index: main/plugin-link-directory/src/org/ametys/plugins/linkdirectory/LinkDirectoryInputData.java
===================================================================
--- main/plugin-link-directory/src/org/ametys/plugins/linkdirectory/LinkDirectoryInputData.java	(revision 29666)
+++ main/plugin-link-directory/src/org/ametys/plugins/linkdirectory/LinkDirectoryInputData.java	(working copy)
@@ -123,7 +123,9 @@
                 return true;
             }
             
-            Map<String, Boolean> configurableAndApplicableMap = _isConfigurableAndApplicable(template);
+            String language = DirectoryHelper.getLanguage(request);
+            
+            Map<String, Boolean> configurableAndApplicableMap = _isConfigurableAndApplicable(_getTemplate(request));
             if (!configurableAndApplicableMap.get("applicable"))
             {
                 // The current template is not configured for a link directory input data
@@ -136,10 +138,13 @@
                 return false;
             }
             
-            // Find the selected theme ids for this template 
-            List<String> themesIds = _getConfiguredThemesNames(template);
+            // Find the configured theme ids for this template 
+            List<Map<String, String>> configuredThemes = _getConfiguredThemes(template);
+            
+            List<String> configuredThemesNames = _getConfiguredThemesNamesByLanguage(language, configuredThemes);
+            List<String> configuredThemesIds = DirectoryHelper.getThemesIdsFromThemesNames(site, language, configuredThemesNames);
             
-            return !DirectoryHelper.hasRestrictions(DirectoryHelper.getSiteName(request), DirectoryHelper.getLanguage(request), themesIds);
+            return !DirectoryHelper.hasRestrictions(DirectoryHelper.getSiteName(request), language, configuredThemesIds);
         }
         catch (Exception e)
         {
@@ -193,12 +198,9 @@
             
             XMLUtils.startElement(contentHandler, "linkDirectory", attrs);
             
-            XMLUtils.startElement(contentHandler, "links");
             
             _saxThemesLinks(contentHandler, login, request);
             
-            XMLUtils.endElement(contentHandler, "links");
-            
             XMLUtils.endElement(contentHandler, "linkDirectory");
             
             contentHandler.endDocument();
@@ -215,14 +217,16 @@
         String siteName = DirectoryHelper.getSiteName(request);
         try
         {
-            List<String> configuredThemesNames = _getConfiguredThemesNames(_getTemplate(request));
-            if (configuredThemesNames == null)
+            List<Map<String, String>> configuredThemes = _getConfiguredThemes(_getTemplate(request));
+            if (configuredThemes == null)
             {
                 // No links applicable
                 return;
             }
             
-            // Get themes ids with their names
+            List<String> configuredThemesNames = _getConfiguredThemesNamesByLanguage(language, configuredThemes);
+            
+            // Get correct themes ids with their names and the names of the wrong themes
             Map<String, List<String>> themesMap = DirectoryHelper.getThemesMap(configuredThemesNames, siteName, language);
             List<String> correctThemesIds = themesMap.get("correct-themes");
             List<String> wrongThemesNames = themesMap.get("wrong-themes");
@@ -230,25 +234,21 @@
             if (correctThemesIds.isEmpty() && wrongThemesNames.isEmpty())
             { 
                 // Sax all links
-                List<DefaultLink> links = DirectoryHelper.getLinks(new ArrayList<String>(), login, siteName, language);
-
+                List<DefaultLink> links = DirectoryHelper.getLinks(new ArrayList<String> (), login, siteName, language);
+                XMLUtils.startElement(contentHandler, "links");
+                
                 DirectoryHelper.saxLinks(contentHandler, links, DirectoryHelper.getContextVars(request), siteName + "/" + language, login, true, true);
+                
+                XMLUtils.endElement(contentHandler, "links");
             }
             else
             {
                     
                 if (!wrongThemesNames.isEmpty())
                 {
-                    // Sax the names of the wrong themes
-                    XMLUtils.startElement(contentHandler, "wrong-themes");
-                    for (String wrongThemeName : wrongThemesNames)
-                    {
-                        XMLUtils.createElement(contentHandler, "wrong-theme", wrongThemeName);
-                    }
-                    XMLUtils.endElement(contentHandler, "wrong-themes");
+                    XMLUtils.createElement(contentHandler, "wrong-themes", StringUtils.join(wrongThemesNames, ", "));
                 }
                 
-                
                 if (correctThemesIds.isEmpty())
                 {
                     getLogger().warn("All the themes ids are mispelled or the corresponding themes do not exist anymore.");
@@ -258,8 +258,12 @@
                 // Get the links corresponding to the correct configured themes names
                 List<DefaultLink> links = DirectoryHelper.getLinks(correctThemesIds, login, siteName, language);
                 
+                XMLUtils.startElement(contentHandler, "links");
+                
                 // Sax the final set of links
                 DirectoryHelper.saxLinks(contentHandler, links, DirectoryHelper.getContextVars(request), siteName + "/" + language, login, true, true);
+                
+                XMLUtils.endElement(contentHandler, "links");
             }
         }
         catch (Exception e)
@@ -267,13 +271,13 @@
             throw new ProcessingException("An error occurred while retrieving or saxing the links", e);
         }
     }
-    
+
     /**
      * Retrieve the configured themes names defined in the skin file link-themes.xml for the current template
      * @param template the current page's template
      * @return the list of configured themes ids or null
      */
-    private List<String> _getConfiguredThemesNames(String template)
+    private List<Map<String, String>> _getConfiguredThemes(String template)
     {
         List<Map<String, Object>> themesList = (List<Map<String, Object>>) _configurationValues.get("themes");
         
@@ -283,7 +287,7 @@
             if (templates.contains(template) || templates.contains(__WILDCARD))
             {
                 // Get first matching template
-                return (List<String>) themesMap.get("theme-list");
+                return (List<Map<String, String>>) themesMap.get("theme-list");
             }    
         }
         
@@ -292,8 +296,28 @@
     }
     
     /**
+     * Get the configured themes names of the request's language
+     * @param language
+     * @param configuredThemes
+     * @return the names of the themes configured for the request's language
+     */
+    private List<String> _getConfiguredThemesNamesByLanguage(String language, List<Map<String, String>> configuredThemes)
+    {
+        // Get the names of the configured themes for the request's language
+        List<String> configuredThemesNames = new ArrayList<String> ();
+        for (Map<String, String> configuredTheme : configuredThemes)
+        {
+            if (language.equals(configuredTheme.get("lang")))
+            {
+                configuredThemesNames.add(configuredTheme.get("id"));
+            }
+        }
+        return configuredThemesNames;
+    }
+    
+    /**
      * Retrieve the "configurable" attribute of a template of the configuration file
-     * @param template the current page's template
+     * @param template the template's name
      * @return true if the template is configurable, false otherwise
      */
     private Map<String, Boolean> _isConfigurableAndApplicable(String template) 
@@ -308,9 +332,9 @@
             List<String> templates = (List<String>) themesMap.get("templates");
             if (templates.contains(template) || templates.contains(__WILDCARD))
             {
-                configurableAndApplicableMap.put("applicable", true);
                 configurableAndApplicableMap.put("configurable", (Boolean) themesMap.get("configurable"));
-                
+                configurableAndApplicableMap.put("applicable", true);
+
                 break;
             }
         }
@@ -375,12 +399,15 @@
             for (Configuration themesConfiguration : themesConfigurations)
             {
                 Map<String, Object> themesMap = new HashMap<String, Object> ();
-                List<String> themeList = new ArrayList<String> ();
+                List<Map<String, String>> themeList = new ArrayList<Map<String, String>> ();
                 
                 Configuration[] themeConfigurations = themesConfiguration.getChildren();
                 for (Configuration themeConfiguration : themeConfigurations)
                 {
-                    themeList.add(themeConfiguration.getAttribute("id", null));
+                    Map<String, String> themeMap = new HashMap<String, String> ();
+                    themeMap.put("id", themeConfiguration.getAttribute("id", null));
+                    themeMap.put("lang", themeConfiguration.getAttribute("lang", null));
+                    themeList.add(themeMap);
                 }
                 
                 String templatesStr = themesConfiguration.getAttribute("templates", "*");
Index: main/plugin-link-directory/src/org/ametys/plugins/linkdirectory/link/LinkListGenerator.java
===================================================================
--- main/plugin-link-directory/src/org/ametys/plugins/linkdirectory/link/LinkListGenerator.java	(revision 29666)
+++ main/plugin-link-directory/src/org/ametys/plugins/linkdirectory/link/LinkListGenerator.java	(working copy)
@@ -144,7 +144,7 @@
         int amount = 0;
         for (String themeId : themesIdsList)
         {
-            if (!DirectoryHelper.themeExists(siteName, language, new ThemeExpression(themeId)))
+            if (!DirectoryHelper.themeExists(themeId))
             {
                 // The theme was deleted but it is still referenced by the service
                 getLogger().warn("The id '" + themeId + "' does not reference an existing theme.");
Index: main/plugin-link-directory/src/org/ametys/plugins/linkdirectory/theme/ThemeListGenerator.java
===================================================================
--- main/plugin-link-directory/src/org/ametys/plugins/linkdirectory/theme/ThemeListGenerator.java	(revision 29682)
+++ main/plugin-link-directory/src/org/ametys/plugins/linkdirectory/theme/ThemeListGenerator.java	(working copy)
@@ -73,8 +73,11 @@
             String[] themeIds = ids.split(",");
             for (String themeId : themeIds)
             {
-                DefaultTheme theme = _resolver.resolveById(themeId);
-                saxTheme(theme);
+                if (_resolver.hasAmetysObjectForId(themeId))
+                {
+                    DefaultTheme theme = _resolver.resolveById(themeId);
+                    saxTheme(theme);
+                }
             }
         }
         else
