2017-05-10 17 views
0

私はカスタムフィールドでfeuserを拡張します。すべてがうまくいく。私が整数値を入力すると、それは良い保存でした。しかし、文字列の値を入力するとエラーになる - 1332933658: ""は整数ではありません。これは以下のスクリーンショットで見ることができます。feuser編集でエラー:整数ではありません

enter image description here

enter image description here

ext_tables.php

# 
# Table structure for table 'fe_users' 
# 
CREATE TABLE fe_users (
     aboutmyself varchar(255) DEFAULT '' NOT NULL, 
    aboutmypartner varchar(255) DEFAULT '' NOT NULL, 
    tx_extbase_type varchar(255) DEFAULT '0' NOT NULL, 
); 

モデル:

<?php 
namespace Fhk\Feusersplus\Domain\Model; 

/*************************************************************** 
* 
* Copyright notice 
* 
* (c) 2017 
* 
* All rights reserved 
* 
* This script is part of the TYPO3 project. The TYPO3 project is 
* free software; you can redistribute it and/or modify 
* it under the terms of the GNU General Public License as published by 
* the Free Software Foundation; either version 3 of the License, or 
* (at your option) any later version. 
* 
* The GNU General Public License can be found at 
* http://www.gnu.org/copyleft/gpl.html. 
* 
* This script is distributed in the hope that it will be useful, 
* but WITHOUT ANY WARRANTY; without even the implied warranty of 
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
* GNU General Public License for more details. 
* 
* This copyright notice MUST APPEAR in all copies of the script! 
***************************************************************/ 

/** 
* User 
*/ 
class User extends \In2code\Femanager\Domain\Model\User 
{ 

    /** 
    * aboutmyself 
    * 
    * @var int 
    */ 
    protected $aboutmyself = ''; 

    /** 
    * aboutmypartner 
    * 
    * @var int 
    */ 
    protected $aboutmypartner = ''; 


    /** 
    * Returns the aboutmyself 
    * 
    * @return int $aboutmyself 
    */ 
    public function getAboutmyself() 
    { 
     return (string)$this->aboutmyself; 
    } 

    /** 
    * Returns the aboutmypartner 
    * 
    * @return int $aboutmypartner 
    */ 
    public function getAboutmypartner() 
    { 
     return (string)$this->aboutmypartner; 
    } 



    /** 
    * Sets the aboutmyself 
    * 
    * @return void 
    */ 
    public function setAboutmyself($aboutmyself) 
    { 
     $this->aboutmyself = (string)$aboutmyself; 
    } 

    /** 
    * Sets the aboutmypartner 
    * 
    * @return void 
    */ 
    public function setAboutmypartner($aboutmypartner) 
    { 
     $this->aboutmypartner = (string)$aboutmypartner; 
    } 







    /** 
    * __construct 
    */ 
    public function __construct() 
    { 
     //Do not remove the next line: It would break the functionality 
     $this->initStorageObjects(); 
    } 

    /** 
    * Initializes all ObjectStorage properties 
    * Do not modify this method! 
    * It will be rewritten on each save in the extension builder 
    * You may modify the constructor of this class instead 
    * 
    * @return void 
    */ 
    protected function initStorageObjects() 
    { 

    } 


} 
+0

追加したdbフィールドの種類は何ですか?あなたはfeuserを拡張するために何をしたかを説明するためにいくつかのコードを追加できますか?テーブルの – mrwienh

+0

ext_tables.php # #表構造 'をfe_users' # 表fe_usersをCREATE( VARCHAR aboutmyself(255)DEFAULT '' NOT NULL、 \t aboutmypartnerのVARCHAR(255)DEFAULT '' NOT NULLで、 \t tx_extbase_type varchar(255)DEFAULT '0' NOT NULL、 ); – Mikael

答えて

1

あなたのフィールドの型ヒントはaboutmyselfとaboutmypartnerは

のように定義されます
@var int 

しかし、あなたはVARCHARを保存します。

@var string 

にヒントを変更してみてください(また、typo3tempフォルダを空にすることは傷つけることはできない)すべてのキャッシュをクリアします。

関連する問題