Bug 7350

Summary: In New order the "+" button duplicates input text but not the "selected" in ddl
Product: Koha Reporter: Christophe Croullebois <christophe.croullebois>
Component: AcquisitionsAssignee: Christophe Croullebois <christophe.croullebois>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: normal    
Priority: P3 CC: duncan, m.de.rooy, paul.poulain
Version: 3.6   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Who signed the patch off: Text to go in the release notes:
Version(s) released in:
Attachments: new proposed patch
Signed off patch
to clone
ddl are not duplicated
to clone
2 clones plus changes
3 clones

Description Christophe Croullebois 2011-12-13 10:22:32 UTC
All in the title...
Due to CloneNode limitation in additem.js.
cloneNode() does not preserve select box selections...
I have made a little function that paste the selected in the clone.
Patch follows.
Thx for testing.
Comment 1 Christophe Croullebois 2011-12-13 10:36:05 UTC Comment hidden (obsolete)
Comment 2 Duncan 2011-12-13 21:33:32 UTC
Created attachment 6762 [details] [review]
Signed off patch
Comment 3 Marcel de Rooy 2012-01-11 12:27:48 UTC
This report misses information to test it well. You say "all is in the title" but that is not sufficient.
Please tell which + do you actually mean? Where?
Under which conditions (syspref values..) can it be tested? I suppose that value of AcqCreateItem for instance is relevant. 

In order to test a report, we should not grep Koha code in order to see where the javascript you change, is called, etc.

Setting status to Failed QA. Please include more information first. Thanks.
Comment 4 Christophe Croullebois 2012-01-15 13:49:05 UTC
Hello M. de Rooy,
sorry...
So I join you two snapshots.
Koha is moving so kickly, no more "+" but now we have "Add"...
So step by step :
1° You create a basket in acqui or you use an active one, no matter.
2° After you choose Add Order To Basket, new, from..., no matter.
3° You fill in "Item" block, all the Drop Down Lists, don't choose the first value.
4° You want a second item, so you clone it with "Add", and as you are lazy, you expect that all your choices will be kept... :o( Only the imput text are kept.
Regards
Comment 5 Christophe Croullebois 2012-01-15 13:51:31 UTC Comment hidden (obsolete)
Comment 6 Christophe Croullebois 2012-01-15 13:53:30 UTC
Created attachment 7161 [details]
ddl are not duplicated
Comment 7 Christophe Croullebois 2012-01-15 13:54:44 UTC
Created attachment 7162 [details]
to clone
Comment 8 Marcel de Rooy 2012-01-16 11:25:52 UTC
Thanks for clarifying.

Please note that your patch only is relevant when AcqCreateItem is set to "When ordering". (And some people may not exactly have your pref values ;)

When I haved added one item, your patch copies the values of the combo boxes in the new item. So that is OK.
But when I want to add another item by clicking the second Add button, nothing seems to happen? Could you verify please? Note that this may probably be not related to your code, but if we change this code and could resolve this too, that would be great..
Comment 9 Christophe Croullebois 2012-01-16 12:45:27 UTC
Hello M. de Rooy,
thx, oups, you'r right, we need "AcqCreateItem" to test...
For the second clone failure, I 'll see, I think too, even if it is not due to my patch it would be better to solve with it.
So I'll propose a new patch with the correction about this problem.
Comment 10 Christophe Croullebois 2012-01-28 16:01:28 UTC
Hello M. de Rooy,
I have tested as you said, but can't reproduce the bug.
I join two snapshots, for me it's ok, the third clone herits of its parent's content, and of course the link "add" is active for me.
I have no idea why it's not the same for you.
Another test ?
thx
Comment 11 Christophe Croullebois 2012-01-28 16:03:08 UTC
Created attachment 7375 [details]
2 clones plus changes
Comment 12 Christophe Croullebois 2012-01-28 16:03:50 UTC
Created attachment 7376 [details]
3 clones
Comment 13 Marcel de Rooy 2012-01-30 08:23:08 UTC
hmm..cannot reproduce it either? anymore (current master)?
Comment 14 Marcel de Rooy 2012-01-30 08:25:27 UTC
QA Comment: Code looks good. Marking as Passed QA. Relevance depends on value of AcqCreateItem.
Comment 15 Paul Poulain 2012-01-30 21:22:04 UTC
This patch has been pushed, I also tested with AcqCreateItem=recieve, it works well
Comment 16 Jared Camins-Esakov 2012-05-23 12:57:01 UTC
This fix was included in the 3.6.x branch prior to 3.6.4.