pERP sales orders/AJAX select widget - urgent bug query

classic Classic list List threaded Threaded
6 messages Options
WLD WLD
Reply | Threaded
Open this post in threaded view
|

pERP sales orders/AJAX select widget - urgent bug query


Although I spout the benefits of virtualisation often, it has this evening lead me in to trouble.  A bug has been introduced in to a working copy of a setup and I cannot understand how something that was working has managed to become broken, or even when it has become broken.

It's in the pERP sales order screen when adding a line item to a new order, the AJAX select box shows the results when searching for a stock code, but doesn't allow me to select a line.  When I click on a result, the result box simply disappears, and the line isn't pre-filled.

>From preliminary investigation I believe that the AJAX search widget javascript file has been replaced with an older version that didn't support multiple keys being returned.  In the etemplate, the widget is requesting the ID's stock_id;price_list_id from perp_orders.bo_perp_price.get_merged_price_list.  If I change it to request just one of the ID's, it works fine.  The javascript process works fine and the line is pre-filled (although with a missing field).

When using the latest /etemplate/inc/class.ajax_select_widget.inc.php from the trunk it *does* work when requesting *both* ID's.  When using the version in my VM as it stands it doesn't work when requesting *both* ID's.

The possibilities are that I have inadvertently replaced this javascript file with an old version which doesn't work with multiple IDs; or there is some other bug or misconfiguration going on here.  At what point was the AJAX selection widget modified to allow multiple ID's to be returned?  This may help me identify if I have copied any old files in to my setup by mistake.

Alternatively do you have any other theories on why the add line AJAX widget isn't allowing me to choose a stock item which is in a valid price list for the client?

I have compared my perp_orders.sales_order_edit etemplate with the version on the pERP demo site and it's identical.  The only thing that seems to have changed is the javascript file version seems out of step with the  rest of the eGW API 1.7.003 or I have a simple config error.

Kindest thanks in anticipation of suggestions,
Paul

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Perp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/perp-developers
Nathan Gray Nathan Gray
Reply | Threaded
Open this post in threaded view
|

Re: pERP sales orders/AJAX select widget - urgent bug query

On Mon, Feb 22, 2010 at 8:47 PM, WLD <[hidden email]> wrote:

> It's in the pERP sales order screen when adding a line item to a new order, the AJAX select box shows the results when searching for a stock code, but doesn't allow me to select a line.  When I click on a result, the result box simply disappears, and the line isn't pre-filled.

This sounds like a problem with perp_orders, rather than the AJAX
widget, because you do get results. The multi-key should be handled
all on the PHP side, and just returned and passed on.  This indicates
the problem lies somewhere from the action handler forward.  When you
select a result from the list, it should call the js function
select_item().

>...At what point was the AJAX selection widget modified to allow multiple ID's to be returned?  This may help me identify if I have copied any old files in to my setup by mistake.

Mon Sep 21 18:34:14 2009 UTC (5 months ago)
http://svn.stylite.de/viewvc/egroupware?view=rev&revision=27890
No javascript changes for that though.

You may be experiencing problems with a recent commit that helped the
AJAX widget work around IE 8.
Mon Feb 15 20:40:34 2010 UTC (7 days, 8 hours ago)
http://svn.stylite.de/viewvc/egroupware?view=rev&revision=29242


Nathan

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Perp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/perp-developers
WLD WLD
Reply | Threaded
Open this post in threaded view
|

Re: pERP sales orders/AJAX select widget - urgent bug query


Hi Nathan,

Thanks for the speedy reply

> This sounds like a problem with perp_orders, rather than the AJAX
> widget, because you do get results. The multi-key should be handled
> all on the PHP side, and just returned and passed on.  This indicates
> the problem lies somewhere from the action handler forward.  When you
> select a result from the list, it should call the js function
> select_item().

select_item() is never called when requesting multiple ID's, I did put some checks in to see what was going on.  If I change the etemplate to request only 1 ID, select_item() is called.  If I change it back to both ID's, then the function is never called and the results list simply disappears off the screen as if I clicked away from it.  All the other select widgets on the page work perfectly fine, it's just this one.


