Blog problems

Topics: Troubleshooting
Jul 6, 2011 at 3:29 PM

Hi all,

Two problems with the Blog package:

1. When I try to submit a comment, no matter what values I put in the form fields, I get the following error:

Error: Input string was not in a correct format.
Error details:
Failed to get value for function 'Composite.Community.Blog.BlogRenderer'
An error occurred during a call to extension function 'CallFunction'. See InnerException for a complete description of the error.
Failed to get value for function 'Composite.Community.Blog.Comments'
An error occurred during a call to extension function 'GetEncryptedValue'. See InnerException for a complete description of the error.
Input string was not in a correct format.

2. When I click a post heading to view the full post, the resulting page (e.g. Blog.aspx/2011/07/06/My-Post) displays the post content for both the "content" and "aside" placeholders. The "aside" placeholder works fine on the post list page (i.e. I see the tag list etc.)

Any ideas?

Thanks,

Rob

Jul 7, 2011 at 8:56 AM

Seems these two issues are related.

When I use the placeholder approach, e.g.

<rendering:placeholder id="content" title="Content" default="false" />
<rendering:placeholder id="aside" title="Aside" default="false" />

Then C1 inserts the main blog content, comments form for BOTH placeholders.

When I try to submit the comment form I get the error above, presumably because there are two comment forms on the page and they're conflicting in some way.

Only way I can get it to work is by using the blog functions to manually add a tag cloud and archive, e.g.

 

<f:function name="Composite.Community.Blog.TagCloud">
<f:param name="MinFontSize" value="10" />
<f:param name="MaxFontSize" value="22" />
</f:function>

<f:function name="Composite.Community.Blog.Archive" />

 

I prefer this approach anyway as it gives me more control, but the "aside" approach should work.

Unless I'm doing something wrong?

Coordinator
Jul 7, 2011 at 9:14 AM

Hello,

Check your Blog page content and make sure that Content  placeholder contains only Composite.Community.Blog.BlogRenderer function call and Aside placeholder contains only  two function calls: Composite.Community.Blog.Archive and Composite.Community.Blog.TagCloud

Dec 7, 2011 at 11:17 AM

Hello

Could you please advise what would be causing this excpetion when using 'Composite.Community.ContactForm' function on the page (it doesn't matter if Captcha set to false or true ):

 

20111207 21:58:16.4726 2 24 Error PageRenderer  System.InvalidOperationException: Failed to get value for function 'Composite.Community.ContactForm'
   at Composite.Functions.FunctionRuntimeTreeNode.GetValue(FunctionContextContainer contextContainer)
   at Composite.Core.WebClient.Renderings.Page.PageRenderer.<>c__DisplayClass19.<ExecuteEmbeddedFunctions>b__15(Int32 i)
20111207 21:58:16.5400 2 24 Error PageRenderer | INNER  System.Xml.Xsl.XslTransformException: An error occurred during a call to extension function 'GetEncryptedValue'. See InnerException for a complete description of the error.
   at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args)
   at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
   at captchaEncryptedValue(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
   at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
   at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
   at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
   at System.Xml.Xsl.XslCompiledTransform.Transform(XmlReader input, XsltArgumentList arguments, XmlWriter results)
   at Composite.Plugins.Functions.FunctionProviders.XsltBasedFunctionProvider.XsltBasedFunctionProvider.XsltXmlFunction.Execute(ParameterList parameters, FunctionContextContainer context)
   at Composite.Functions.Foundation.PluginFacades.FunctionWrapper.Execute(ParameterList parameters, FunctionContextContainer context)
   at Composite.Functions.FunctionRuntimeTreeNode.GetValue(FunctionContextContainer contextContainer)
20111207 21:58:16.5556 2 24 Error PageRenderer | INNER | INNER  System.TypeInitializationException: The type initializer for 'Composite.Core.WebClient.Captcha.Encryption' threw an exception.
   at Composite.Core.WebClient.Captcha.Encryption.Encrypt(String value)
   at Composite.Core.WebClient.Captcha.Captcha.CreateEncryptedValue()
   at Composite.Plugins.Functions.XslExtensionsProviders.CaptchaXslExtension.GetEncryptedValue(String oldValue)
20111207 21:58:16.5605 2 24 Error PageRenderer | INNER | INNER | INNER  System.NullReferenceException: Object reference not set to an instance of an object.
   at Composite.Core.WebClient.Captcha.Encryption.GetCpuId()
   at Composite.Core.WebClient.Captcha.Encryption..cctor()
20111207 21:58:35.2294 2 18 Error PageRenderer  System.InvalidOperationException: Failed to get value for function 'Composite.Community.ContactForm'
   at Composite.Functions.FunctionRuntimeTreeNode.GetValue(FunctionContextContainer contextContainer)
   at Composite.Core.WebClient.Renderings.Page.PageRenderer.<>c__DisplayClass19.<ExecuteEmbeddedFunctions>b__15(Int32 i)
20111207 21:58:35.2597 2 18 Error PageRenderer | INNER  System.Xml

 

Thanks

Sergey

 

Coordinator
Dec 8, 2011 at 10:10 AM

Hello,

Could not reproduce this problem :( , but it looks like the standard C1 function  GetEncryptedValue() returns this error in some conditions.

1. To fix this error when use Captcha set to false, please, apply next fix:  locate XSLT function Composite.Community.ContactForm -> edit it -> on the Template tab locate next raw

 

<xsl:variable name="captchaEncryptedValue" select="captcha:GetEncryptedValue(c1:GetFormData('captchaEncryptedValue'))" />

and replace it with this:

 

	<xsl:variable name="captchaEncryptedValue">
	  <xsl:if test="$useCaptcha = 'true'">
		  <xsl:value-of select="captcha:GetEncryptedValue(c1:GetFormData('captchaEncryptedValue'))" />
	  </xsl:if>
	</xsl:variable>

2. Need to locate why GetEncryptedValue() returns the error in your case. Could you provide with some details of your environment (OS, Web Server...)?

Also try to create some Test XSLT function and on the Template tab just insert next code:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:in="http://www.composite.net/ns/transformation/input/1.0" xmlns:lang="http://www.composite.net/ns/localization/1.0" xmlns:f="http://www.composite.net/ns/function/1.0" xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xsl in lang f">
	<xsl:template match="/">
		<html>
			<head></head>
			<body>
				<xsl:value-of select="captcha:GetEncryptedValue(null)" xmlns:captcha="http://c1.composite.net/Captcha" />
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>
press Preview -> Do you receive the same error?