【问题标题】:WFFM - Capcha - Value cannot be nullWFFM - 验证码 - 值不能为空
【发布时间】:2016-10-08 02:36:40
【问题描述】:

我正在使用 Sitecore 8 update 3,目前我在 WFFM 表单中添加了验证码并按下音频,但显示错误如下:

[ArgumentNullException: Value cannot be null.
Parameter name: input]

       System.IO.BinaryReader..ctor(Stream input, Encoding encoding, Boolean leaveOpen) +13905648
       Sitecore.Form.Core.Media.Wave.Concat(StreamList inStreams, BinaryWriter to) +193
       Sitecore.Form.Core.Web.CaptchaAudionHandler.DoSpeech(String text, String fileName) +452
       Sitecore.Form.Core.Web.CaptchaAudionHandler.ProcessRequest(HttpContext context) +618
       Sitecore.Form.Core.Pipeline.RequestProcessor.CaptchaResolver.ProcessRequest(HttpContext context) +358
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +508
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +92

我该如何解决这个问题?

更新: 在我使用了名为 Sitecore.Support.432676 的包之后(Sitecore Climber 的建议)。我更新了文件 CaptchaField.cshtml 中的 javascript,音频现在可以正常工作了。

<script type="text/javascript">
    $scw(document).ready(function () {
        $scw('.selector-field-captcha-play').click(
            function (event) {
                event.preventDefault();
                var container = $scw(".field-captcha-audio");
                container.empty();
                container.append('<audio src="' + '@audioHandlerUrl' + "&nocache=" + Date.now() + '" autoplay="autoplay"><embed src="' + '@audioHandlerUrl' + "&nocache=" + Date.now() + '" width="180" height="90" hidden="true" /></audio>');
            }
        );
    });
</script>

但是点击按钮刷新后。所有数据都是空的,因为在文件 sc.fields-captcha.js 中:

$scw(this.element).find(".selector-field-captcha-refresh").click(function (event) {
    event.preventDefault();
    window.location.reload();
});

感谢您对此的任何想法。谢谢

【问题讨论】:

  • 到目前为止,您做了什么来尝试解决它?
  • 您是否按照安装说明对web.config 进行了必要的修改以添加CaptchaImageCaptchaAudio 处理程序?
  • @jammykam,是的,我做到了

标签: sitecore sitecore8


【解决方案1】:

记得执行 WFFM 安装后步骤的最后一步:

  1. 将以下节点添加到 Web.config:

&lt;add name="CaptchaImage" verb="*" path="CaptchaImage.axd" type="Sitecore.Form.Core.Pipeline.RequestProcessor.CaptchaResolver, Sitecore.Forms.Core" /&gt;

&lt;add name="CaptchaAudio" verb="*" path="CaptchaAudio.axd" type="Sitecore.Form.Core.Pipeline.RequestProcessor.CaptchaResolver, Sitecore.Forms.Core" /&gt;

  • 对于 IIS 6.x 在 configuration\system.web\httpHandlers 节点下
  • 适用于 IIS 7.x 及更高版本,位于 configuration\system.webServer\handlers 节点下

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多