WordPress.org

Making WordPress.org

Opened 2 months ago

Last modified 2 months ago

#5866 new defect

On Trac only run capital P dangit JS on description and summary for new tickets.

Reported by: peterwilsoncc Owned by:
Milestone: Priority: normal
Component: Trac Keywords:
Cc:

Description

WordPress trac runs a JavaScript version of capital_P_dangit() on a ticket's summary, description and comment fields 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:

-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' );

Change History (2)

This ticket was mentioned in Slack in #meta by peterwilsoncc. View the logs.


2 months ago

#2 @dd32
2 months ago

  • Component changed from General to Trac
Note: See TracTickets for help on using tickets.