[wp-meta] [Making WordPress.org] #5866: On Trac only run capital P dangit JS on description and summary for new tickets.

Making WordPress.org noreply at wordpress.org
Mon Aug 16 01:43:58 UTC 2021


#5866: On Trac only run capital P dangit JS on description and summary for new
tickets.
---------------------------+--------------------
 Reporter:  peterwilsoncc  |      Owner:  (none)
     Type:  defect         |     Status:  new
 Priority:  normal         |  Milestone:
Component:  General        |   Keywords:
---------------------------+--------------------
 WordPress trac runs a JavaScript version of `capital_P_dangit()` on a
 ticket's summary, description and comment fields
 [https://meta.trac.wordpress.org/browser/sites/trunk/wordpress.org/public_html/style/trac
 /wp-trac.js?rev=11147&marks=545-565#L545 located in wp-trac.js#L545 at the
 time of writing].

 If the JavaScript fails to run when a ticket is created, replying to the
 ticket will cause the summary and description to be edited and credited to
 the author of the reply. An example of this is #core51904 when I changed
 the status in comment 3.

 This can have the effect of making the author of the comment appear
 unwelcoming to the contributor, without the comment author having any such
 intent.

 It would be lovely if the function only ran on the summary and description
 field on new tickets, rather than when making a reply. This can be done by
 modifying the selectors for the description and summary fields

 Based on some browser console testing, changing the selectors as follows
 should prevent unintended edits:

 {{{#!diff
 -var $summary     = $( '#field-summary' ),
 +var $summary     = $( '#field-summary' ).not( '#ticket ~ #propertyform
 #field-summary' ),
 -    $description = $( '#field-description' ),
 +    $description = $( '#field-description' ).not( '#ticket ~
 #propertyform #field-description' ),
      $comment     = $( '#comment' );

 }}}

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/5866>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list