Bug 4867

Summary: cannot clone subfields in marc editor, other clone/unclone weirdness
Product: Koha Reporter: Cindy Murdock Ames <cmurdock>
Component: CatalogingAssignee: Chris Nighswonger <cnighswonger>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: major    
Priority: PATCH-Sent (DO NOT USE) CC: brendan, chris, cnighswonger, herrkandera, koha.sekjal, nengard, oleonard
Version: rel_3_2Keywords: regression
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Proposed patch

Description Cindy Murdock Ames 2010-06-09 17:04:08 UTC
Clicking the plus sign next to a repeatable subfield no longer clones the subfield.  Also, clicking the minus sign will not remove the subfield initially, but if you click the plus sign, then click the minus sign, it will.  Owen & wizzyrea were able to confirm the first half of that, at least.  The plus & minus functions worked as recently as 3.01.00.061.

There are a few changes to addbiblio.tmpl since 1/2010 that might be related.
Comment 1 Cindy Murdock Ames 2010-06-09 20:24:41 UTC
When I tried it in Chrome in developer mode, I got this error:

Uncaught TypeError: Cannot call method 'getAttribute' of undefined 

Owen said he gets a javascript error:  "link is undefined"
Comment 2 Cindy Murdock Ames 2010-06-10 15:36:14 UTC
Owen's patch for bug 4868 fixes this.
Comment 3 Cindy Murdock Ames 2010-06-11 13:53:59 UTC
On further testing, the patch for 4868, makes it better, but there's still some odd behavior.  You can clone the subfield, but sometimes after clicking delete it won't let you clone the subfield again. Also the delete won't always delete the subfield; it only seems to work once for me, so if you clone the subfield twice, and then try to delete them, it will only delete one but not both.
Comment 4 Fridolin Somers 2010-07-19 10:09:29 UTC
Created attachment 2389 [details] [review]
Proposed patch

add existence test on link after subfield
Comment 5 Chris Nighswonger 2010-09-14 14:38:24 UTC
When the clone/unclone plus/minus were replaced with images the <span> tags were inadvertantly deleted causing the js to loose its ability to identify the clone/unclone links and properly udpate the indexes.

The resulting incorrect indexes caused various weirdnesses to result when one attempted to clone/unclone subfields.

The solution is to add classes to the two links and update the js to identify the links based on class.

Thanks to Owen for his help in chasing this down.

The patch is available here:

http://git.koha-community.org/gitweb/?p=wip/koha-fbc.git;a=shortlog;h=refs/heads/k_bug_4867

Be sure to pick up the associated tidy patch before it as well.
Comment 6 Stefan 2010-10-16 16:55:21 UTC
The supplied patch: 

http://git.koha-community.org/gitweb/?p=wip/koha-fbc.git;a=blob;f=koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl;h=084823a4544cf5fd71172757ad16dc7a957a0160;hb=0e3eb47132d61372b993dfe4e9a0b5267a32edb4

does not work for IE 7. When clicking on clone-subfield.png or delete-subfield.png the MARC editor site jumps to the bottom, but fields don't collapse/uncollapse.
Comment 7 Chris Nighswonger 2010-10-16 19:52:05 UTC
Changing status back to assigned
Comment 8 Chris Nighswonger 2010-10-16 20:18:35 UTC
(In reply to comment #6)
> The supplied patch: 
> 
> http://git.koha-community.org/gitweb/?p=wip/koha-fbc.git;a=blob;f=koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl;h=084823a4544cf5fd71172757ad16dc7a957a0160;hb=0e3eb47132d61372b993dfe4e9a0b5267a32edb4
> 
> does not work for IE 7. When clicking on clone-subfield.png or
> delete-subfield.png the MARC editor site jumps to the bottom, but fields don't
> collapse/uncollapse.

Testing in IE 7.0.5730.13 shows that deleting subfields works as expected, but cloning subfields does not.

This is probably due to some quark with IE.

Since we basically state that FF is the browser supported in the staff client, I'm not sure how much of a priority this will be. However, I'm adding Owen to the cc list in case the fix is something obvious.
Comment 9 Chris Cormack 2010-12-13 03:28:29 UTC
This is already in master