Skip to content

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

Closed
wants to merge 2 commits into from
Closed

Fix for increment ids #1010

wants to merge 2 commits into from

Conversation

WJdeBaas
Copy link
Contributor

A patch to fix the hardcoded entity type in app/code/Magento/Sales/Model/Increment.php

@airbone42
Copy link

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.

@WJdeBaas
Copy link
Contributor Author

Hi airbone42,

How about applying patch bac5bbd first, and then 0d29f9c ?
If that won't help, what should I do ?

@@ -51,8 +66,13 @@ public function getCurrentValue()
*/
public function getNextValue($storeId)
{
if(empty($this->entityType)){
throw new \Magento\Framework\Model\Exception(
__('EntityType is empty')
Copy link
Contributor

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.

@vpelipenko
Copy link
Contributor

@WJdeBaas, did you have a chance to look at previous comments?

@WJdeBaas
Copy link
Contributor Author

WJdeBaas commented Feb 4, 2015

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 ?

@vpelipenko
Copy link
Contributor

@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.

@vpelipenko
Copy link
Contributor

Internal ticket: MAGETWO-34653

@WJdeBaas
Copy link
Contributor Author

WJdeBaas commented Feb 6, 2015

Hi vpelipenko,

What do I have to do to make it acceptable for Travis ?

@vpelipenko
Copy link
Contributor

@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.

@vpelipenko
Copy link
Contributor

@WJdeBaas, please inform us about your decision on unit tests. Do you have plans to fix it and update this PR?

@vpelipenko vpelipenko added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Feb 18, 2015
@vpelipenko
Copy link
Contributor

There is no response from contributor. Closed. It will be fixed internally.

@vpelipenko vpelipenko closed this Mar 2, 2015
magento-team pushed a commit that referenced this pull request Apr 13, 2017
[Dragons][Performance] Bump in stock SQL queries
VitaliyBoyko pushed a commit to VitaliyBoyko/magento2 that referenced this pull request Jun 22, 2018
MSI-722: Implement IsCorrectQtyConditionTest::testExecuteWithUseConfigMaxSaleQty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Progress: reject
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants