Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Special Order
02-24-2017, 03:53 AM,
#1
Special Order
When I try to delete a line item in SpecialOrder.php it takes me back to the customer and will not delete the item, I also tried this weberp.org/weberp the demo location and it has the same issues.
Any help would be greatly appreciated
Reply
02-24-2017, 01:27 PM, (This post was last modified: 02-24-2017, 01:47 PM by TurboPT.)
#2
RE: Special Order
I don't have enough system info to test this, Dave, but in script includes/DefineSpecialOrderClass.php, at line 49, try removing the & operator from function remove_from_order to see if it helps this matter. [or not]

I noted that there might be another [tangent] side affect not covered, but try by removing the & operator first.

The other "side affect" for others that might read this post: ... in the SpecialOrder class, note that function add_to_order increases the LinesOnOrder count, but remove_from_order does not decrease the LinesOnOrder count, but probably should after the unset statement to maintain the actual line count.
Reply
02-25-2017, 04:56 AM,
#3
RE: Special Order
(02-24-2017, 01:27 PM)TurboPT Wrote: I don't have enough system info to test this, Dave, but in script includes/DefineSpecialOrderClass.php, at line 49, try removing the & operator from function remove_from_order to see if it helps this matter. [or not]

I noted that there might be another [tangent] side affect not covered, but try by removing the & operator first.

The other "side affect" for others that might read this post: ... in the SpecialOrder class, note that function add_to_order increases the LinesOnOrder count, but remove_from_order does not decrease the LinesOnOrder count, but probably should after the unset statement to maintain the actual line count.
I have tried that and that had no affect the version I am using is 4.12.3 as I said before I have tried on the demo version on weberp.org and that has the same issue.
Thanks for all the help
Reply
02-25-2017, 05:32 AM, (This post was last modified: 02-25-2017, 05:33 AM by TurboPT.)
#4
RE: Special Order
Ok then, thanks for trying, I'll have to get some other information added so that I can dig into this more this at my end.

On a side note, I don't have access to the demo site code, so that likely won't matter to me.
Reply
02-25-2017, 02:03 PM, (This post was last modified: 02-25-2017, 02:25 PM by TurboPT.)
#5
RE: Special Order
Ok, so after looking into this further, it does not matter if the & operator is present, or not. The lines will still delete either way, with or without the operator. I'll likely remove it anyway since a simple line number value to be deleted does not need to be passed as a reference.

The other part about decreasing the LinesOnOrder was an initial assumption. (I did say 'probably should' in my first post to this thread)
I tried decreasing the lines during my testing, but doing so caused more issues, so I'll leave that alone. However, that being said, there are other ways to handle/manage the count without having to rely on bumping a variable, but this will take more thought.

After the 'Process This Order' button is clicked, the handling does NOT rely on the LinesOnOrder count, but processes over the LineItems array content instead. The LinesOnOrder is specifically used when adding lines to the order.

==========
The situation is that the identifier is not maintained with the delete link.

So, in file SpecialOrder.php, line 667 should be changed.

from this:
PHP Code:
<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Delete=' . $SPLLine->LineNo . '">' . _('Delete') . '</a></td

...to this:
PHP Code:
<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier=' . $identifier . '&Delete=' . $SPLLine->LineNo . '">' . _('Delete') . '</a></td

With that change, after clicking the 'Delete' link, the page does not 'jump' back out to the customer choice. Also, deleting line items are removed as expected.

I've attached the script with that change applied. Please check/try the script at your end (keep a backup of your current copy) to verify behavior before I commit to the repository.


Attached Files
.php   SpecialOrder.php (Size: 31.18 KB / Downloads: 0)
Reply
02-26-2017, 08:11 PM,
#6
RE: Special Order
Works for me Paul,

Tim
Reply
02-27-2017, 10:54 AM, (This post was last modified: 02-27-2017, 10:55 AM by TurboPT.)
#7
RE: Special Order
Thanks for checking, Tim. Do you also agree about removing the & operator from the remove_from_order function in file includes/DefineSpecialOrderClass.php ?

Locally, I do have that operator removed, and it appears to be fine removing the line items.
Reply
02-27-2017, 06:50 PM,
#8
RE: Special Order
Hi Paul, yes I agree that can be removed,

Thanks
Tim
Reply
02-28-2017, 06:09 AM,
#9
RE: Special Order
(02-25-2017, 02:03 PM)TurboPT Wrote: Ok, so after looking into this further, it does not matter if the & operator is present, or not. The lines will still delete either way, with or without the operator. I'll likely remove it anyway since a simple line number value to be deleted does not need to be passed as a reference.

The other part about decreasing the LinesOnOrder was an initial assumption. (I did say 'probably should' in my first post to this thread)
I tried decreasing the lines during my testing, but doing so caused more issues, so I'll leave that alone. However, that being said, there are other ways to handle/manage the count without having to rely on bumping a variable, but this will take more thought.

After the 'Process This Order' button is clicked, the handling does NOT rely on the LinesOnOrder count, but processes over the LineItems array content instead. The LinesOnOrder is specifically used when adding lines to the order.

==========
The situation is that the identifier is not maintained with the delete link.

So, in file SpecialOrder.php, line 667 should be changed.

from this:
PHP Code:
<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?Delete=' . $SPLLine->LineNo . '">' . _('Delete') . '</a></td

...to this:
PHP Code:
<td><a href="' . htmlspecialchars($_SERVER['PHP_SELF'],ENT_QUOTES,'UTF-8') . '?identifier=' . $identifier . '&Delete=' . $SPLLine->LineNo . '">' . _('Delete') . '</a></td

With that change, after clicking the 'Delete' link, the page does not 'jump' back out to the customer choice. Also, deleting line items are removed as expected.

I've attached the script with that change applied. Please check/try the script at your end (keep a backup of your current copy) to verify behavior before I commit to the repository.

Worked for me
Thanks
For all the help.
Reply
02-28-2017, 06:34 AM,
#10
RE: Special Order
For others that might cross this post, the changes mentioned above have been committed to SVN.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)