[KULRICE-7637] show inactive / hide inactive button on subtab is not working correctly. Created: 09/Jul/12  Updated: 30/Oct/12  Resolved: 23/Aug/12

Status: Closed
Project: Kuali Rice Development
Component/s: Development
Affects Version/s: 2.1.1
Fix Version/s: 2.1.2
Security Level: Public (Public: Anyone can view)

Type: Bug Fix Priority: Critical
Reporter: Muddu Salem Assignee: Aaron Hamid (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 1 hour, 30 minutes
Time Spent: 4 hours, 30 minutes
Original Estimate: 6 hours

Issue Links:
Discovered
discovered by KFSOLD-22625 Asset Edit-> Components -> show inact... Closed
Relate
is related to KULRICE-4055 Vendor Search Alias Hide Inactive But... Closed
Similar issues:
KULRICE-4235Show Inactive link blows up on maintenance documents (methodToCall violation)
KULRICE-9352Show/hide active rows on a collection doesn't work in the inquiry view
KULRICE-4055Vendor Search Alias Hide Inactive Button returns 500 ERROR. Vendor Inquiry Hide/show inactive do not work
KULRICE-9159Show/hide active rows on a collection doesn't work
KULRICE-5256Maintenance Docs - Fix issues with show/hide inactive rows
KULRICE-10641Maintenance document missing show/hide inactive button when collection implements Inactivatable
KULRICE-9706Create or identify Smoke Test that verifies show/hide inactive lines
KULRICE-3179Document Configuration screen Show/Hide buttons not working correctly
KULRICE-1102bugs with show hide active/inactive
KULRICE-13346Create AFT for Maintenance document toggling active/inactive button.
Rice Module:
Rice Core
Application Requirement:
KFS
KAI Review Status: Not Required
KTI Review Status: Not Required

 Description   

The "show inactive" and "hide inactive" button on the subtab in rowDisplay.tag (line 246) is not working correctly. Show inactive does not show the record. The linked KFSMI jira will provide more details. Here is the developer comments on kfsmi jira:

The problem is on line 246, where it uses kul:subtab with the setting open="$

{!rowHidden}

. When this parameter is set to false, the asset location is not displayed at all regardless if the row is hidden or not. If I change this parameter to open="true", the show/hide inactive works as exactly as expected. I can confirm that the code for show/hiding the rows based on the row's active setting is correct. I'm thinking this is a rice issue since the tag file is a rice file.

To test this: KFS Main Menu / Lookup and Maintenance - click on Asset and enter asset number: 320077 and click on Edit link. On the maintenance document, open the tab Components. There should be two records, one active and one inactive.



 Comments   
Comment by Muddu Salem [ 09/Jul/12 ]

KFSMI issue.

Comment by Jessica Coltrin (Inactive) [ 10/Jul/12 ]

moving to 2.1.2.

Comment by Aaron Hamid (Inactive) [ 27/Jul/12 ]

it looks like the {{open="$

{!rowHidden}

"}} parameter was introduced with revision 14447 http://fisheye.kuali.org/browse/rice/branches/rice-release-1-0-3-br/web/src/main/webapp/WEB-INF/tags/kr/rowDisplay.tag?r2=14447&r1=14415 to address KULRICE-4055

Comment by Aaron Hamid (Inactive) [ 27/Jul/12 ]

Muddu, do you know if there is there a doc in stg.kfs.kuali.org that exhibits this behavior? I poked around, but I don't know what I'm looking for (an Asset with a component defined?).

Comment by Muddu Salem [ 27/Jul/12 ]

Aaron,

I created an asset document that has active and inactive components. The document number is: 22105. Go to components tab and when you click on "Show Inactive" it shows active records but no inactive records.

Log in as bomiddle on stg and check the document# 22105. I do have one inactive component. The toggle is not working correctly. Hope this helps.

Comment by Aaron Hamid (Inactive) [ 27/Jul/12 ]

Thanks Muddu!

So I understand, components 2, 4, and 6 are inactive. What should happen is:

  • Initially components container is folded; 'hide inactive' and 'show' buttons are displayed
  • Clicking 'show' unfolds components container, all components are displayed, as well as New form
  • Clicking 'hide inactive' should result in components 2, 4, and 6 being folded (all other components still visible), and button should change to 'show inactive'
  • Clicking 'show inactive' should result in components 2, 4, and 6 being unfolded again (all other components also visible)

Right now 'hide inactive' appears to be hiding components 2 and 4, but not 6 (has an asterisk by it)
After hiding, 'show inactive' does not appear to be unhiding components 2 and 4 (6 is still unfolded)

Is that right?

Comment by Muddu Salem [ 27/Jul/12 ]

That's correct. hide/show inactive is not doing anything.

Comment by Aaron Hamid (Inactive) [ 27/Jul/12 ]

Actually I just noticed it's hiding 2 and 4 but not 6. It's not showing them again though.

Comment by Aaron Hamid (Inactive) [ 27/Jul/12 ]

I see, I think there is a discrepancy between hide/show inactive (removes divs entirely) and folding/unfolding. On 'hide inactive' the entire row is removed (no individual show/hide button); except for component 6 that has an asterisk, i don't know what this is about. On 'show inactive' the rows (2,4) are added back, except they are in the folded state with individual 'show' button. So I guess the question is what is 'hide inactive' really supposed to do: remove the row entirely or just fold it? In either case, I assume 'show inactive' should result in the row now only being visible again, but also in the unfolded state.

Comment by Aaron Hamid (Inactive) [ 27/Jul/12 ]

It's hard to prove exactly what is happening from our docs in standalone but from reviewing the code and behavior in KFS, I think what is happening is that the open="$

{!rowHidden}

" parameter is actually resulting in the tabState (inadvertently?) changing/side-affecting when the row is hidden. When the row is shown again, the following condition prevents the tab state from reverting (since the currentTab state will no longer be OPEN, but CLOSED, regardless of rowHidden):

<c:set var="isOpen" value="${(empty currentTab ? true : (currentTab == 'OPEN')) && open}"/>

The best solution is probably to break the relationship between these two concepts, and either always keep the tab open, or propagate the known tab state independent of row visibility.

I notice that the KualiInquiryAction has specific code to re-open tabs in rows that were hidden, but KualiMaintenanceDocumentAction does not have this code:

toggleInactiveRecordDisplay:
if (showInactive) {
    reopenInactiveRecords(inquiryForm, collectionName);
}

...       

/**
 * Attempts to reopen sub tabs which would have been closed for inactive records
 * 
 * @param inquiryForm the form to reopen records on
 * @param collectionName the name of the collection reopening
 */
protected void reopenInactiveRecords(InquiryForm inquiryForm, String collectionName) {
...
Comment by Aaron Hamid (Inactive) [ 27/Jul/12 ]

Ah, the change to relate the tab state to row visibility leads back to revision 14447 and the KULRICE-4055 fix. I will ask Jerry for feedback on this.

http://fisheye.kuali.org/browse/rice/branches/rice-release-1-0-3-br/web/src/main/webapp/WEB-INF/tags/kr/subtab.tag?r2=14447&r1=13339

Comment by Aaron Hamid (Inactive) [ 31/Jul/12 ]

this should be fixed now. closed tabs should be re-opened on toggling inactive records visible again.

Comment by Muddu Salem [ 06/Aug/12 ]

Aaron,

Show Inactive action is throwing the following:

****************Stack Trace-Only shown when not in production***************

java.lang.NullPointerException
at org.kuali.rice.kns.util.WebUtils.reopenInactiveRecords(WebUtils.java:382)
at org.kuali.rice.kns.web.struts.action.KualiMaintenanceDocumentAction.toggleInactiveRecordDisplay(KualiMaintenanceDocumentAction.java:1088)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
at org.kuali.rice.kns.web.struts.action.KualiAction.dispatchMethod(KualiAction.java:168)
at org.kuali.rice.kns.web.struts.action.KualiAction.execute(KualiAction.java:129)
at org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase.execute(KualiDocumentActionBase.java:174)
at org.kuali.rice.kns.web.struts.action.KualiMaintenanceDocumentAction.execute(KualiMaintenanceDocumentAction.java:101)
at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor$1.doInTransaction(KualiRequestProcessor.java:486)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.processActionPerform(KualiRequestProcessor.java:482)
at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.processFormActionAndForward(KualiRequestProcessor.java:215)
at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.strutsProcess(KualiRequestProcessor.java:202)
at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.process(KualiRequestProcessor.java:89)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.kuali.rice.kew.web.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:78)
at org.kuali.rice.kew.web.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.kuali.rice.kew.web.UserLoginFilter.doFilter(UserLoginFilter.java:89)
at org.kuali.rice.kew.web.UserLoginFilter.doFilter(UserLoginFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.kuali.rice.kew.web.BootstrapFilter.doFilter(BootstrapFilter.java:162)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.kuali.kfs.sys.web.filter.DevelopmentLoginFilter.doFilter(DevelopmentLoginFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.kuali.rice.krad.web.filter.HideWebInfFilter.doFilter(HideWebInfFilter.java:69)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:202)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:175)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)

Comment by Aaron Hamid (Inactive) [ 07/Aug/12 ]

Hey Muddu, sorry about the NPE, this is difficult to test with what we have in Rice UI right now. I just committed a fix in Rice which should avoid an NPE in this case (apparently the Field or its dataType/containerName was null).

Comment by Muddu Salem [ 07/Aug/12 ]

No problem at all. We will pull rice changes on Thursday and I will let you know the results. Appreciate for a quick turnaround.

Comment by Aaron Hamid (Inactive) [ 21/Aug/12 ]

resolving

Comment by Muddu Salem [ 22/Aug/12 ]

Aaron,

I am getting this exception when I click on show inactive records. The rice revision we are using is 39477 pulled in on August 18th. I am assuming we do not have the latest rice code? Here is the stack trace. Thanks.

*****************Stack Trace-Only shown when not in production****************

java.lang.NullPointerException
at org.kuali.rice.kns.util.FieldUtils.generateCollectionSubTabName(FieldUtils.java:1896)
at org.kuali.rice.kns.util.WebUtils.reopenInactiveRecords(WebUtils.java:384)
at org.kuali.rice.kns.web.struts.action.KualiMaintenanceDocumentAction.toggleInactiveRecordDisplay(KualiMaintenanceDocumentAction.java:1088)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
at org.kuali.rice.kns.web.struts.action.KualiAction.dispatchMethod(KualiAction.java:168)
at org.kuali.rice.kns.web.struts.action.KualiAction.execute(KualiAction.java:129)
at org.kuali.rice.kns.web.struts.action.KualiDocumentActionBase.execute(KualiDocumentActionBase.java:174)
at org.kuali.rice.kns.web.struts.action.KualiMaintenanceDocumentAction.execute(KualiMaintenanceDocumentAction.java:101)
at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor$1.doInTransaction(KualiRequestProcessor.java:486)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.processActionPerform(KualiRequestProcessor.java:482)
at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.processFormActionAndForward(KualiRequestProcessor.java:215)
at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.strutsProcess(KualiRequestProcessor.java:202)
at org.kuali.rice.kns.web.struts.action.KualiRequestProcessor.process(KualiRequestProcessor.java:89)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.kuali.rice.kew.web.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:78)
at org.kuali.rice.kew.web.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.kuali.rice.kew.web.UserLoginFilter.doFilter(UserLoginFilter.java:89)
at org.kuali.rice.kew.web.UserLoginFilter.doFilter(UserLoginFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.kuali.rice.kew.web.BootstrapFilter.doFilter(BootstrapFilter.java:162)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.kuali.kfs.sys.web.filter.DevelopmentLoginFilter.doFilter(DevelopmentLoginFilter.java:66)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.singularity.ee.agent.appagent.services.transactionmonitor.eum.filter.EUMInjectedFilter.doFilter(EUMInjectedFilter.java:44)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.kuali.rice.krad.web.filter.HideWebInfFilter.doFilter(HideWebInfFilter.java:69)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:202)
at net.bull.javamelody.MonitoringFilter.doFilter(MonitoringFilter.java:175)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:470)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:589)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:679)

