Jim's
Tutorials

Fall 2011
course
navigation

Patches

I began looking for trac tickets marked as needing patches. I spent a little while looking at ticket 18314. Several people are working to reorganize/simplify some of the css files behind the admin. The general purpose of ticket 18314 is to remove duplicate styles from the wp-admin.css file. I looked at a few of the patches that had already been made and it seems things are being done in stages. I found a few lines that could be merged, created a patch, and uploaded it. The code I edited looked like this:
#col-right { overflow: hidden; padding: 0; margin: 0; } #col-left { overflow: hidden; padding: 0; margin: 0; width: 39%; } #col-right { overflow: hidden; padding: 0; margin: 0; float: right; clear: right; width: 59%; }
And I changed to this:

#col-container, #col-left, #col-right { overflow: hidden; padding: 0; margin: 0; } #col-left { width: 39%; } #col-right { float: right; clear: right; width: 59%; }

then used svn diff to get:
Index: wp-admin/css/wp-admin.dev.css =================================================================== --- wp-admin/css/wp-admin.dev.css (revision 18875) +++ wp-admin/css/wp-admin.dev.css (working copy) @@ -182,25 +182,23 @@ /* 2 columns main area */ -#col-container { + + +#col-container, +#col-left, +#col-right { overflow: hidden; padding: 0; margin: 0; } #col-left { - padding: 0; - margin: 0; - overflow: hidden; width: 39%; } #col-right { float: right; clear: right; - overflow: hidden; - padding: 0; - margin: 0; width: 59%; }
I left a comment with my patch explaining that it was my first patch and I'd like to know if there is a problem with it so now I'm waiting to see?

Oddities

Discovered a couple of oddities while doing this. First, the ticket suggests that I should be editing wp-admin.css even though all of the patches modify wp-admin.dev.css. As it turns out the wp-admin.css file is a minified version and there is a hidden configuration option somewhere to make the script loader look for .dev files.
The second was trickier. Is was mention in a comment on trac by azaozz — 6 weeks ago:
There are still quite a few duplicates or nearly duplicates in wp-admin.css. All are welcome to help slim it down. The only thing we need to be careful about is to apply any uncommited patches to it before starting to hunt for duplicates. It's hard to merge conflicting css patches as each conflict has to be tested separately.
I initially tried to run all of the patches and ran into numerous errors with this approach until I finally thought to check whether the changes had already been made to the repository. It turns out all of them had. I added a comment to the ticket asking if there was an easy way to see whether a patch had been committed.
http://cs.marlboro.edu/ courses/ fall2011/jims_tutorials/ sam/ More_WordPress_bugs
last modified Tuesday October 4 2011 5:50 pm EDT