Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
609dccc
commit 13cbfac
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13cbfac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This commit introduced a bug.
Cast to bool is wrong, because this option has possible integer values. Previous version was ok.
Later in the AbstractProxyFactory::getProxyDefinition we have
switch ($this->autoGenerate) {
where we compare this value to integer constants.
In case of setting autoGenerate to true, the case is
self::AUTOGENERATE_FILE_NOT_EXISTS
but it should be
self::AUTOGENERATE_ALWAYS
If you set in configuration:
$config->setAutoGenerateProxyClasses(true);
proxy classes should be always generated, but because of that bug, they are generated only if proxy class file does not exist. If you later change entity class code, proxy class remains unchanged.
13cbfac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@more7dev can you put this description into a test case?
13cbfac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that
$config->setAutoGenerateProxyClasses($mode);
does not work as described in the documentation.
Reverting this commit will fix the problem.
I`m not sure, what test case you have in mind.
13cbfac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test case should assert that the various
self::AUTOGENERATE_*
flags are correctly set after__construct
13cbfac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact that we didn't have these tests in place is indeed why we got the regression in first place. A test case would:
13cbfac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
13cbfac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
13cbfac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
13cbfac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Submitted PR #816 for this