Bug 730889

Summary: Topic creation success message does not update after adding a second topic
Product: [Community] PressGang CCMS Reporter: Misty Stanley-Jones <misty>
Component: Web-UIAssignee: Matthew Casperson <mcaspers>
Status: CLOSED CURRENTRELEASE QA Contact: Misty Stanley-Jones <misty>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 1.xCC: cbredesen, lcarlon, topic-tool-list
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-07 00:32:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Misty Stanley-Jones 2011-08-16 06:44:24 UTC
I added a first topic and got this message:
Successfully Created Topic With ID: 4902 Title: Transaction compensation

I added a second topic and the message did not change to reflect my new topic (4903).

Comment 1 Matthew Casperson 2011-10-07 00:27:56 UTC
Fixed in 20111007-1026

This one was a bit of a drama:

/*
 * The initial approach to having the status messages updated with the
 * topic details was to use:
 * 
 * @Override
 * 
 * @Factory(value = "topic") public Topic getInstance() { return
 * super.getInstance(); }
 * 
 * The problem with this is that the "topic" object is not refreshed, so
 * the messages all reprint the details of the first created object. The
 * next step I took to try and fix this was to refresh the context in an
 * override of clearInstance() like so:
 * 
 * Contexts.getConversationContext().set("topic", null);
 * 
 * The problem with this is that the messages generated by the
 * EntityHome object actually calculate their EL values in a thread. So
 * by the time the message was calculated, the clearInstance function
 * had set the "topic" object to null.
 * 
 * Manually setting the EL object "lasttopic" before the persist ensures that
 * the messages have time to calculate their variables before the object
 * is reset.
 */

Comment 2 Matthew Casperson 2011-10-07 03:21:38 UTC
*** Bug 735265 has been marked as a duplicate of this bug. ***