繁体   English   中英

TYPO3 Formhandler装订器未写入数据库

[英]TYPO3 Formhandler finisher does not write to database

客户的TYPO3(6.1.7)网站上线后,Formhandler表单将无法正常工作。 他们确实发送了电子邮件,但是似乎他们不再执行Finisher_DB来写入数据库。

TypoScript设置如下所示:

plugin.Tx_Formhandler.settings {

  debug = 0

  # GENERAL CONFIGURATION
  name = Default
  addErrorAnchors = 1
  formValuesPrefix = formhandler

  fillValueMarkersBeforeLangMarkers = 1

  # ERRORS LAYOUT
  singleErrorTemplate {
    totalWrap = <div>|</div>
    singleWrap = <span class="error">|</span><br />
  }

  errorListTemplate {
    totalWrap = <ul>|</ul>
    singleWrap = <li class="error">|</li>
  }

  validators {
    1.class = Tx_Formhandler_Validator_Default
    1.config {
      fieldConf {
        wish.errorCheck.1 = required 
        alternative.errorCheck.1 = required 
        firstname.errorCheck.1 = required 
        surname.errorCheck.1 = required 
        nationality.errorCheck.1 = required 
        dateofbirth.errorCheck.1 = required 
        phone.errorCheck.1 = required 
        email.errorCheck.1 = required 
        street.errorCheck.1 = required 
        zip.errorCheck.1 = required 
        city.errorCheck.1 = required 
        country.errorCheck.1 = required 
      }
    }
  }

  # Finishers configuration
  finishers {
    1.class = Tx_Formhandler_Finisher_Mail
    1.config {
      checkBinaryCrLf = registrationMessagePlain, registrationMessageHtml
      limitMailsToUser = 10
      admin {
      }
      user {
      }
    }

    2.class = Tx_Formhandler_Finisher_DB
    2.config{
      table = tx_chilifhregistration
      key = uid

      fields {
        timeslot = Sommerplatz
        timeslot_july.mapping = timeslotSummerJuly
        timeslot_august.mapping = timeslotSummerAugust
        timeslot_september.mapping = timeslotSummerSeptember

        wish.mapping = wish
        wishcategory11.mapping = wishCategory11
        wishcategory19.mapping = wishCategory19
        wishcategory22.mapping = wishCategory22
        wishcategorydb.mapping = wishCategoryDb

        alternative.mapping = alternative
        alternativecategory11.mapping = alternativeCategory11
        alternativecategory19.mapping = alternativeCategory19
        alternativecategory22.mapping = alternativeCategory22
        alternativecategorydb.mapping = alternativeCategoryDb

        salutation.mapping = salutation
        firstname.mapping = firstname
        surname.mapping = surname
        nationality.mapping = nationality
        dateofbirth.mapping = dateofbirth
        phone.mapping = phone
        email.mapping = email
        street.mapping = street
        zip.mapping = zip
        city.mapping = city
        country.mapping = country

        salutation2.mapping = salutation2
        firstname2.mapping = firstname2
        surname2.mapping = surname2
        nationality2.mapping = nationality2
        dateofbirth2.mapping = dateofbirth2
        phone2.mapping = phone2
        email2.mapping = email2
        street2.mapping = street2
        zip2.mapping = zip2
        city2.mapping = city2
        country2.mapping = country2
      } 
    }
  }
}

可能是什么问题呢?

您最好对表单使用predef-definition-style。 这样可以节省多种表单的麻烦,并且是更干净的实现。

plugin.Tx_Formhandler.settings.predef.yourformularname { ...config... }

您可以在官方网站上找到大量示例

我假设您的管理员和用户mail-config仅是空的,因为您将不会发布任何客户信息?

如果您填写每个字段,该表格都有效吗?

在我自己的用例中,我需要与装订器映射的所有字段都是必需的,也许您应该为非必需字段设置一个... IfEmpty-option。

是可用的ifEmpty-options。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM