View | Details | Raw Unified | Return to bug 38030
Collapse All | Expand All

(-)a/cataloguing/value_builder/stocknumberAV.pl (-3 / +3 lines)
Lines 50-62 my $builder = sub { Link Here
50
        function Click$params->{id}(ev) {
50
        function Click$params->{id}(ev) {
51
                ev.preventDefault();
51
                ev.preventDefault();
52
                var code = document.getElementById(ev.data.id);
52
                var code = document.getElementById(ev.data.id);
53
                const token = document.getElementsByName('csrf_token')[0].value;
53
                const csrf_token = document.querySelector('meta[name="csrf-token"]').getAttribute('content');
54
                \$.ajax({
54
                \$.ajax({
55
                    url: '/cgi-bin/koha/cataloguing/plugin_launcher.pl?csrf_token=' + token,
55
                    url: '/cgi-bin/koha/cataloguing/plugin_launcher.pl',
56
                    type: 'POST',
56
                    type: 'POST',
57
                    data: {
57
                    data: {
58
                        'plugin_name': 'stocknumberAV.pl',
58
                        'plugin_name': 'stocknumberAV.pl',
59
                        'code'    : code.value,
59
                        'code'    : code.value,
60
                        'csrf_token': csrf_token
60
                    },
61
                    },
61
                    success: function(data){
62
                    success: function(data){
62
                        var field = document.getElementById(ev.data.id);
63
                        var field = document.getElementById(ev.data.id);
63
- 

Return to bug 38030