Topic: Ajax Inquiry Fixes

@braathwaate has sent me a good pull request that needs to be incorporated into the core after checking if any critical extension breaks. The key file diffs are attached - includes/ui/ui_view.inc and js/insert.js.

@joe/@itronics: can do the needful.

Post's attachments

KeyFileDiffs.zip 1.3 kb, 7 downloads since 2018-03-08 

You don't have the permssions to download the attachments of this post.

Re: Ajax Inquiry Fixes

This has been fixed and committed. Thanks.

/Joe

Re: Ajax Inquiry Fixes

Thanks @joe.

There are a host of inquiry files that needs to be merged and tested as well.
Will get the diffs after testing.

In includes/ui/ui_view.inc, the newly added functions set_posts() and get_js_history() use the splat operator available in PHP 5.6+ for variable length argument lists.

Some workarounds are here.

We need to make it backwards compatible with the attached diff file.

Post's attachments

NonSplat_fix.diff 702 b, 6 downloads since 2018-03-08 

You don't have the permssions to download the attachments of this post.

Re: Ajax Inquiry Fixes

This entire commit should be made backwards compatible as in my previous post (or a comment added that it is for PHP v5.6+ only) as the current PHP versions that FA supports cannot handle the new constructs effectively. There are no $_GET variables available when the new set_posts() function is called in this way as the session.inc erases all $_GET values except for those coming in thru Ajax - js http requests. The set_posts() however acquires the ajaxed GET variables correctly.

The persistence of the history works on substitution of ...$vars with  $vars and changing to  get_js_history(array(......)). The ChangeVar of the combo boxes do not work even with the set_posts(array(......)) fix.

For those wishing to test it further, the attachment would be useful. It contains the BraathWaate files with the existing counterparts in the core and the altered ones to incorporate this commit into the inquiry files with the backwards compatibility fix for the new functions.

Post's attachments

BW_PHP56_splats.zip 72.9 kb, 2 downloads since 2018-03-09 

You don't have the permssions to download the attachments of this post.

Re: Ajax Inquiry Fixes

@braathwaate has now provided backwards compatibility (using the NonSplat_fix.diff in Post #3 here) where both get_js_history() and set_posts() work. As an example, after applying the fix above, the file sales/inquiry/sales_orders_view.php works for both Ajax as well as js history of the $_POST variables from the form.

Using the attachment, test by entering a transaction_number under "#" and then moving the cursor to the next field - the ajax will refresh the filtered page.

Some of the inquiry files will need to be synched with subsequent changes in the core.

Post's attachments

sales_orders_view.php1 10.3 kb, 1 downloads since 2018-03-09 

You don't have the permssions to download the attachments of this post.

6 (edited by apmuthu 03/10/2018 06:05:42 pm)

Re: Ajax Inquiry Fixes

Attached is the set of files and the diff for incorporation into the core after the last @braathwaate commit in FA and in his pull request that included backwards PHP compatibility. Kindly test and see what gives.

@joe: can check and commit.

Post's attachments

Ajax_Post_Retention.zip 65.5 kb, 2 downloads since 2018-03-10 

You don't have the permssions to download the attachments of this post.

Re: Ajax Inquiry Fixes

The former commit of this issue has been rolled back due to the unknown consequences needed by the backwards compatibility to the prior php 5.6 versions.

Janusz will give a short explanation to this.

/Joe.

Re: Ajax Inquiry Fixes

I too am uncertain of what would happen if such data is exposed in the URL and whether it can be used to hijack the session even though my last attachment works. This is so even if the backwards compatibility is not even there and for PHP 5.6+ itself.

Now that these fixes have been rolled back, those who still want this functionality of using the back button on the browser instead of the back link on the FA page and then returning to the page to where they left off, can partake of the consolidated fixes attached herein.

Await @itronics words of wisdom....

Post's attachments

Ajax_Post_Retention.zip 77.1 kb, 1 downloads since 2018-03-12 

You don't have the permssions to download the attachments of this post.