Bug 28738 - Value builder marc21_linking_section.pl for creating 77x is broken
Summary: Value builder marc21_linking_section.pl for creating 77x is broken
Status: RESOLVED DUPLICATE of bug 28828
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: 20.05
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on: 22399
Blocks:
  Show dependency treegraph
 
Reported: 2021-07-22 14:46 UTC by Katrin Fischer
Modified: 2021-08-29 13:09 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2021-07-22 14:46:41 UTC
This is quite a neat plugin to create links between records that usually works on all 7xx. But in latest 20.11 (and possibly higher up as my research turned up no changes), this is broken.

To test:
* link marc21_linking_section.pl as value builder to 773 a or another 77x subfield.
* Make sure some of the important subfields like a, t, w, etc. are visible in your framework
* Create a new record within that framework within the standard editor
* Look for your 7xx subfield with the plugin and click the plugin icon
* Search for the record to link
* Click on choose
* Verify a new window opens and the subfields are not filled in the framework
Comment 1 Katrin Fischer 2021-07-22 14:49:21 UTC
Sometimes the additional window closes, but no information is transferred to the framework fields.
Comment 2 Katrin Fischer 2021-07-22 15:06:18 UTC
Ok, another revelation: If I like it to $a and there is an author, the author will be filled in. But $t with the title remains empty.

So the issue appears to be related to filling in multiple subfields from one plugin.
Comment 3 Katrin Fischer 2021-07-22 15:23:16 UTC
There is a syntax error in the plugin pop up shown in the console:
Uncaught SyntaxError: expected expression, got '%'

            function finish() {
                opener.document.f.field_value[[ % index % ]].value = document.f_pop.result.value;
                self.close();
                return false;
            }
Comment 4 Katrin Fischer 2021-07-22 16:38:02 UTC
I fixed the JavaScript error, but still no luck.
Comment 5 Katrin Fischer 2021-07-22 18:22:28 UTC
OK, adding another parentNode here, seems to do the trick:
                var subfields = whichfield.parentNode.parentNode.parentNode.getElementsByTagName('input');
Comment 6 Nick Clemens (kidclamp) 2021-08-09 13:23:21 UTC
I fix both on 22399 with my version

'closest' rather than several 'parentNode'
Comment 7 Katrin Fischer 2021-08-09 14:18:23 UTC
(In reply to Nick Clemens from comment #6)
> I fix both on 22399 with my version
> 
> 'closest' rather than several 'parentNode'

Sorry, not seeing it there - can you explain a bit more?
Comment 8 Nick Clemens (kidclamp) 2021-08-09 14:23:29 UTC
(In reply to Katrin Fischer from comment #7)
> (In reply to Nick Clemens from comment #6)
> > I fix both on 22399 with my version
> > 
> > 'closest' rather than several 'parentNode'
> 
> Sorry, not seeing it there - can you explain a bit more?

Oops, 28828
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=28828
Comment 9 Katrin Fischer 2021-08-10 10:25:15 UTC
Nick provided a fix on bug 28828.

*** This bug has been marked as a duplicate of bug 22399 ***
Comment 10 Katrin Fischer 2021-08-29 13:09:48 UTC

*** This bug has been marked as a duplicate of bug 28828 ***