[MAGNOLIA-284] Deleting a paragraph does not change activation state of page AND needs special activation trick in order to activate the change Created: 06/Feb/05  Updated: 17/Mar/09  Resolved: 30/May/05

Status: Closed
Project: Magnolia
Component/s: admininterface
Affects Version/s: 2.01
Fix Version/s: 2.1 Final

Type: Bug Priority: Critical
Reporter: Andreas Weder Assignee: Philipp Bärfuss
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

tested on Linux and Mac OSX using Mozilla Firefox 1.0


Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

If you delete a paragraph on a page, then return to
admin central, the activation state of the page does not
reflect the change: it stays green.

But it gets worse: if you activate the page nevertheless,
the change does not propagate to the public instance. You
first have to deactivate, then activate the page in order
make the deleted paragraph actually disappear.

This is a critical bug to me, as it fundamentally touches
the user experience of and trust in magnolia - even though
there is a workaround available.



 Comments   
Comment by Philipp Bracher [ 30/May/05 ]

The same is true if you change the title of a page

Comment by Philipp Bracher [ 30/May/05 ]

Fixed in the RequestInterceptor

Comment by Andreas Weder [ 31/May/05 ]

Thanks for the fix.

Here is the patch for the 2.02 branch:

Index: C:/Projects/Magnolia_2_02_Branch/src/main/info/magnolia/cms/servlets/RequestInterceptor.java
===================================================================
— C:/Projects/Magnolia_2_02_Branch/src/main/info/magnolia/cms/servlets/RequestInterceptor.java (revision 911)
+++ C:/Projects/Magnolia_2_02_Branch/src/main/info/magnolia/cms/servlets/RequestInterceptor.java (working copy)
@@ -15,17 +15,23 @@

package info.magnolia.cms.servlets;

-import info.magnolia.cms.core.HierarchyManager;
+import info.magnolia.cms.beans.config.ContentRepository;
import info.magnolia.cms.core.Content;
+import info.magnolia.cms.core.HierarchyManager;
import info.magnolia.cms.core.MetaData;
import info.magnolia.cms.security.SessionAccessControl;
-import info.magnolia.cms.beans.config.ContentRepository;
+import info.magnolia.cms.util.Path;

+import java.util.Iterator;
+
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
+import javax.jcr.access.AccessDeniedException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import java.util.Iterator;

+import org.apache.commons.lang.StringUtils;

/**

  • Date: Oct 21, 2004
    @@ -89,6 +95,8 @@
    //delete paragraph
    try { String path=this.getRequest().getParameter("mgnlPath"); + // deactivate + updatePageMetaData(request, hm); hm.deletePage(path); hm.save(); }

    @@ -128,8 +136,8 @@
    //move between two paragraphs
    nodeSelected.getMetaData().setSequencePosition((seqPos0+seqPos1)/2);
    }

  • nodeSelected.save();
    -
    + this.updatePageMetaData(request, hm);
    + hm.save();
    }
    catch (Exception e) {}

@@ -140,8 +148,19 @@

}

+ /**
+ * @param request
+ * @param hm
+ * @throws PathNotFoundException
+ * @throws RepositoryException
+ * @throws AccessDeniedException
+ */
+ private void updatePageMetaData(HttpServletRequest request, HierarchyManager hm) throws PathNotFoundException, RepositoryException, AccessDeniedException

{ + String pagePath = StringUtils.substringBeforeLast(Path.getURI(request),"."); + Content page = hm.getContent(pagePath); + page.updateMetaData(request); + }

-
}

Generated at Mon Feb 12 03:15:55 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.