Uploaded image for project: 'CMS'
  1. CMS
  2. CMS-1226

Unable to add a page on the English site

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • 3.0 M4
    • 3.0 M3
    • Plugin : Web
    • None

      How to reproduce

      • connect to cms
      • select English site
      • add a page

      Actual behavior

      • the page is inserted on French site

      Expected behavior

      • The page is inserted on English site

          [CMS-1226] Unable to add a page on the English site

          node.setId
          

          will be fine

          Raphaël Franchet added a comment - node.setId will be fine

          The root node of a tree is invariable.

          To fix it, need to override the setRootNode method to manually unregister the old root node :

          org.ametys.web.tool.sitemap.SitemapTreePanel.prototype.setRootNode = function (node)
          {
          	var oldRoot = this.root;
          	
          	node = org.ametys.web.tool.sitemap.SitemapTreePanel.superclass.setRootNode.call(this, node);
          	
          	// Unregister old root node if exists
          	if (oldRoot != null)
          		this.unregisterNode(oldRoot);
          	
              return node;
          }
          
          

          Laurence Aumeunier added a comment - The root node of a tree is invariable. To fix it, need to override the setRootNode method to manually unregister the old root node : org.ametys.web.tool.sitemap.SitemapTreePanel.prototype.setRootNode = function (node) { var oldRoot = this.root; node = org.ametys.web.tool.sitemap.SitemapTreePanel.superclass.setRootNode.call(this, node); // Unregister old root node if exists if (oldRoot != null) this.unregisterNode(oldRoot); return node; }

          org.ametys.web.tool.sitemap.SitemapTreePanel.prototype._reloadSite = function ()
          {
          	var rootNode = this.getRootNode();
          	var rootID = this._getRootNodeId ();
          	
          	if (rootID != null)
          	{
          		rootNode.id = rootID;
          		rootNode.reload ();
          	}
          }
          

          You forgot to send the new selection event

          Raphaël Franchet added a comment - org.ametys.web.tool.sitemap.SitemapTreePanel. prototype ._reloadSite = function () { var rootNode = this .getRootNode(); var rootID = this ._getRootNodeId (); if (rootID != null ) { rootNode.id = rootID; rootNode.reload (); } } You forgot to send the new selection event

            laurence Laurence Aumeunier
            fravetier Frederic Ravetier (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: