3

i have upgrade magento 2.3.3 to 2.4.4, all other things are working fine, i have also check credit memo created successfully, but credit memo grid gives "The store that was requested wasn't found. Verify the store and try again." error,please check the attached screenshot.

https://i.stack.imgur.com/vbI5M.png

i have also check in Magento\Store\Model\StoreRepository class get() method get store id=0

public function get($code)
    {
        if (isset($this->entities[$code])) {
            return $this->entities[$code];
        }
        
        $storeData = $this->getAppConfig()->get('scopes', "stores/$code", []);
        /* we have set static store id = 1 after check it's open code start */
        //$storeData = array('store_id'=> 1, 'code'=> 'admin', 'website_id'=>0, 'group_id'=>0,'name'=>'admin','sort_order'=>0, 'is_active'=>1);
       /* code end */
        $store = $this->storeFactory->create([
            'data' => $storeData
        ]);

        if ($store->getId() === null) {
            throw new NoSuchEntityException(
                __("The store that was requested wasn't found. Verify the store and try again.")
            );
        }
        $this->entities[$code] = $store;
       
        $this->entitiesById[$store->getId()] = $store;
        return $store;
    }

I have upgrade same site different different lower to upper version upgrade,magento2.4.2 it's working,when i upgrade in magento 2.4.3 same error getting.

1
  • check for table sales_creditmemo, sales_order and sales_creditmemo_grid, I upgraded to 2.4.3 and had same error, for me the issue was at some point the my website had multiple store and had orders from different store, the stores were deleted but the store_id were only updated in sales_order and sales_creditmemo, where sales_creditmemo_grid still had the deleted store_id's So updating sales_creditmemo_grid to have store_id NULL where the store_ids were old, worked for me Also headup, I did confirmed that all order with old stores were having closed status and store_id was null
    – Ekta Puri
    Aug 5, 2022 at 4:53

1 Answer 1

0

Comment these line

if ($store->getId() === null) {
        throw new NoSuchEntityException(
            __("The store that was requested wasn't found. Verify the store and try again.")
        );
    }

it's work for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.