How can you debug / track down problems in Fluid? - typo3

I made an error when using a ViewHelper with an unsupported argument and my Fluid Partial wasn't rendered at all.
How can I debug / track down problems like these? Usually I would expect an exception to be thrown. I enabled debug preset and there is nothing in the sys_log, no error message is displayed.
Is there some setting I can use to cause error messages to be created or more information to get logged?
Reproduce
Use Fluid ViewHelper with unsupported argument (here, name is not a supported argument):
<f:uri.external name="something" uri="https://typo3.org">f.uri.external</f:uri.external>
Result
The Fluid Partial is not displayed at all.

most of the time I'm using to check do I even get wanted values before:
<f:debug>{_all}</f:debug>
or
<f:debug>{variable}</f:debug>

Related

iTextSharp error, casting IncCell to Rectangle

I've been asked to look at C# code that's returning the following error:
Unable to cast object of type
'iTextSharp.text.html.simpleparser.IncCell' to type 'iTextSharp.text.Rectangle'.
at iTextSharp.text.pdf.PdfDocument.Add(IElement element)
at iTextSharp.text.Document.Add(IElement element)
It looks like they're using iTextSharp v5.0.2 and have not yet moved from HtmlWorker to XmlWorker.
Questions:
What is IncCell? I see it in the source docs but can't find any info about what it is - I'm assuming it's just for internal use.
Is this related to a cell in a table? A need for a Div or Paragraph within a cell?
What can they do to diagnose issues like this down to the HTML source that caused the error? I suspect this is an issue with not conforming to XHTML, but I can't verify that without knowing exactly what IElement that code was working on when it choked. It could be due to bad styling too, I have no idea at this time. Is there any kind of detail logging that will tell us what element is being processed at any given time? Should I just get them to load source and trace through it?
Is it probable that this will be fixed with an update to the latest version (currently 5.5.9), and a re-fit of XmlWorker?
Other recommendations?
Thanks!

$this->request->getArgument('group'); not working outside the plugin for breadcrums

I building an TYPO3 extension, withs contains a frond-end plugin. In the fluid template I'm using the following link. This links contains the argument named "group" to send the value "3" to the page.
<f:link.action pageUid="1" pluginName="PluginAds" controller="Ads" arguments="{group: 3}">
In the controller "PluginAds" under "AdsController" it works ok to get the value with the following action:
$this->request->getArgument('group');
But I also want to use the argument "group" for generating the correct breadcrums link. But when I use the same code in a different controller I'm getting the error that the argument does not exists. Can anyone help on this?
Inspect with browser tools how does f:link.action constructs prefixes for params of your plugin, it's i.e.: tx_extkey_pluginsname[myparam]
Within the plugin's actions you can get myparam by
$this->request->getArgument('myparam')
anyway anywhere else you need to get it as normal GET array, so it will be something like:
$pluginsParams = GeneralUtility::_GET('tx_extkey_pluginsname');
$myParam = $pluginsParams['myparam'];
Other thing is that you should always check if:
$this->request->hasArgument('group')
Before trying using it, otherwise it can lead you to null pointer exception.

Getting an error while writing a custom velocity macro

When creating my own macro, and trying to add it so that anyone can use it, I get the following error:
Error number 4001 in 4: Error while parsing velocity page /templates/docdoesnotexist.vm
Wrapped Exception: Cannot start the Velocity engine
I do not change that file, but I do change xwiki/templates/macros.txt and /macros.vm by adding recentChanges=velocity:recentChanges: and #macro(recentChanges) respectively (yes, I do add working content after #macro(recentChanges))
That looks like a syntax error in macros.vm. You should revert to the original macros.vm and first try to write your custom macro in a wiki page. Once it works, you can move it to macros.vm and restart the server.
macros.txt shouldn't be edited, it's a legacy file used by the older WYSIWYG editor.

GWT set inner HTML giving Unknown runtime error

Please let me know what i am doing wrong here:
I need to add dynamic content to my htmy table using GWT.
I am using setInnerHTML method for this
Element tableElement=(Element) Document.get().getElementById("htmltable");
tableElement.setInnerHTML("<tr><td>1</td><td>2000</td><td>2</td><td>3000</td></tr>");
But i am getting this error
com.google.gwt.core.client.JavaScriptException: (Error): Unknown runtime error
number: -2146827688
description: Unknown runtime error
Please let me know what i am doing wrong here.
this can be due to multiple reasons.
If this is happening on IE only this post covers it: Debugging IE8 Javascript Replace innerHTML Runtime Error
In Ie you can not set the inner html of a table element.
From GWT CellTableImplementation for IE:
IE doesn't support innerHTML on tbody, nor does it support removing or
replacing a tbody. The only solution is to remove and replace the rows
themselves.

resolving org.apache.jasper.JasperException

I have a small web application written using Java programming language . whenever I am trying to access a jsp page I am getting the following error..................
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /jsp/newInvoice_acct_not_in_db.jsp(101,3) The s:hidden tag declares that it accepts dynamic attributes but does not implement the required interface
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:777)
org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2399)
org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
org.apache.jasper.compiler.Validator.validate(Validator.java:1739)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:166)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:315)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:282)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Someone please help me find the solution for it..........
Your jSP has an compilation issue...Check whether your JSP fine
There's something wrong with a hidden tag in your JSP. Check the Struts 2 documentation on hidden tags (http://struts.apache.org/2.2.3/docs/hidden.html) to make sure everything's compliant. Try removing it temporarily, and if that fixes the problem start changing bits and pieces of it until you know what the problem is. Also, are you using Eclipse? If not you should, because it will make it a lot easier to figure out where things have gone wrong with your tags.