-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix for increment ids #1010
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
Fix for increment ids #1010
Conversation
Travis is throwing some errors. If you have a required dependency that should be injected in the constructor using the DI framework so it's always set. |
@@ -51,8 +66,13 @@ public function getCurrentValue() | |||
*/ | |||
public function getNextValue($storeId) | |||
{ | |||
if(empty($this->entityType)){ | |||
throw new \Magento\Framework\Model\Exception( | |||
__('EntityType is empty') |
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.
As @airbone42 pointed out, if you want this to be a required argument then it should be injected in the constructor instead of by the setEntityType
method.
public function __construct(
EavConfig $eavConfig,
$entityType = Order::ENTITY
) {
$this->eavConfig = $eavConfig;
$this->entityType = $entityType;
}
Please also look at the failing tests and add new test cases for injecting non-default entity types.
@WJdeBaas, did you have a chance to look at previous comments? |
Hi vpelipenko, My apologies, but it's getting a bit confusing, it's not quite clear to me what is expected from me at this point about this bug and what its status exactly is. ps: what does the CS label stands for ? |
@WJdeBaas, your fix is OK, but it leads to failed unit tests on Travis. It will be good if you fix them. CS label is used for our internal staff, it helps us to assign responsibilities. |
Internal ticket: MAGETWO-34653 |
Hi vpelipenko, What do I have to do to make it acceptable for Travis ? |
@WJdeBaas, you've changed logic inside Magento\Sales\Model\Increment::getNextValue(). It throws exception when $this->entityType is empty. Also we have unit test dev/tests/unit/testsuite/Magento/Sales/Model/IncrementTest for testing this method. It fails now when calls original method, because $this->entityType is always empty there - look at log here https://travis-ci.org/magento/magento2/jobs/48911881. If you are familiar with unit tests you can fix failed tests, if no, we can fix them on our side. |
@WJdeBaas, please inform us about your decision on unit tests. Do you have plans to fix it and update this PR? |
There is no response from contributor. Closed. It will be fixed internally. |
[Dragons][Performance] Bump in stock SQL queries
MSI-722: Implement IsCorrectQtyConditionTest::testExecuteWithUseConfigMaxSaleQty
A patch to fix the hardcoded entity type in app/code/Magento/Sales/Model/Increment.php