Error with editor_toolbar

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Error with editor_toolbar

Mencey Melgar
Hi there, yesterday, I played a little bit with this macro because I wanted to try to help here

Basically what I did was add a <if.both condition1=...etc before the < n.editor_insert_image_button/>, It didn't work, so I just changed it to my custom(I modified this macro and it was working before make this "test"). This was my macro:

<override_macro name="editor_toolbar" parameters="textarea_id, original_text, node_id">
    <n.put_in_head.>
        <n.editor_stylesheet/>
        <n.editor_shared_scripts textarea_id="[n.textarea_id/]" node_id="[n.node_id/]"/>
        <script type="text/javascript" src="/util/minmax.js"></script>
    </n.put_in_head.>
    
    <div class="toolbar rounded-top shaded-bg-color">
        <table class="toobar">
            <tr>
                <n.editor_quote_button original_text="[n.original_text/]"/>
                <n.editor_smiley_button/>
                <n.editor_bold_button/>
                <n.editor_italic_button/>
                <n.editor_subheaders_button/>
                <n.editor_link_button/>
                <n.editor_upload_file_button/>
                <n.editor_insert_image_button/>
                <n.editor_embed_button/>
                <n.editor_more_options_button/>
            </tr>
        </table>
    </div>
</override_macro>

I changed it back to the default macro cause users couldn't reply posts and more..

Here is my forum: http://forums.6326.n7.nabble.com/

And here is the Error:

Error 500
site-6326 7729658
Message: site-6326 7729658
RequestURI: /template/NamlServlet.jtp
Server: n7.nabble.com
Caused by:
fschmidt.util.servlet.JtpContextServlet$JtpServletException: url=http://forums.6326.n7.nabble.com/template/NamlServlet.jtp?macro=reply&node=561  method=GET user-agent=Mozilla/5.0 (Windows NT 6.0) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.97 Safari/537.22 referer=http://forums.6326.n7.nabble.com/LG-Tournament-td549.html remote=85.59.251.0
	at fschmidt.util.servlet.JtpContextServlet.handleException(JtpContextServlet.java:558)
	at fschmidt.util.servlet.JtpContextServlet.service2(JtpContextServlet.java:463)
	at fschmidt.util.servlet.JtpContextServlet.service(JtpContextServlet.java:332)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:565)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1360)
	at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:77)
	at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:144)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
	at cachingfilter.CachingFilter.doFilter(CachingFilter.java:133)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
	at fschmidt.util.servlet.BadBotFilter.doFilter(BadBotFilter.java:74)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
	at fschmidt.util.servlet.ConnectionLimitFilter.doFilter(ConnectionLimitFilter.java:94)
	at nabble.view.lib.NabbleConnectionLimitFilter.doFilter(NabbleConnectionLimitFilter.java:26)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
	at nabble.view.lib.NabbleErrorFilter.doFilter(NabbleErrorFilter.java:21)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:477)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
	at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
	at org.eclipse.jetty.server.Server.handle(Server.java:349)
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:76)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:609)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:45)
	at nabble.model.Executors$1$1.run(Executors.java:27)
	at fschmidt.util.executor.ThreadTimer$1.run(ThreadTimer.java:18)
	at fschmidt.util.executor.AbstractThreadPool$1.run(AbstractThreadPool.java:29)
	at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.RuntimeException: site-6326 7729658
	at nabble.model.SiteImpl.getTemplate(SiteImpl.java:167)
	at nabble.view.web.template.NamlServlet.service(NamlServlet.java:155)
	at nabble.view.web.template.NamlServlet.service(NamlServlet.java:134)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at fschmidt.util.servlet.JtpContextServlet.service2(JtpContextServlet.java:461)
	... 38 more
