d84555710af610b002bd9492ca0702d622c00bc8
chmalee
  Thu Mar 5 11:07:17 2026 -0800
Oops I overcorrected when fixing 3fb0b5d2a3d, which led to weird conditions where sometimes a genark hub would show up under 'Connected Hubs' depending on where you searched for the genark genome. When creating links to genarks, we only need the db= parameter, as fixUpDb in the cart code handles connecting to genarks transparently. So remove explicit hubUrl and genome parameters from genark links in the menu bar and in hgSearch ajax calls, refs #36535

diff --git src/hg/js/hgGateway.js src/hg/js/hgGateway.js
index 2029b12f389..080e2578916 100644
--- src/hg/js/hgGateway.js
+++ src/hg/js/hgGateway.js
@@ -1715,45 +1715,36 @@
         var position = $('#positionInput').val();
         position = position.replace(/[\u200b-\u200d\u2060\uFEFF]/g,''); // remove 0-width chars
         var searchTerm = encodeURIComponent(position.replace(/^[\s]*/,'').replace(/[\s]*$/,''));
         var posDisplay = $('#positionDisplay').text();
         var pix = uiState.pix || calculateHgTracksWidth();
         var oldCgi = cart.cgi();
         cart.setCgi('hgSearch');
         if (! position || position === '' || position === positionWatermark ||
             position === selectedGene) {
             position = posDisplay;
             goDirectlyToHgTracks = true;
         } else {
             position = position.replace(/\u2013|\u2014/g, "-");  // replace en-dash and em-dash with hyphen
         }
         var $form;
-        var hubUrlField = '';
-        if (uiState.hubUrl) {
-            var fullHubUrl = uiState.hubUrl;
-            if (!fullHubUrl.startsWith("http")) {
-                fullHubUrl = window.location.origin + fullHubUrl;
-            }
-            hubUrlField = '<input type=hidden name="hubUrl" value="' + fullHubUrl + '">';
-        }
         $form = $('<form action="hgTracks" method=GET id="mainForm">' +
                   '<input type=hidden name="hgsid" value="' + window.hgsid + '">' +
                   '<input type=hidden name="org" value="' + uiState.genome + '">' +
                   '<input type=hidden name="db" value="' + uiState.db + '">' +
                   '<input type=hidden name="position" value="' + position + '">' +
                   '<input type=hidden name="pix" value="' + pix + '">' +
-                  hubUrlField +
                   '</form>');
         // helper functions for checking whether a plain chrom name was searched for
         function onSuccess(jqXHR, textStatus) {
             if (jqXHR.chromName !== null) {
                 $('body').append($form);
                 $form.trigger("submit");
             } else  {
                 window.location.assign("../cgi-bin/hgSearch?search=" + searchTerm  + "&hgsid="+ window.hgsid );
             }
         }
         function onFail(jqXHR, textStatus) {
             window.location.assign("../cgi-bin/hgSearch?search=" + searchTerm  + "&hgsid="+ window.hgsid );
         }
         var canonMatch = position.match(canonicalRangeExp);
         var gbrowserMatch = position.match(gbrowserRangeExp);