Changeset 11370
- Timestamp:
- 12/14/2021 05:20:19 AM (2 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin/list-table.php
r11369 r11370 123 123 FROM {$props_table} 124 124 WHERE revision IN({$revisions}) 125 ORDER BY LENGTH(prop_name) DESC"125 ORDER BY user_id IS NULL DESC, LENGTH(prop_name) DESC" 126 126 ); 127 127 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin/post.php
r11362 r11370 38 38 $svn['props_table'], 39 39 [ 40 'id' 41 'revision' 40 'id' => $the_prop->id, 41 'revision' => $rev, 42 42 ] 43 43 ); … … 73 73 [ 74 74 'prop_name' => $the_prop->prop_name, 75 'user_id' => null75 'user_id' => null 76 76 ] 77 77 ); … … 109 109 ] 110 110 ); 111 112 // Update any other occurences of this typo. 113 $wpdb->update( 114 $svn['props_table'], 115 [ 116 'user_id' => $user, 117 ], 118 [ 119 'prop_name' => $prop_name, 120 'user_id' => null 121 ] 122 ); 111 123 } 112 124 … … 140 152 } 141 153 142 // Remove the props for the commit first. 154 // Reparse 155 $raw_props = Props\from_log( $details->message ); 156 157 // Fetch all the user_id's 158 $props = []; 159 foreach ( $raw_props as $prop ) { 160 $props[ $prop ] = Props\find_user_id( $prop, $svn ); 161 } 162 163 // Remove the props for the commit, after reparsing. This is so that any usernames only corrected within that commit get picked up. 143 164 $wpdb->delete( 144 165 $svn['props_table'], 145 [ 146 'revision' => $rev 147 ] 166 [ 'revision' => $rev ] 148 167 ); 149 168 150 // Reparse151 $props = Props\from_log( $details->message );152 153 169 // Reinsert 154 foreach ( $props as $prop ) {170 foreach ( $props as $prop => $user_id ) { 155 171 $data = [ 156 172 'revision' => $rev, … … 158 174 ]; 159 175 160 $user_id = Props\find_user_id( $prop, $svn );161 176 if ( $user_id ) { 162 177 $data['user_id'] = $user_id; -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/admin/reports-page.php
r11369 r11370 25 25 <li><a href="<?php echo $url; ?>&what=cloud">Cloud of Props matching filter</a></li> 26 26 <li><a href="<?php echo $url; ?>&what=typos">Props typos matching filter</a></li> 27 <li><a href="<?php echo $url; ?>&what=unknown-props">Unknown Props/typos matching filter</a></li> 27 28 <li><a href="<?php echo $url; ?>&what=raw-contributors-and-committers">All Props+Committers matching filter grouped together</a></li> 28 29 … … 354 355 355 356 break; 357 case 'unknown-props': 358 $details = $wpdb->get_results( 359 "SELECT p.prop_name, 360 COUNT( * ) as count, 361 GROUP_CONCAT( p.revision ORDER BY p.revision ASC ) as revisions 362 FROM {$details['props_table']} p 363 LEFT JOIN {$details['rev_table']} r ON p.revision = r.id 364 WHERE $where AND p.user_id IS NULL 365 GROUP BY p.prop_name 366 ORDER BY r.id DESC" 367 ); 368 369 echo '<table class="widefat striped">'; 370 echo '<thead><tr><th>Prop</th><th>Count</th><th>Revisions</th></tr></thead>'; 371 foreach ( $details as $c ) { 372 $link = add_query_arg( 373 [ 374 'page' => str_replace( 'reports', 'edit', $_REQUEST['page'] ), 375 'revisions' => $c->revisions 376 ], 377 admin_url( 'admin.php' ) 378 ); 379 printf( 380 '<tr><td>%s</td><td>%s</td><td><a href="%s">%s</a></td></tr>', 381 esc_html( $c->prop_name ), 382 $c->count, 383 $link, 384 '[' . str_replace( ',', '] [', $c->revisions ) . ']' 385 ); 386 } 387 echo '</table>'; 388 389 break; 356 390 case 'raw-contributors-and-committers': 357 391 $details = $wpdb->get_results(
Note: See TracChangeset
for help on using the changeset viewer.