Index: main/plugin-odf-web/src/org/ametys/plugins/odfweb/userpref/ODFCartUserPreferencesGenerator.java
===================================================================
--- main/plugin-odf-web/src/org/ametys/plugins/odfweb/userpref/ODFCartUserPreferencesGenerator.java	(revision 41013)
+++ main/plugin-odf-web/src/org/ametys/plugins/odfweb/userpref/ODFCartUserPreferencesGenerator.java	(working copy)
@@ -101,56 +101,64 @@
     @Override
     protected void _saxPreference(UserPreference preference, Object value) throws SAXException, ProcessingException
     {
-        AttributesImpl attr = new AttributesImpl();
-        attr.addCDATAAttribute("id", preference.getId());
-        XMLUtils.startElement(contentHandler, "preference", attr);
-        
-        String idContents = ParameterHelper.valueToString(value);
-        XMLUtils.startElement(contentHandler, "contents");
-        if (StringUtils.isNotBlank(idContents))
+        String preferenceId = preference.getId();
+        if (preferenceId.equals("cartProgramIds") || preferenceId.equals("cartCourseIds"))
         {
-            for (String idContent : StringUtils.split(idContents, ","))
+            AttributesImpl attr = new AttributesImpl();
+            attr.addCDATAAttribute("id", preferenceId);
+            XMLUtils.startElement(contentHandler, "preference", attr);
+            
+            String idContents = ParameterHelper.valueToString(value);
+            XMLUtils.startElement(contentHandler, "contents");
+            if (StringUtils.isNotBlank(idContents))
             {
-                try
+                for (String idContent : StringUtils.split(idContents, ","))
                 {
-                    ModifiableContent content = _resolver.resolveById(idContent);
-                    Page page = null;
-                    if (content instanceof Course)
-                    {
-                        page = _odfPageResolver.getCoursePage((Course) content);
-                    }
-                    else if (content instanceof Program)
-                    {
-                        page = _odfPageResolver.getProgramPage((Program) content);
-                    }
-                    
-                    if (page != null)
+                    try
                     {
-                        String pageId = page.getId();
-                        AttributesImpl attrContent = new AttributesImpl();
-                        String pagePath = ResolveURIComponent.resolve("page", pageId, false);
+                        ModifiableContent content = _resolver.resolveById(idContent);
+                        Page page = null;
+                        if (content instanceof Course)
+                        {
+                            page = _odfPageResolver.getCoursePage((Course) content);
+                        }
+                        else if (content instanceof Program)
+                        {
+                            page = _odfPageResolver.getProgramPage((Program) content);
+                        }
                         
-                        attrContent.addCDATAAttribute("pagePath", pagePath);
+                        if (page != null)
+                        {
+                            String pageId = page.getId();
+                            AttributesImpl attrContent = new AttributesImpl();
+                            String pagePath = ResolveURIComponent.resolve("page", pageId, false);
+                            
+                            attrContent.addCDATAAttribute("pagePath", pagePath);
+                            
+                            attrContent.addCDATAAttribute("pageId", pageId);
+                            attrContent.addCDATAAttribute("title", content.getTitle());
+                            XMLUtils.createElement(contentHandler, "content", attrContent, idContent);
+                        }
+                        else
+                        {
+                            getLogger().info("Cannot get the page linked to the content with id: " + idContent + ". It will be ignored.");
+                        }
                         
-                        attrContent.addCDATAAttribute("pageId", pageId);
-                        attrContent.addCDATAAttribute("title", content.getTitle());
-                        XMLUtils.createElement(contentHandler, "content", attrContent, idContent);
                     }
-                    else
+                    catch (UnknownAmetysObjectException e)
                     {
-                        getLogger().info("Cannot get the page linked to the content with id: " + idContent + ". It will be ignored.");
+                        getLogger().info("The content with id: " + idContent + " doesn't exist. It will be ignored.", e);
                     }
-                    
-                }
-                catch (UnknownAmetysObjectException e)
-                {
-                    getLogger().info("The content with id: " + idContent + " doesn't exist. It will be ignored.", e);
                 }
             }
+            XMLUtils.endElement(contentHandler, "contents");
+            
+            XMLUtils.endElement(contentHandler, "preference");
         }
-        XMLUtils.endElement(contentHandler, "contents");
-        
-        XMLUtils.endElement(contentHandler, "preference");
+        else
+        {
+            super._saxPreference(preference, value);
+        }
     }
     
 }
