vuestorefront / mage2vuestorefront

Magento to Vue-storefront datapump - synchronizes Products, Categories and Product-to-category links between your Magento2 API and NoSQL database of vue-storefront

Home Page:http://vuestorefront.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Catalog Import Paging Issue

rain2o opened this issue · comments

I am running into an issue when trying to import the catalog from Magento 2. It appears to be on a never ending loop where it is trying to increment pages but stays on currentPage=1.

I noticed commit 2311960 which appeared to resolve the issue, but I have the updated source code locally and the issue still persists.

After some further debugging I noticed that context.page is actually null at the point it is being checked in adapters/abstract.js. For local testing I changed the condition here to the following:

if (context.page) { 
  context.page++
  this.page++;
} else {
  context.page = ++this.page;
}

So far this appears to have resolved the issue. I don't know if there is another root cause somewhere deeper and if this is just a band-aid fix, but I wanted to report my findings.

Thanks! It requires kind of refactoring; for sure :) this solution should be a valid one. There simply shouldn’t be this this.page/context.page separation. But for now it’s fine - could You please send it as a pull request?

Positive; this is correct solution. Please do a PR

Thanks for the confirmation @pkarw! I’ll submit a PR tomorrow morning.

Thanks! It was classical me: I’ve fixed one thing and broken another one haha :) thanks for Your help!

Ok, I've already fixed it :) Thanks for the solution!

Great, thanks for the fast response and implementation!