WordPress Depreciation Errors

•July 1, 2012 • Leave a Comment

I keep getting notices of errors and warnings for depreciated calls in plugins.  I’m creating a resource here for the fixes for these niggling little things that are driving me so crazy.

has_cap was called with an argument that is deprecated

The correction for this error is to adjust the call to an appropriate user role.  I’ll update the following table as I run into things.


Old Level/Capability New Role
0 Subscriber
1 Contributor
2 Author
3 Editor
4 Editor
5 Editor
6 Editor
7 Editor
8 Administrator
9 Administrator
10 Administrator
publish_posts Editor

Content By Query – Search for nulls

•February 22, 2011 • Leave a Comment

Content by query is such a handy tool.  I can find ANYTHING!  Documents added only that last month?  Easy.  Comments that have been approved?  Easy.  Posts that haven’t yet been tagged?  Um . . .

I couldn’t seem to find an “official” way to solve this problem, but I discovered a hack for it.  If you need to search for a field that is null or blank, search for a condition in that field that can’t possibly be true.  For example, the value is both greater than and less than 0.  Suddenly, you’ll be presented with a result full of blank values in that field 🙂

Works great if you need to create a web part listing things that are missing information.

Note that this is for Sharepoint 2010, I haven’t tried it in 2007.

Memorial Day

•June 1, 2010 • Leave a Comment

Yesterday was Memorial Day.  A day for sober reflection, for appreciation of the people that have sacrificed for us.

Whether or not you agree with the current state of affairs, we owe those that have served in the past – and those currently serving – some appreciation.  Their reasons don’t matter.  The wars they did or didn’t participate in don’t matter.  It’s a hard life that requires a lot of sacrifice, particularly for those with families.  Everyone benefits from the service of others, they are the reason other people currently have the ability to choose not to join the military.

I was on a plane yesterday.  At the end of the flight, the attendants were kind enough to ask that everyone remain seated to allow current and former military to deplane first.  I was in the back of the plane.  I counted.  Six people stayed in their seats.

Happy Ada Lovelace Day!

•March 23, 2010 • Leave a Comment

24 Mar is Ada Lovelace day.  Ada was a programmer back in the days that a computer still referred to a person.  She was such a huge influence on computer science that one of the first programming languages was named after her.

Who are your female influences in science and technology?

I have always admired Eileen Collins, the first female pilot and then commander of a space shuttle.

Beatrix Potter theorized that antibiotic properties in lichen helped them fight disease.  She theorized that lichen were made up of a symbiotic relationship between algae and fungi.  She wrote a paper on the subject which was not well received, and eventually withdrawn.  Decades later, scientists proved that she was correct.

Hong Kong

•February 25, 2010 • 2 Comments

My first day in Hong Kong was really fun!

I began the day on a quest for congee.  I picked 3-4 restaurants at random, but none had it.  In the last one, I pointed to some noodle soup a girl next to me was eating, and said I wanted that.  It turned out to be cow stomach noodle soup, and it was wonderful!  The beef broth was rich, the stomach tender.  The bowl was so big that I couldn’t finish it.

After breakfast, it was time to do some wandering.  I picked up a sim card for US$7 with more minutes than I usually use in two months.  The alleys are really fun to walk through, vendors have stalls out all along the walls, and cars aren’t allowed through.  I noticed after a while that there were shop doors behind the vendors, two layers of shopping!  I found a place that sells designer underwear, and a place that sells toddler sized wetsuits.  I found a tiny shop that sold durian chips.  I followed some drums to a lion dance in front of the Rolex store!

I returned from my walk to find that Kathy had returned, and wanted to take me on a mini-tour of the area.  She showed me where to get congee and where the immigration building was.  We picked up some sandwiches to eat on the waterfront. 

As pretty as the waterfront was during the day, I returned to see what it looked like after dark.  It was a place transformed!  The usual city haze combined with the large amount of light in the city means it’s never really dark here.  My camera couldn’t deal with the weird light levels, the place was absolutely beautiful.  Colored light designs dart around on many of the buildings, tracing out patterns, flowers, words, and celebrations of the year of the tiger.  Many of the designs moved, changed, shifted around.  The flower pattern building that I was unable to capture seemed to have flowers growing, changing in color, and having their petals blown away.

I stopped by the red light district on my way back to the apartment, which Kathy had assured me was perfectly safe.  She was right. Young women in sparse clothing and big black boots hang out in front of strip clubs – they ignored me.  In between strip clubs were regular clubs and bars, I looked up to locate some Gwen Stefani music to see an English pub.  There were nice bars with well-dressed westerners sipping martinis.  I found a pizza place, a tapas place, and a very busy place selling kebabs.  It didn’t take me long to realize that I was underdressed for this area in my slacks and t-shirt.  It was getting late, so I decided to return another night in more appropriate attire.

Random Acts of Thoughtfulness

•January 12, 2010 • Leave a Comment

To the girl that snubbed out her cigarette half a block away from the bus stop: I saw you.  Thank you.  It’s considerate people like you that make living in Seattle so pleasant.

To the girl walking with you that continued smoking while standing in front of the bus stop, just outside the closed bus door: I saw you, too.  Your smoke will drift inside the bus when the door opens, and make the ride unpleasant for non-smoking riders for hours.  Anyone walking by that bus stop or having to stand next to you will have to breathe your second hand smoke as the wind continues to shift to and fro.

Plone Migrator is … Gone?

•June 17, 2009 • 11 Comments

Update: I’ve submitted a tutorial for review in the Plone docs.

I’ve been going through the process of moving some local packages into the collective.  In the process of doing so, I’ve changed the names of the packages to make them more general-use friendly.  Now that I’m done with that, the plan was to write some migrations to move the existing objects over to the collective types.

I get working on my migration, using Martin’s helpful guide, and am faced with this:

ImportError: No module named migrator

Well, that’s weird, I must have a broken package.  I go look in the Products.ATContentTypes.migration package, and there is indeed no file called migrator.  Delete the package and run buildout again, still not there.

Googling around points me at the new transmogrifier package, which looks like it will fit my needs nicely.  After working with it a couple of weeks, I can say that I just don’t have the time to figure out how to make this work right now.  I can see that it’s going to be a great package, but I’m on a time crunch here.

More looking, and I happen upon a plone news update on the plone.de site that says, “Removed the migration tool. Upgrades are handled by GenericSetup alone.”  So far, I’ve come upon this slideshow from Six Feet Up explaining upgrades in GenericSetup.  Please, someone tell me if I’m on the wrong track or if you know of a step-by-step tutorial on upgrades.  I feel like I should be done with this by now, but I keep starting over.