#530 closed defect (fixed)
Deleting subelements from Point Of Contact in metadata editor causes an exception
Reported by: | josegar74 | Owned by: | |
---|---|---|---|
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)
Change History (6)
by , 13 years ago
Attachment: | metadata_editor_delete_error.png added |
---|
comment:1 by , 13 years ago
Summary: | Deleting subelements n Point Of Contact in metadata editor → Deleting subelements from Point Of Contact in metadata editor causes an exception |
---|
by , 13 years ago
Attachment: | Patch_for_#530.patch added |
---|
comment:2 by , 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 , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:4 by , 13 years ago
This is a dupe of #379, which was supposedly committed three months ago, but must have been lost somehow.
Patch for branch (to verify doesn't break any other part)