Skip to content
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

Calling initDefaults breaks data retrieving in develop branch #85

Open
janedbal opened this issue Apr 13, 2015 · 8 comments
Open

Calling initDefaults breaks data retrieving in develop branch #85

janedbal opened this issue Apr 13, 2015 · 8 comments
Assignees
Labels

Comments

@janedbal
Copy link

/**
 * @property null|string $firstname
 * @property string $surname
 */
class User extends LeanMapper\Entity {
    protected function initDefaults() {
        $this->firstname = NULL;
    }
}

////////

$user = new User([
    'firstname' => 'Vojtěch',
    'surname' => 'Kohout',
]);

echo $user->firstname; // returns NULL
echo $user->surname;

Tested on a9d83b5, master branch is ok.

@janedbal
Copy link
Author

Commit e4abdef caused this, any chance this will be reverted? Should I send PR?

@janedbal
Copy link
Author

@Tharos Develop branch is now merged in stable, did you miss this issue?

@Tharos
Copy link
Owner

Tharos commented Feb 15, 2016

Ou, I've missed this…

I'll fix it. But I will have to take a look at changes that broke code since I suppose they had some reason…

Thank you for your notice!

@castamir castamir added the Bug label Feb 15, 2016
@castamir castamir added this to the v3.0 milestone Feb 15, 2016
@castamir castamir self-assigned this Feb 17, 2016
@castamir
Copy link
Collaborator

@Tharos ping

@castamir castamir assigned Tharos and unassigned castamir Feb 29, 2016
@castamir castamir removed this from the v3.0 milestone Feb 29, 2016
@janedbal
Copy link
Author

janedbal commented Mar 8, 2016

@castamir So this behaviour has changed in 3.0 and will not be reverted in future releases of 3.x (but there should be big warning about this BC break in release notes) or did you release new stable with this bug intentionally? Anyway, this should be fixed at least in 2.x version.

@castamir
Copy link
Collaborator

castamir commented Mar 8, 2016

@janedbal I can revert that commit but without any guarantee, that it won't have any side effect.

I'm not sure if @Tharos will fix this or not, so at least I can revert that change and write a test for your case and then hope that something else won't break as @Tharos mentioned

@Tharos
Copy link
Owner

Tharos commented Mar 8, 2016

I keep in mind this issue.

I'm in the middle of leaving my job in Dáme Jídlo (see this post) and I'm really overloaded right now since I have to transfer all my responsibilities…

But after that, this issue is going to be one of the very first things I'll deal with. :)

@castamir castamir added this to the Version 3.1 milestone Mar 13, 2016
@castamir
Copy link
Collaborator

castamir commented May 9, 2016

ping @Tharos

@castamir castamir modified the milestones: Stable 3.2.0, Version 3.1 Jul 13, 2016
@janpecha janpecha removed this from the Version 3.2.0 milestone May 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants