Norman
Norman

Reputation: 805

TYPO3: Multiple checkboxes for FE Manager

I've changed the purpose of the gender field for the fe_users, which comes with femanager.
The user is now allowed to select both items instead of just one. No worries, the user can select different options about his account, not multiple genders ;)

Saving in the backend works, but I can't get to run it in the frontend.

Error Message: No converter found which can be used to convert from array to string.

I just edited the model from femanager directly because it's the easiest way, for now.

ext/femanager/Classes/Domain/Model/User.php

class User extends FrontendUser
{
    /**
     * initializes this object
     *
     * @param array $gender
     */
    public function __construct($gender = array()) {
        $this->setGender($gender);
    }

    /**
     * gender
     *
     * @var string
     */
    protected $gender;

    /**
     * Returns the gender
     *
     * @return array $gender
     */
    public function getGender()
    {
        return unserialize($this->gender);
    }

    /**
     * Sets the gender
     *
     * @param array $gender
     * @return User
     */
    public function setGender(array $gender)
    {
        $this->gender = serialize($gender);
        return $this;
    }
}

Any ideas what's not working?

Upvotes: 0

Views: 486

Answers (1)

Be P. Ier
Be P. Ier

Reputation: 53

You define your variable $gender as string. It should be array instead.

Upvotes: 1

Related Questions