Issue Details (XML | Word | Printable)

Key: LPS-2624
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: SE Support
Reporter: Maarten van Heiningen
Votes: 1
Watchers: 2
Operations

If you were logged in you would be able to see more operations.
PUBLIC - Liferay Portal Standard Edition

loose content when delete any repeating field from webcontent. Webcontent form resets itself to empty fields and deletes all repeating fields from the webcontent form.

Created: 25/Mar/09 04:19 AM   Updated: 11/May/09 11:29 AM
Component/s: Portlet - Journal/Web Content
Affects Version/s: 5.2.2
Fix Version/s: 5.2.3

Time Tracking:
Not Specified

File Attachments: 1. File edit_article.jsp (43 kB)
2. File edit_article.jsp (43 kB)

Environment:
Liferay versions 5.2.1 and 5.2.2.
Windows and Linux
MySQL 5

Rank:
Issue is not rankable.     


 Description  « Hide
You create a structure and this has a repeatable field.
You create a template which shows repeatable data as shown in the example of the Velocity templates.

In the Webcontent you create an article, select the structure.
Put in data in the repeatable field.
Click the "+" icon for extra repeatable fields (does not matter how many)

Fill in the new repeatable fields.

Save or Save and continue or Save and Approve the webcontent
re-enter the article and delete one off the repeating fields.

The webcontent article resets itself to its initial stage as when you first have selected the structure to be bound to this article with empty fields.

The steps where you save or save and exit does not matter because the result is the same. Empty fields and a reset article.

Could this be fixed?
Thanks

 All   Comments   Work Log   Change History   FishEye      Sort Order: Ascending order - Click to sort in descending order
Mauro Rallo added a comment - 27/Apr/09 09:02 AM - Visible to
Hi, sorry for my previous actions, but it's my first time with JIRA. I recognize the same bug, and I think to fix it.
The problem was that when you delete a repeatable field, the closing tag wasn't added correctly.
I attach my solution, just some javascript to close correctly the ending tag.
I also added this functionality that wasn't covered before: when you delete a father field, also the children must be deleted.

I hope that can help.

Good work

Mauro

Mauro Rallo added a comment - 27/Apr/09 09:19 AM - Visible to
Sorry, in the previous attachment I leave a debugging javascript alert.
Here I removed it.

Mauro

Mauro Rallo added a comment - 30/Apr/09 02:50 AM - Visible to
Hi, put the second attach (16143) edit_article.jsp or in your ext envronmnet or directly on you server.
The path is "'/html/portlet/journal"'.

Amos Fong added a comment - 30/Apr/09 04:36 PM - Visible to
Hey Maruo,

Thanks for contributing a patch. I'll be reviewing it shortly. I'm only able to reproduce this bug when a repeatable element has a child element or a regular element has a repeatable child element. Can you confirm this?

Mauro Rallo added a comment - 01/May/09 01:34 AM - Visible to
Hi,
    yes I confirm. For a simple structure, there isn't the bug.
The problem is that when you enter in the case of (cmd == "remove") you skipped also the part that close correctly the previous tags.
Probably we can optimize the code, because I add a piece of code, that is present also after (with some little differences on the index of the for cycle).
But so works!

Bye

Mauro

Amos Fong added a comment - 11/May/09 11:29 AM - Visible to
Committed fix, there a some slight modifications to your code. Thanks Mauro