[Freeipa-devel] [PATCH] 107 Content is no more overwritten by error message

Petr Vobornik pvoborni at redhat.com
Fri Mar 9 13:16:09 UTC 2012


When an error which caused calling of report_error occur, the content of 
a facet got replaced by error message. There was no way how to force the 
facet to recreate its content and the facet became unusable.

This patch creates a container for an error message. On error, 
report_error writes its content to error container, content container is 
hidden and error container is shown. Older comment in a code suggested 
to move the error message to facet's footer. A message in a footer could 
be missed by the user and on top of that a footer is sometimes used by 
various facet and we would have to solve the same problem again.

 From experience the cause of an error is usually a missing pkey in a 
path. Therefore error information suggests user to navigate to top 
level. It causes to load default facets with default values so errors in 
navigation state shouldn't happen.

Facet content is displayed back on facet_show. If user tries to display 
same object as before facet's need_update() would return false, 
therefore need_update was modified to always return true if error is 
displayed.

Also it may be possible to display facet content on refresh success. I 
tried to avoid that because it would require putting show_content calls 
to various success handlers or load methods. It would add one more thing 
developer needs to think of when overriding refresh or load method.

Reproduction:
  1) display any nested entity - ie DNS record
  2) delete its parent pkey from path - &dnszone-pkey=example.com
  3) reload the page with this path

https://fedorahosted.org/freeipa/ticket/2449
-- 
Petr Vobornik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0106-Content-is-no-more-overwritten-by-error-message.patch
Type: text/x-patch
Size: 8012 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20120309/e13d52af/attachment.bin>


More information about the Freeipa-devel mailing list