Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

`#spinner{}` causes server error #48

Closed
Inaimathi opened this Issue · 1 comment

3 participants

@Inaimathi

Putting a #spinner{} element on a page causes an Internal Server Error page to be displayed instead of the intended page.

Steps to reproduce:
1. Start with the standard index.erl page that ships with nitrogen
2. Add a line to inner_body that reads #spinner{}, (omit the comma, if this is the last line, obviously)
3. Save the page and let sync recompile it (this causes no errors, just emits two INFO REPORT notices saying that index.erl has been recompiled and reloaded)
4. Browse to http://localhost:8000

Expected: The standard startup page with a hidden spinner element at the specified position.

Observed: Internal Server Error in the browser, and the following error dumped to console

=INFO REPORT==== 31-Jul-2012::19:14:34 ===
{error,error,undef,
       [{wf,render,
            [{panel,is_element,element_panel,".wfid_temp416077",
                    ".wfid_temp416077",undefined,true,
                    [spinner,[".wfid_temp416077",[]]],
                    [],
                    {image,is_element,element_image,undefined,undefined,
                           undefined,true,[],[],"/nitrogen/spinner.gif",
                           undefined},
                    [],true}],
            []},
        {wf_render_elements,call_element_render,2,
                            [{file,"src/lib/wf_render_elements.erl"},
                             {line,112}]},
        {wf_render_elements,render_element,1,
                            [{file,"src/lib/wf_render_elements.erl"},
                             {line,100}]},
        {wf_render_elements,render_elements,2,
                            [{file,"src/lib/wf_render_elements.erl"},
                             {line,34}]},
        {lists,foldl,3,[{file,"lists.erl"},{line,1197}]},
        {wf_render_elements,render_elements,2,
                            [{file,"src/lib/wf_render_elements.erl"},
                             {line,29}]},
        {lists,foldl,3,[{file,"lists.erl"},{line,1197}]},
        {wf_render_elements,render_elements,2,
                            [{file,"src/lib/wf_render_elements.erl"},
                             {line,29}]}]}

Environment Notes:

  • Debian Wheezy 64-bit running on a Core i3
  • Erlang R15B01 (erts-5.9.1) [source] [64-bit] [smp:4:4] [async-threads:0] [kernel-poll:false], Eshell V5.9.1
  • Nitrogen from commit d88e01282370599ac878199aa92505307284175c made with make rel_yaws (subsequent commits seem to do nothing related to elements)
@tex

This is a fix for that. Jesse can you pick it up and apply please? However the spinning doesn't stop when AJAX request finishes.

diff --git a/src/elements/other/element_spinner.erl b/src/elements/other/element_spinner.erl
index 0d26af2..2715885 100644
--- a/src/elements/other/element_spinner.erl
+++ b/src/elements/other/element_spinner.erl
@@ -10,14 +10,11 @@ reflect() -> record_info(fields, spinner).
 
 render_element(Record) -> 
     wf:wire(spinner, #hide{}),
-    Terms = #panel {
+    #panel {
         html_id=Record#spinner.html_id,
         id=Record#spinner.id,
         anchor=Record#spinner.anchor,
         class=[spinner, Record#spinner.class],
         style=Record#spinner.style,
         body=#image { image=Record#spinner.image }
-    },
-
-    wf:render(Terms).
-
+    }.
@choptastic choptastic closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.