#5866 closed defect (bug) (fixed)
On Trac only run capital P dangit JS on description and summary for new tickets.
Reported by: | peterwilsoncc | Owned by: | dd32 |
---|---|---|---|
Milestone: | Priority: | normal | |
Component: | Trac | Keywords: | needs-dev-note |
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' );
In 11539: