I just installed the latest dev (great module btw!) and have been having some issues with the stock report. The issue is basically that the page loads forever (I have pretty high php limits on my dev box). Even after minutes of waiting it never completes. I guess that there's some calculation or aggregation that's ineffective or so.

The site that I'm working on is not a clean install, it's a Drupal Commerce site that has been running for over three years and has processed around 10.000 orders and it has around 5.500 products in it.

Oh, and were running Commerce Stock 7.x-2.0.

I don't know if it's related but the log is showing a lot of:
Warning: Cannot use a scalar value as an array i drupal_render()
and
Warning: Invalid argument supplied for foreach() i element_children()
from the stock report page.

Update:
The report rendered after around 20 minutes so it seems that the performance need some tuning.

Comments

adamgerthel’s picture

Issue summary: View changes
adamgerthel’s picture

Issue summary: View changes

Update: It loaded after around 20 min!

lsolesen’s picture

Same thing happens for me on discimport.dk.

dpico’s picture

Same thing here. I'm testing it on a site that has been running for one week, less than 2000 products. The stock report runs out of time before completing.

mglaman’s picture

Priority: Normal » Major

Ok, so I think the issue is the overall architecture of the Stock module. All that was done was a revision of existing code. I think measures need to be taken to store the data in its own table - like the tax module does. Whenever stock gets adjusted the table will update itself as well.

guile2912’s picture

I confirm, takes ages if it does not go time out.
It also fills up my watdog ( this may explain that )
I finnaly managed to fix the problem, and the view is fast , but also works \o/
Give a try to this patch so we can commit it.

Thank you

guile2912’s picture

Status: Active » Needs review
guile2912’s picture

mglaman’s picture

Thanks for patch! Let me review it later, not the fix I'd ultimately want to do for (#5) but definitely want to commit some kind of fix. If users having issues could test patch, too, that'd be great.

zeezhao’s picture

Thanks. Works for me.

  • mglaman committed 5d913ae on 7.x-4.x authored by guile2912
    Issue #2395541 by guile2912: Stock report loading forever
    
mglaman’s picture

Component: Code » Stock Reports
Status: Needs review » Fixed

Thanks everyone! Especially guile2912 for the patch. Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

caco13’s picture

I updated Commerce Reporting to dev version. But The Stock tab continues to wait by server until the 30 seconds expire. Do the patch commited still take a time to get the results from server and I have to extend the maximum script time in server?