> Mon Sep 21 18:34:14 2009 UTC (5 months ago)
> http://svn.stylite.de/viewvc/egroupware?view=rev&revision=27890
> No javascript changes for that though.
> You may be experiencing problems with a recent commit that helped the
> AJAX widget work around IE 8.
> Mon Feb 15 20:40:34 2010 UTC (7 days, 8 hours ago)
> http://svn.stylite.de/viewvc/egroupware?view=rev&revision=29242

I have tested this on Linux and Windows platforms with various browsers, including Konqueror, Firefox and IE.  They all perform identically as I have described above.  The other select widgets on the same page operate fine with all the browsers I tested.

As it's finding and displaying the correct results, I don't think it's a problem with perp_order, I just can't select one in the JS.  Upon further investigation I have alert()'ed the incoming results to screen.  In the instances where the select widget *doesn't* work, no key field is being returned from the AJAX request, and the JS code in the widget simply adds the row HTML to the result list.

Please see http://www.egroupware.org/viewvc/egroupware/trunk/etemplate/js/ajax_select.js?annotate=29242 and find line 356.  This if() fails in my current setup when returning multiple ID's - such as stock codes to add as a line item.

If I hardcode   key = 1;  before the if() then the select widget operates normally.  Albeit with the incorrect data.

I am convinced it has something to do with the returning of multiple ID's because requesting single ID's works perfectly, it just doesn't like 2 at a time.  It used to :S

I'm going to reinstall a fresh eGW API and see if that cures it.

Do you kindly have any more thoughts on what might be occuring?

Many thanks,
Paul

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Perp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/perp-developers
Nathan Gray Nathan Gray
Reply | Threaded
Open this post in threaded view
|

Re: pERP sales orders/AJAX select widget - urgent bug query

On Tue, Feb 23, 2010 at 1:25 AM, WLD <[hidden email]> wrote:
>...
> I have tested this on Linux and Windows platforms with various browsers, including Konqueror, Firefox and IE.

Got Firebug?  If not, you probably want it.  Use the console tab to
capture the request and return of the AJAX request that fails, I'd
like to see it please.  (Or use your preferred method)

> ..., no key field is being returned from the AJAX request

> I'm going to reinstall a fresh eGW API and see if that cures it.
>
> Do you kindly have any more thoughts on what might be occuring?

Sorry, not without seeing the response.

Nathan

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Perp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/perp-developers
Nathan Gray Nathan Gray
Reply | Threaded
Open this post in threaded view
|

Re: pERP sales orders/AJAX select widget - urgent bug query

> On Tue, Feb 23, 2010 at 1:25 AM, WLD <[hidden email]> wrote:

>> ..., no key field is being returned from the AJAX request
>
>> I'm going to reinstall a fresh eGW API and see if that cures it.

Any success?  Or more info?

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Perp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/perp-developers
WLD WLD
Reply | Threaded
Open this post in threaded view
|

Re: pERP sales orders/AJAX select widget - urgent bug query


Hi Nathan,

I have found the fix for this.  Well actually no I haven't found the fix because I've not taken the time yet to find exactly what's wrong.  It's not JS related, of this I'm certain (being highly skilled in JS, AJAX and, more correctly, Hijax).  I don't know why the issue has occurred, why it changed, or anything other than how to get it working again.

I simply copied this file from the trunk to my staging version and it worked fine again: etemplate/inc/class.ajax_select_widget.inc.php

I know the issue is related to the returning of multiple;ids

Somehow a previous version of this file, before this support was introduced (or after it was introduced but before it was working properly) got in to my system and caused the error.  The version from the trunk works fine.

I've not yet had a chance to do any investigatory work as to exactly what's going on, how it happened etc.  I don't know if I will get that chance.  The important thing is the issue is fixed and I will be making sure that all my files are the versions I expected.

I very much dislike it when things that were working stop working for an unknown reason.

Cheers,
Paul


On Wednesday 24 Feb 2010 19:45:46 Nathan Gray wrote:
> > On Tue, Feb 23, 2010 at 1:25 AM, WLD <[hidden email]> wrote:
>
> >> ..., no key field is being returned from the AJAX request
> >
> >> I'm going to reinstall a fresh eGW API and see if that cures it.
>
> Any success?  Or more info?
>

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Perp-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/perp-developers