Comment by Muddu Salem [ 22/Aug/12 ]

Aaron,

The above stack trace is the new error showing up now. The latest rice revision that Jonathan pulled is 39500. I am going to reopen the rice issue.

Thanks,
Muddu

Comment by Muddu Salem [ 22/Aug/12 ]

The new stack trace when I hit "show inactive" button.

Comment by Aaron Hamid (Inactive) [ 22/Aug/12 ]

Muddu you are right, there is another NPE here. The underlying issue in this and previous case is that it's operating on a KNS Field object which has null property values. The fix for this NPE will be committed in a moment.

I can reproduce this in a local KFS and am trying to get to the bottom of why the field/container information is not present (specifically containerElementName). Tab state is set to open on tab key generated from field/container name (this requires summaryTitle to be set in DD), however the tabs in question have tab keys generated by index so this doesn't actually work.

subtab.tag

 <c:set var="tabKey" value="${currentTabIndex}"/>
Comment by Aaron Hamid (Inactive) [ 23/Aug/12 ]

Decoupling tab state from row visibility resolves this issue and is probably the more correct thing to do; KFSMI-5222 appears unaffected hide/show inactive works fine. Emailed Kymber for her opinion on this fix.

Comment by Aaron Hamid (Inactive) [ 23/Aug/12 ]

Committed fix to decouple "hide/show inactive" with tab state. Hopefully that's the nail in the coffin for this particular issue. Functional requirements re: "hide/show inactive" and "hide/show" tab can continue to be refined on https://jira.kuali.org/browse/KFSMI-607

Comment by Aaron Hamid (Inactive) [ 23/Aug/12 ]

went back to drawing board and reverted the original coupling between hide/show inactive and tab state, which circumvents this "reopening" issue entirely. hiding and showing inactive rows works, with the stipulation that this action does not affect the open/close state of tabs.

Comment by Jessica Coltrin (Inactive) [ 30/Oct/12 ]

closing all 2.1.2 Jiras

Generated at Tue Feb 25 13:14:48 CST 2020 using JIRA 6.1.5#6160-sha1:a61a0fc278117a0da0ec9b89167b8f29b6afdab2.