New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving user doesn't save `content` #1764

Closed
edalzell opened this Issue Feb 1, 2018 · 0 comments

Comments

Projects
None yet
3 participants
@edalzell

edalzell commented Feb 1, 2018

Expected behaviour

content is saved into the user.

Actual behaviour

content is not saved

Steps to reproduce

  1. Have a user fields with content field
  2. in an addon call `$user->data(['content' => 'foo', ... ]); $user->save();
  3. Note that content isn't saved.

Issue is here:

```    protected function toSavableArray()
    {
        return tap($this->data(), function (&$data) {
            if (Config::get('users.login_type') === 'email') {
                unset($data['email']);
            }

            $content = array_get($data, 'content');
            if ($content || $content == '') {
                unset($data['content']);
            }
            dd($data);
        });
    }

if ($content || $content == '') { seems to say if there is content, then remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment