<commit_before>//shows table modal
function linkableEntitiesPopup(title, selectedid, callback) {
    requiredata.request('typesdata', function(typesdata) { 
        var typedata = typesdata[link]; //gets data about linked type

        showModal('<div class="modal-header"><button data-dismiss="modal" class="close">&times;</button><h2 class="title">' + title + '</h2></div>\
            <div class="modal-body"><div id="entities"></div></div>', "lg", function(root) {

            var columns = []; //gets columns (only columns to show)
            for (var col in typedata.columns) if (typedata.columns[col].showinlist) 
                columns[col] = typedata.columns[col].displayname;

            var t = root.find("#entities").scanzytable({ columns: columns, loadnow: { enabled: true },
                request: { url: "./apis/entities/linkable.php", data: { type: type, id: id, link: link } }, requiredata: { name: "linkabledata" },
                sort: {  
                        enabled: ('orderby' in typedata), //sort options on data load
                        column: ('orderby' in typedata) ? typedata.orderby.column : undefined,
                        reverse: ('orderby' in typedata) ? typedata.orderby.reverse : false,
                        click: true //enables sort on th click
                    },          
                    fetch: { 
                        rows: { //setups row click
                            start: function (col, data) { return "<tr data-entity-id='" + data.id + "'>"; }, 
                            click: function () { selectedid = $(this).attr('data-entity-id'); root.modal('hide'); },
                            hoverClass: 'hover' 
                        }, 
                        contents: function(col, data) { return raw2display(data, typedata.columns[col]); },                                  
                    }, 
                    empty: typedata.emptysethint,
                    search: { show: true, text: typedata.searchhint, minRows: typedata.searchminrows }, 
                    always: function(t) { t.root.translate(); } //translates table <commit_msg>Bugfix for linkable entities popup<commit_after>//shows table modal
function linkableEntitiesPopup(title, selectedid, callback) {
    requiredata.request('typesdata', function(typesdata) { 
        var typedata = typesdata[link]; //gets data about linked type

        showModal('<div class="modal-header"><button data-dismiss="modal" class="close">&times;</button><h2 class="title">' + title + '</h2></div>\
            <div class="modal-body"><div id="entities"></div></div>', "lg", function(root) {

            var columns = []; //gets columns (only columns to show)
            for (var col in typedata.columns) if (typedata.columns[col].showinlist) 
                columns[col] = typedata.columns[col].displayname;

            var t = root.find("#entities").scanzytable({ columns: columns, loadnow: { enabled: true },
                request: { url: "./apis/entities/linkable.php", data: { type: type, id: id, link: link } }, requiredata: { name: "linkabledata" },
                sort: {  
                        enabled: ('orderby' in typedata), //sort options on data load
                        column: ('orderby' in typedata) ? typedata.orderby.column : undefined,
                        reverse: ('orderby' in typedata) ? typedata.orderby.reverse : false,
                        click: true //enables sort on th click
                    },          
                    fetch: { 
                        rows: { //setups row click
                            start: function (col, data) { return "<tr data-entity-id='" + data.id + "'>"; }, 
                            click: function () { selectedid = $(this).attr('data-entity-id'); root.modal('hide'); },
                            hoverClass: 'hover' 
                        }, 
                        contents: function(col, data) { return raw2display(data, typedata.columns[col]); },                                  
                    }, 
                    empty: typedata.emptysethint,
                    search: { show: true, text: typedata.searchhint, minRows: typedata.searchminrows }, 
                    always: function() { $("#entities").translate(); } //translates table 
{'fraction_non_alphanumeric': 0.13644816364481638, 'fraction_numerical': 0.001394700139470014, 'mean_word_length': 1.7618741976893453, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '333486', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1067, 'n_words': 276}