@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at upstream/main 45 lines 1.4 kB view raw
1<?php 2 3$table = new PhabricatorDashboard(); 4$conn = $table->establishConnection('r'); 5$table_name = 'dashboard_install'; 6 7$search_table = new PhabricatorProfileMenuItemConfiguration(); 8$search_conn = $search_table->establishConnection('w'); 9$search_table_name = 'search_profilepanelconfiguration'; 10 11$viewer = PhabricatorUser::getOmnipotentUser(); 12$profile_phid = id(new PhabricatorHomeApplication())->getPHID(); 13$menu_item_key = PhabricatorDashboardProfileMenuItem::MENUITEMKEY; 14 15foreach (new LiskRawMigrationIterator($conn, $table_name) as $install) { 16 17 $dashboard_phid = $install['dashboardPHID']; 18 $new_phid = id(new PhabricatorProfileMenuItemConfiguration())->generatePHID(); 19 $menu_item_properties = json_encode( 20 array('dashboardPHID' => $dashboard_phid, 'name' => '')); 21 22 $custom_phid = $install['objectPHID']; 23 if ($custom_phid == 'dashboard:default') { 24 $custom_phid = null; 25 } 26 27 $menu_item_order = 0; 28 29 queryfx( 30 $search_conn, 31 'INSERT INTO %T (phid, profilePHID, menuItemKey, menuItemProperties, '. 32 'visibility, dateCreated, dateModified, menuItemOrder, customPHID) VALUES '. 33 '(%s, %s, %s, %s, %s, %d, %d, %d, %ns)', 34 $search_table_name, 35 $new_phid, 36 $profile_phid, 37 $menu_item_key, 38 $menu_item_properties, 39 'visible', 40 PhabricatorTime::getNow(), 41 PhabricatorTime::getNow(), 42 $menu_item_order, 43 $custom_phid); 44 45}