webERP Forum
Issues With Lists Using foreach($Result as $MyRow) - Printable Version

+- webERP Forum (http://www.weberp.org/forum)
+-- Forum: webERP Discussion (/forumdisplay.php?fid=1)
+--- Forum: Problems / Bugs? (/forumdisplay.php?fid=8)
+--- Thread: Issues With Lists Using foreach($Result as $MyRow) (/showthread.php?tid=3320)



Issues With Lists Using foreach($Result as $MyRow) - VortecCPI - 04-07-2017 01:46 AM

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!


RE: Issues With Lists Using foreach($Result as $MyRow) - dalescott - 04-07-2017 01:59 AM

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


RE: Issues With Lists Using foreach($Result as $MyRow) - VortecCPI - 04-07-2017 02:11 AM

The symptom is an empty list found in the pages listed above; no SQL errors.

Before: [attachment=516]

After: [attachment=517]


RE: Issues With Lists Using foreach($Result as $MyRow) - TurboPT - 04-07-2017 04:02 AM

The entry in WWW_Users.php has already been changed in SVN, after the release of 4.13.1.


RE: Issues With Lists Using foreach($Result as $MyRow) - VortecCPI - 04-07-2017 04:39 AM

(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!


RE: Issues With Lists Using foreach($Result as $MyRow) - falkoner - 04-07-2017 07:26 AM

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


RE: Issues With Lists Using foreach($Result as $MyRow) - VortecCPI - 04-07-2017 07:53 AM

(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!


RE: Issues With Lists Using foreach($Result as $MyRow) - falkoner - 04-07-2017 11:07 PM

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


RE: Issues With Lists Using foreach($Result as $MyRow) - VortecCPI - 04-08-2017 02:36 AM

(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.