Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#530 closed defect (fixed)

Deleting subelements from Point Of Contact in metadata editor causes an exception

Reported by: josegar74 Owned by: geonetwork-devel@…
Priority: major Milestone: v2.6.5
Component: General Version: v2.6.4
Keywords: Cc:

Description

Possibly happens with other elements although I could reproduce it with Point Of Contact.

Test: With default editor start removing the Point Of Contact subelements. After some deletes is shown the attached window.

Log file contains an exception like:

2011-06-08 17:18:52,889 ERROR [jeeves.service] -  (C) Exc : java.lang.IllegalStateException: Element not found at ref = 96
2011-06-08 17:18:52,889 DEBUG [jeeves.service] - Raised exception while executing service
<error id="error">

  <message>Element not found at ref = 96</message>

  <class>IllegalStateException</class>

  <stack>

    <at class="org.fao.geonet.kernel.DataManager" file="DataManager.java" line="1477" method="deleteElementEmbedded" />

    <at class="org.fao.geonet.services.metadata.DeleteElement" file="DeleteElement.java" line="72" method="exec" />

    <at class="jeeves.server.dispatchers.ServiceInfo" file="ServiceInfo.java" line="238" method="execService" />

    <at class="jeeves.server.dispatchers.ServiceInfo" file="ServiceInfo.java" line="141" method="execServices" />

    <at class="jeeves.server.dispatchers.ServiceManager" file="ServiceManager.java" line="399" method="dispatch" />

    <at class="jeeves.server.JeevesEngine" file="JeevesEngine.java" line="670" method="dispatch" />

    <at class="jeeves.server.sources.http.JeevesServlet" file="JeevesServlet.java" line="185" method="execute" />

    <at class="jeeves.server.sources.http.JeevesServlet" file="JeevesServlet.java" line="98" method="doGet" />

    <at class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="707" method="service" />

    <at class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="820" method="service" />

  </stack>

  <request>

    <language>en</language>

    <service>metadata.elem.delete</service>

  </request>

Attachments (2)

metadata_editor_delete_error.png (15.8 KB ) - added by josegar74 13 years ago.
Patch_for_#530.patch (775 bytes ) - added by josegar74 13 years ago.
Patch for branch (to verify doesn't break any other part)

Download all attachments as: .zip

Change History (6)

by josegar74, 13 years ago

comment:1 by josegar74, 13 years ago

Summary: Deleting subelements n Point Of Contact in metadata editorDeleting subelements from Point Of Contact in metadata editor causes an exception

by josegar74, 13 years ago

Attachment: Patch_for_#530.patch added

Patch for branch (to verify doesn't break any other part)

comment:2 by josegar74, 13 years ago

The problem seem in this snippet of deleteElementEmbedded method:

parent.removeContent(me);
               
//--- existing geonet child element not present so create it
if (result == null) {
   result = editLib.createElement(schema,el,parent);

   parent.setContent(me,result);
   
}

if result == null, then as element was removed before the if, the line parent.setContent(me,result); replaces the a wrong element. I result == null, the instruction parent.removeContent(me); should not be executed

Attached patch to review if can cause problems with other editor functionality

comment:3 by josegar74, 13 years ago

Resolution: fixed
Status: newclosed

comment:4 by justinrowles, 13 years ago

This is a dupe of #379, which was supposedly committed three months ago, but must have been lost somehow.

Note: See TracTickets for help on using tickets.