Posts – Page 7

Migrating Plone 2.5 content straight onto Plone 4

It’s my very last Plone 2.5 site and I’m very happy to see the back of it.  Using the joy that is quintagroup.transmogrifier, I was able to, without much manual effort, migrate my content from a Plone 2.5 site (constructed with instancemanager, of all things!) straight into a shiny new Plone 4 site on Buildout.

My only key need was to port the content and structure, and I was happy to make big allowances for the sake of certain content and time.  So, my thoughts here mightn’t (probably won’t!) suit everyone.My requirements …

Checking Plone REQUEST for Ajax’d requests (XMLHttpRequest)

Recently, I’ve needed a PloneFormGen (PFG) form of mine to have certain fields excluded when the form is displayed in one of Plone 4’s fancy popups.  At the same time, I need this field to still persist within the ‘standard’ view of the form.  It’s the request object to the rescue, and all I’ve had to do is insert this TALES expression against the Enabling Expression for my PFG field:

python:request.environ.get('HTTP_X_REQUESTED_WITH') != 'XMLHttpRequest'

and the end result is that unless the request is one of XMLHttpRequest, then we’ll show the field.

Shouldn …

Buildout: order of ‘extends’ configuration files

Yet another word to the wise: take care of your ordering of the ‘extends’ configuration files within your buildout.  It makes complete sense, and especially so with respect to version pinning: the later configuration’s versions will be the last one applied.

So, it makes a lot of sense (in hindsight!) that this configuration, and the fact I have version pins in my base.cfg, isn’t going to end well:

[buildout]
extends =
    base.cfg
    http://good-py.appspot.com/release/dexterity/1.0b2

The Dexterity version pins are going to override the ones I have in my base.cfg.  This …

Python eggs and missing files (like ‘docs’)

This is pretty trivial (and trivial to fix), but I’m chronicling it for my knowledge as much as anyone else’s.  The issue is that a given Python egg is missing some form of files, most commonly the ‘docs’ directory in my experience, because the build wasn’t configured correctly.

The error goes somewhat like this:

Getting distribution for 'my.theme'.
error: docs/HISTORY.txt: No such file or directory
An error occured when trying to install my.theme 1.5.0. Look above this message for any errors that were output by easy_install.

The solution is simple: just …

DIY - Replace your Logitech Premium Notebook Headset foam ear pads

So, I’m the proud owner of a set of a Logitech Premium Notebook Headset. I purchased these headphones a fair while ago - around 2 years - and just like any set of headphones, the foam ear pads deteriorated away when I took them out to use them after a long spell in storage. Usually, this wouldn’t be a problem if it were a set of headphones that used a standard shaped ear pad — just buy some replacement foam pages and put them on. These headphones aren’t so, with the shape being more like a D shape rather than …

Bad relationships: RelationChoice, RelationCatalog and removed Dexterity content in Plone

Disclaimer: this post isn’t giving relationship advice (or..it is in some twisted way).  Unsurprisingly, removing content in Plone via the ZMI when Plone says something can’t be deleted is likely to cause problems.

In my case, the fact I removed a Dexterity-based container (“Project”) caused users to no longer add or edit content of my Project type.  The reason for this boiled down to my use of RelationChoice fields, in order link Projects to Person objects and vice versa.  The backend storage for the RelationChoice field is an instance of z3c.relationfield.index.RelationCatalog, and this keeps …

Oh Microsoft, we do tire of thy bugs in IE

Yes, it’s another post about Microsoft and its poor implementation of Internet Explorer. This time it’s version 8 and its rendering of lists, and in specific, links within list items. Most humorously, Microsoft’s own documentation (separate issue; about rounded corners) gave me a laugh when it said:

“Microsoft is committed to providing a browser that accurately supports Web standards.”

Maybe it’s just me, but I’ve given up waiting for the day that IE actually supports anything correctly.

So, the issue I found was that with a <ul> with a number of <li> tags inside wouldn …

Plone/Zope: Truncating a Data.fs back to a certain date/time

Okay. So, anyone out here who’s listening — particularly those overly-enthusiastic users — don’t try to recursively wget your Plone site (or other CMS, for that matter) whilst you’re logged in with an account that can make edits. It will lead to a very bad situation where your site administrator and technical team need to step in and fix your mistakes. For the uninitiated, a loose recursive wget (when logged in with some degree of Edit rights) will hit every link that’s on your pages, and I mean in the (X)HTML source. For a Plone site, this …

Plone: running Plone without copies of blobs

Having a bad day? Just bombed your only copies of some files that you’d been storing as blobs together with your Plone database? Maybe you had the blobs stored incorrectly on your Zeo client, rather than the server, and then in a hasty effort to free some space (due to an on-going issue with blobs eating HDD space), deleted them. Whoops..they’re gone and their references are still in your Plone database. Or, in a less disastrous situation, maybe you just want to be able to run your Plone database without needing lost blobs? Read on.The suggestion …

Plone: Overrides.zcml gets auto-included with z3c.autoinclude

Unsurprisingly, specifying a z3c.autoinclude entry point in your Plone product egg means your ZCML gets automatically included. That’s great because it means you don’t have to specify your product under the ZCML section of your instance in buildout. One thing that isn’t so obvious (it’s not mentioned that I can see on plone.org) is that if your package is marked for ZCML autoinclude, then Plone will automatically load an overrides.zcml file in your product.

Nothing hits you like a slippery wet fish in the face more than hitting this issue and having it …