# warning: Invalid argument supplied for foreach() in E:\xampp\htdocs\sitename\sites\all\modules\report\report.module on line 259.
# warning: Invalid argument supplied for foreach() in E:\xampp\htdocs\sitename\sites\all\modules\report\modules\report_content\report_content.module on line 215.
# warning: Invalid argument supplied for foreach() in E:\xampp\htdocs\sitename\sites\all\modules\report\modules\report_content\report_content.module on line 237.
# warning: array_reverse() [function.array-reverse]: The argument should be an array in E:\xampp\htdocs\sitename\sites\all\modules\report\modules\report_content\report_content.module on line 240.

CommentFileSizeAuthor
#12 report-6x1-beta2.diff2.37 KBnickl

Comments

ki’s picture

Assigned: Unassigned » ki
Status: Active » Needs review

Can you insert and test the following code at the first line (line 255) of report_flatten_period() in report.module?


if (empty($rows)) return array();

ashiwebi’s picture

It resolved one problem but rest of the warnings are still their.

# warning: Invalid argument supplied for foreach() in E:\xampp\htdocs\prod23nov\sites\all\modules\report\modules\report_content\report_content.module on line 237.
# warning: array_reverse() [function.array-reverse]: The argument should be an array in E:\xampp\htdocs\prod23nov\sites\all\modules\report\modules\report_content\report_content.module on line 240.

NeoID’s picture

Same thing here.. :/

RemingtonPHP’s picture

Im also facing the same problem...

ryanbfs’s picture

seems it can be added to line 236 in report_user.module to stop the warnings on the user tab but now it's writing array as the only output (theme etc still there). going to try and dig into where these var's are getting their data etc when I get a sec, any help from the designer could save me some time. Very nice module BTW was looking for something just like this & may wind up tweaking it for external DB project, I'll send you any work I do. :-). Summary data is showing users, but nada under user tab.

liliplanet’s picture

subscribe, thx ..

ki’s picture

* Addressed the issues and pushed to beta1.

ki’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

Dublin Drupaller’s picture

great module. thanks for contributing this. just flagging that I'm getting the same errors mentioned before on beta and dev versions.

 * Warning: Invalid argument supplied for foreach() in report_flatten_period() (line 264 of \sites\all\modules\report\report.module).
    * Warning: Invalid argument supplied for foreach() in report_user_page() (line 222 of \sites\all\modules\report\modules\report_user\report_user.module).
    * Warning: Invalid argument supplied for foreach() in report_user_page() (line 244 of \sites\all\modules\report\modules\report_user\report_user.module).
    * Warning: array_reverse() [<a href='function.array-reverse'>function.array-reverse</a>]: The argument should be an array in report_user_page() (line 247 ofsites\all\modules\report\modules\report_user\report_user.module).
webma’s picture

same problem on my end ver report-6.x-1.0-beta2

nickl’s picture

Version: 6.x-1.0-alpha2 » 6.x-1.0-beta2
Assigned: ki » Unassigned
Status: Closed (fixed) » Needs review
StatusFileSize
new2.37 KB

Patch rolled against beta 2, initializing arrays to prevent errors in the event there is no data available.

ki’s picture

Status: Needs review » Fixed

Applied nickl's patch and released the module.

Thanks nickl.

Ki

Status: Fixed » Closed (fixed)

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