Bug #2223

Title and Abstract screen insert empty abstract tag

Added by Saurabh Garg over 15 years ago. Updated almost 12 years ago.

morpho - general
Target version:
Start date:
Due date:
% Done:


Estimated time:


To reproduce the bug:
1. Create a datapackage with no abstract using the data package wizard.
2. Save it locally or over the network.
3. Open the documentation menu and open the Title and Abstract screen.
4. Modify the title but add no abstract.
5. Save the dp again.


#1 Updated by Saurabh Garg over 15 years ago

Oops.. commited the bug too soon.

The result of the above steps is that a empty abstract tag is inserted by the
Title and Abstract screen.
If you try to save the document over the network, Metacat will return an error:
org.xml.sax.SAXParseException: cvc-complex-type.2.4.b: The content of
element 'abstract' is not complete. One of '{"":section, "":para}' is expected.

#2 Updated by Saurabh Garg over 15 years ago


#3 Updated by Will Tyburczy over 15 years ago

fix is working great, resolving bug

#4 Updated by Will Tyburczy over 15 years ago

the insertion of an empty abtract tag is fixed, however it is now not possible
to delete an abstract from a dp using the wizard interface (modifications still
work, as long as some non whitespace characters are left in the abstract at the

To recreate this bug:

-open a data package that doesn't have an abstract
-open the title and abstract wizard page
-add some text to the abstract
-click ok
The change will occur normally
-open the title and abstract wizard page again
-delete the text in the abstract field
-click ok
The abstract will still appear in the dp view with the text you added originally

This seems to be a problem with the wizard, as you can still delete the abstract
by deleting the text through the tree editor

#5 Updated by P. Anderson over 15 years ago

The problem is that the following code (in both getPageData() methods of
plugins/datapackagewizard/pages/ prevents an empty abstract from
being set.

if ( !(absField.getText().trim().equals("")) ) {
returnMap.put(rootXPath + "/abstract/para1",

Removing the if statement and trying to save an empty abstract produces this XML:

<abstract><para> </para>

...which Metacat seems to accept. AFAICT, this bug is now fixed.

Here is the link to the code:

#6 Updated by Matt Jones over 15 years ago

I don't like this fix. We need to discuss this before we finalize, so I am
reopening the bug to force us to discuss the issue.

#7 Updated by P. Anderson over 15 years ago

OK now this is much better. Checks for empty abstract and makes sure to remove
any extant abstract from the DOM. If no abstract is given, then no XML tag is

Here's the diff:

#8 Updated by Jing Tao about 12 years ago

Morpho still create an empty string in abstract/para.

#9 Updated by Jing Tao about 12 years ago

In WizardContainerFrame class, a statement of checking if abstract object is empty string is added. If it is empty, the abstract tree wouldn't be added to the eml. So this bug is fixed:
1. In new wizard page, if the abstract field is empty, no abstract will be added.
2. User still can use title/abstract button to remove an abstract.

#10 Updated by Jing Tao almost 12 years ago

move to 1.7

#11 Updated by Redmine Admin about 8 years ago

Original Bugzilla ID was 2223

Also available in: Atom PDF