This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

reg6682
reg6682

Hello, I've extended my user model more or less according to screencast. I've added a few fileds, everything works in backend, in frontend, it loads the fields but I'm not able to save them in profile form (I use my own copy of original form where I added some validation, basicly copy&paste of the rainlab plugin).

    UserModel::extend(function($model) {
        $model->addFillable('... list of extra fileds ...');
    });

Am I missing something?

gergo85
gergo85

I have a same plugin: https://github.com/gergo85/oc-user-plus

Look at the source code of this plugin or watch this video: https://vimeo.com/108040919

Last updated

reg6682
reg6682

As I stated, I watched the video, it works for me in backend as it should, problem is in frontend. When I call onUpdate (copy in my plugin), it runs validation as it should but

    $data = post();
    // validation
    $user->save($data);

simply wont save anything without any visible error. I opened updated version of User plugin now on git to see they use fill method first now, but it shouldnt matter, I took code from the up to date version on my machine.

Last updated

KurtJensen
reg6682
reg6682

Thx a lot, the fill method is needed after all.

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.