Caused by: nabble.naml.compiler.CompileException: parameter 'original_text' not allowed, only use [?node_id, textarea_id, ?original_text]
	in editor_toolbar(nabble:reply.naml:179) - <n.editor_toolbar
							textarea_id="[n.message_field.name/]"
							original_text="[n.if.page_node.is_post][then.page_node.message_quoted/][/n.if.page_node.is_post]"
						/>
	in if(nabble:reply.naml:174) - <n.if.visitor.is_registered> - public static void nabble.naml.namespaces.BasicNamespace._if(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
	in message_control(nabble:reply.naml:146) - <n.message_control/>
	in overridden(workgroup:workgroup.naml:157) - <n.overridden />
	in reply_form(nabble:reply.naml:124) - <n.reply_form />
	in content(nabble:utilities.naml:955) - <n.content/>
	in form(nabble:reply.naml:120) - <n.form. onsubmit="return singleSubmit(this)">
	in body(nabble:utilities.naml:10) - <n.body/>
	in body(nabble:utilities.naml:22) - <n.body/>
	in nabble_html(nabble:utilities.naml:18) - <n.nabble_html> - public void nabble.view.web.template.ServletNamespace.nabble_html(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
	in html_impl(nabble:utilities.naml:4) - <n.html_impl>
	in html(nabble:reply.naml:87) - <n.html>
	in do(nabble:utilities.naml:976) - <n.as_node_page.do/>
	in as_node_page(nabble:utilities.naml:976) - <n.as_node_page.do/> - public void nabble.view.web.template.NodeNamespace.as_node_page(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter)
	in do(nabble:utilities.naml:981) - <n.get_node_from_request_parameter.do/>
	in get_node_from_request_parameter(nabble:utilities.naml:981) - <n.get_node_from_request_parameter.do/> - public void nabble.view.web.template.ServletNamespace.get_node_from_request_parameter(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.ScopedInterpreter) throws java.io.IOException,javax.servlet.ServletException,nabble.naml.namespaces.TemplateException
	in catch_exception(nabble:utilities.naml:980) - <n.catch_exception. id="get-node-block"> - public void nabble.naml.namespaces.BasicNamespace.catch_exception(nabble.naml.compiler.IPrintWriter,nabble.naml.compiler.Interpreter)
	in get_node_from_parameter(nabble:utilities.naml:976) - <n.get_node_from_parameter.as_node_page.do/>
	in node_page(nabble:reply.naml:48) - <n.node_page.>
	in new_post(nabble:reply.naml:2) - <n.new_post>
	in (nabble:reply.naml:1) - <macro name="reply" requires="servlet">
	at nabble.naml.compiler.Compiler.getMacroChunk(Compiler.java:644)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:525)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:345)
	at nabble.naml.compiler.Compiler.getTagArgs(Compiler.java:769)
	at nabble.naml.compiler.Compiler.multiMethodTag(Compiler.java:600)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:495)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:345)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:345)
	at nabble.naml.compiler.Compiler.compileMacro(Compiler.java:240)
	at nabble.naml.compiler.Compiler.getMacroChunk2(Compiler.java:729)
	at nabble.naml.compiler.Compiler.getMacroChunk(Compiler.java:660)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:525)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.compileMacro(Compiler.java:240)
	at nabble.naml.compiler.Compiler.getMacroChunk2(Compiler.java:729)
	at nabble.naml.compiler.Compiler.getMacroChunk(Compiler.java:660)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:525)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.compileMacro(Compiler.java:240)
	at nabble.naml.compiler.Compiler.getMacroChunk2(Compiler.java:729)
	at nabble.naml.compiler.Compiler.getMacroChunk(Compiler.java:660)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:525)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.getMacroArgChunk(Compiler.java:634)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:510)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:345)
	at nabble.naml.compiler.Compiler.compileMacro(Compiler.java:240)
	at nabble.naml.compiler.Compiler.getMacroChunk2(Compiler.java:729)
	at nabble.naml.compiler.Compiler.getMacroChunk(Compiler.java:660)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:525)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.getMacroArgChunk(Compiler.java:634)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:510)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.getMacroArgChunk(Compiler.java:634)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:510)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.getTagArgs(Compiler.java:769)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:533)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.compileMacro(Compiler.java:240)
	at nabble.naml.compiler.Compiler.getMacroChunk2(Compiler.java:729)
	at nabble.naml.compiler.Compiler.getMacroChunk(Compiler.java:660)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:525)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.compileMacro(Compiler.java:240)
	at nabble.naml.compiler.Compiler.getMacroChunk2(Compiler.java:729)
	at nabble.naml.compiler.Compiler.getMacroChunk(Compiler.java:660)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:525)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.getMacroArgChunk(Compiler.java:634)
	at nabble.naml.compiler.Compiler.multiMethodTag(Compiler.java:550)
	at nabble.naml.compiler.Compiler.multiMethodTag(Compiler.java:593)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:495)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.getMacroArgChunk(Compiler.java:634)
	at nabble.naml.compiler.Compiler.multiMethodTag(Compiler.java:550)
	at nabble.naml.compiler.Compiler.multiMethodTag(Compiler.java:593)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:495)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.getDotArg(Compiler.java:740)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:531)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.compileMacro(Compiler.java:240)
	at nabble.naml.compiler.Compiler.getMacroChunk2(Compiler.java:729)
	at nabble.naml.compiler.Compiler.multiMethodTag(Compiler.java:584)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:495)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.compileMacro(Compiler.java:240)
	at nabble.naml.compiler.Compiler.getMacroChunk2(Compiler.java:729)
	at nabble.naml.compiler.Compiler.getMacroChunk(Compiler.java:660)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:525)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.compileMacro(Compiler.java:240)
	at nabble.naml.compiler.Compiler.getMacroChunk2(Compiler.java:729)
	at nabble.naml.compiler.Compiler.getMacroChunk(Compiler.java:660)
	at nabble.naml.compiler.Compiler.singleMethodTag(Compiler.java:525)
	at nabble.naml.compiler.Compiler.compileElement(Compiler.java:493)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:303)
	at nabble.naml.compiler.Compiler.compileMacro(Compiler.java:240)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:86)
	at nabble.naml.compiler.Compiler.compile(Compiler.java:58)
	at nabble.naml.compiler.Program$1.get(Program.java:88)
	at nabble.naml.compiler.Program$1.get(Program.java:84)
	at fschmidt.util.java.Memoizer$1.call(Memoizer.java:30)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
	at fschmidt.util.java.FastFuture.run(FastFuture.java:21)
	at fschmidt.util.java.Memoizer.get(Memoizer.java:37)
	at nabble.naml.compiler.Program.getTemplate(Program.java:280)
	at nabble.naml.compiler.Program.getTemplate(Program.java:272)
	at nabble.model.SiteImpl.getTemplate(SiteImpl.java:162)
	... 42 more

