webERP Forum

Full Version: Issues With Lists Using foreach($Result as $MyRow)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I thought this may be helpful to others who may have encountered issues with a few pages that show empty lists in 4.13.1.

I had to replace "foreach($Result as $MyRow)" with "while ($MyRow = DB_fetch_array($Result))" in the following files:

+ GLAccounts.php
+ GLCashFlowsIndirect.php
+ GLCashFlowsSetup.php
+ WWW_Users.php

For reference I am using the following:

+ ClearOS Community 6.8.0
+ webERP 4.13.1
+ MySQL 5.1.73
+ PHP 5.3.3

Outstanding work, by the way!
I'm just a user, what were the symptoms? SQL errors rendered in WebERP? What did you do that resulted in the symptoms? I grabbed a screenshot with SQL errors recently when working through the contracts process, but I haven't had a chance to revisit.

Also, and I don't mean any disrespect, but why not include a patch? Was it the project's fault for not explaining how? Waiting to see if someone asks for a patch? Just curious...
And really, I am not trying to call anyone out, I'm just curious because community feedback is how a project gets better. Also, if anyone PMs me I'll post an anonymized group summary.
Forgot PM is disabled. dale@dalescott.net
The symptom is an empty list found in the pages listed above; no SQL errors.

Before: [attachment=516]

After: [attachment=517]
The entry in WWW_Users.php has already been changed in SVN, after the release of 4.13.1.
(04-07-2017, 04:02 AM)TurboPT Wrote: [ -> ]The entry in WWW_Users.php has already been changed in SVN, after the release of 4.13.1.

Ah... Thank you!
In the two cash flows scripts there are also places where you need reset the result set to the first record using the DB_data_seek() function, as the same result set gets reused, but the while loop just takes off where the previous one left off.

Tim
(04-07-2017, 07:26 AM)falkoner Wrote: [ -> ]In the two cash flows scripts there are also places where you need reset the result set to the first record using the DB_data_seek() function, as the same result set gets reused, but the while loop just takes off where the previous one left off.

Tim

Thank you Tim!
I would suggest you create a patch for this change and submit it to submissions@weberp.org

I should say this patch should be against the latest SVN code from Sourceforge.

Tim
(04-07-2017, 11:07 PM)falkoner Wrote: [ -> ]I would suggest you create a patch for this change and submit it to submissions@weberp.org

I should say this patch should be against the latest SVN code from Sourceforge.

Tim

While I have no issue with work related to doing this I think it is best left to the experts. Any changes should be adequately tested and verified for proper operation and I am not qualified for such work. While I am familiar with PHP and have been developing applications since 1983 I am NOT intimately familiar with webERP.

I would rather a qualified contributor/developer manage any changes to a released version of webERP.