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

\Magento\CatalogInventory\Model\Stock\Status->getStockId() to return correct value #5145

Merged
merged 2 commits into from
Sep 29, 2016

Conversation

fe-lix-
Copy link

@fe-lix- fe-lix- commented Jun 21, 2016

\Magento\CatalogInventory\Model\Stock\Status->getStockId() is returning the website id instead of the stock id.

@alena-marchenko
Copy link

Hi @fe-lix-

We've created MAGETWO-58941 internal ticket regarding this.
Thank you!

@mmansoor-magento mmansoor-magento merged commit 129b275 into magento:develop Sep 29, 2016
@Ctucker9233
Copy link

@alena-marchenko @mmansoorebay was this merge included in 2.1.2?

@flancer64
Copy link
Contributor

@alena-marchenko @mmansoorebay @Ctucker9233 This issue is still actual for composer based installation at least.

I suppose 84b456b70f2868d080f50610073746f5fbf5d455 is a revision:

alex@vm-ubuntu-mate-64:~/.composer/cache/files/magento/module-catalog-inventory$ ls -lh 
total 540K
-rw-rw-r-- 1 alex alex 180K dec 15 15:49 84b456b70f2868d080f50610073746f5fbf5d455.zip
...

This zip contains wrong version:

    public function getStockId()
    {
        return $this->getData(self::KEY_WEBSITE_ID);
    }

@flancer64
Copy link
Contributor

Magento-CE-2_1_3_tar_bz2-2016-12-13-09-10-13.tar.bz2 also contains wrong version of the "\Magento\CatalogInventory\Model\Stock\Status::getStockId"

@flancer64
Copy link
Contributor

@vkublytskyi, please take into attention this issue. @alena-marchenko @mmansoorebay have no activity on github in the last months.

@flancer64
Copy link
Contributor

@MomotenkoNatalia, please take a look at this issue.

@flancer64
Copy link
Contributor

Version 2.1.4 contains the same bug. Is it a feature?

@fe-lix-
Copy link
Author

fe-lix- commented Feb 8, 2017

The ticket MAGETWO-58941 is closed and looks like that this fix is targeted for version 2.2.0.

@flancer64
Copy link
Contributor

Good news, @fe-lix- ! Thanks. I feared that this fix is targeted for M3.

@Ctucker9233
Copy link

@fe-lix- Do you have commit numbers handy for those who can't wait for 2.2. ?

@fe-lix-
Copy link
Author

fe-lix- commented Feb 19, 2017

@Ctucker9233 it's in the branch develop, here is the commit of the merge :

a1a3c72#diff-e642aff4a57735e359f4d8de80b3996e

@flancer64
Copy link
Contributor

Commit a1a3c72 was on Sep 26, 2016, the last changes for /app/code/Magento/CatalogInventory/Model/Stock/Status.php were on Jan 5, 2017. develop branch has a right code.

Version Magento 2.1.4 was appeared at Feb 7, 2017 and this version has the bug. Status.php file was changed 11 months ago (on Mar 17, 2016). Probably @okorshenko can explain this?

@okorshenko
Copy link
Contributor

@flancer64 the code from develop branch will be released in 2.2.0.
All releases 2.1.x go from branch 2.1
That is the reason why this fix is not included in 2.1.4

@flancer64
Copy link
Contributor

Thanks for the answer, @okorshenko. Does it mean that this fix will never be included in 2.1.x releases?

@okorshenko
Copy link
Contributor

@flancer64 I will discuss this issue with our Product Owners to include it to some patch release.

@flancer64
Copy link
Contributor

Congrats, guys! It's fixed in 2.1.6.

@adragus-inviqa
Copy link
Contributor

adragus-inviqa commented Apr 12, 2017

Why congrats? This has been fixed almost a year ago. :/

@flancer64
Copy link
Contributor

@adragus-inviqa , why congrats? Try to download "Magento-CE-2.1.5", for example, from https://magento.com/tech-resources/download ("Release Archive" tab), extract it and open file vendor/magento/module-catalog-inventory/Model/Stock/Status.php. Find method getStockId() and look inside:

    public function getStockId()
    {
        return $this->getData(self::KEY_WEBSITE_ID);
    }

Do the same with version 2.1.6 and you will see:

    public function getStockId()
    {
        return $this->getData(self::KEY_STOCK_ID);
    }

So, congrats!

magento-engcom-team pushed a commit that referenced this pull request Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.