thx
:) Helper
Reply | Threaded
Open this post in threaded view
|

Re: Error with editor_toolbar

Pedro
Is it working now? Do you remember what was your whole "if" clause?
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Error with editor_toolbar

Mencey Melgar
It works the standard macro, but not mine(I added the n.editor_upload_file_button)

it was something like this(I don't remember if I used n.owner or n.visitor

<override_macro name="editor_toolbar" parameters="textarea_id, original_text, node_id">
    <n.put_in_head.>
        <n.editor_stylesheet/>
        <n.editor_shared_scripts textarea_id="[n.textarea_id/]" node_id="[n.node_id/]"/>
        <script type="text/javascript" src="/util/minmax.js"></script>
    </n.put_in_head.>
    
    <div class="toolbar rounded-top shaded-bg-color">
        <table class="toobar">
            <tr>
                <n.editor_quote_button original_text="[n.original_text/]"/>
                <n.editor_smiley_button/>
                <n.editor_bold_button/>
                <n.editor_italic_button/>
                <n.editor_subheaders_button/>
                <n.editor_link_button/>
                <n.editor_upload_file_button/>
                                <n.if.both condition1="[n.visitor.is_site_admin/]" condition2="[n.owner.is_in_group group='Moderators'/]">
<then>
                <n.editor_insert_image_button/>
</then>
</n.if.both>
                <n.editor_embed_button/>
                <n.editor_more_options_button/>
            </tr>
        </table>
    </div>
</override_macro>

then I tried this one:

<override_macro name="editor_toolbar" parameters="textarea_id, original_text, node_id">
    <n.put_in_head.>
        <n.editor_stylesheet/>
        <n.editor_shared_scripts textarea_id="[n.textarea_id/]" node_id="[n.node_id/]"/>
        <script type="text/javascript" src="/util/minmax.js"></script>
    </n.put_in_head.>
    

        <n.if.both condition1="[n.visitor.is_site_admin/]" condition2="[n.owner.is_in_group group='Moderators'/]">
<then>
   <div class="toolbar rounded-top shaded-bg-color">
        <table class="toobar">
            <tr>
                <n.editor_quote_button original_text="[n.original_text/]"/>
                <n.editor_smiley_button/>
                <n.editor_bold_button/>
                <n.editor_italic_button/>
                <n.editor_subheaders_button/>
                <n.editor_link_button/>
                <n.editor_upload_file_button/>
                <n.editor_insert_image_button/>
                                     <n.editor_embed_button/>
                <n.editor_more_options_button/>
            </tr>
        </table>
    </div>
</then>
<else>
<div class="toolbar rounded-top shaded-bg-color">
        <table class="toobar">
            <tr>
                <n.editor_quote_button original_text="[n.original_text/]"/>
                <n.editor_smiley_button/>
                <n.editor_bold_button/>
                <n.editor_italic_button/>
                <n.editor_subheaders_button/>
                <n.editor_link_button/>
                <n.editor_upload_file_button/>
                                     <n.editor_embed_button/>
                <n.editor_more_options_button/>
            </tr>
        </table>
    </div>
</else>
</n.if.both>
</override_macro>
:) Helper
Reply | Threaded
Open this post in threaded view
|

Re: Error with editor_toolbar

Pedro
We released a new fix. Please, try again ans let me know.
My test forum.
Reply | Threaded
Open this post in threaded view
|

Re: Error with editor_toolbar

Mencey Melgar
Thanks :)
:) Helper