The latest additions to my collection!

I really love accumulating old (and not so old) gaming devices and games. Recently I got two distinguished members of the club of handheld game consoles 😉 . The first one is the well-known Game Boy Color:

My Game Boy Color

A Game Boy in its original package, with some games. Great!

The second one is not so popular, but very interesting: it’s a GP32 BLU (in the photo, with my tablet to compare its sizes 😉 ):

My GP32

This console was released in 2001, and it was very powerful in that moment: it featured a 133MHz ARM CPU, 10MB of RAM and a screen resolution of 320×240, quite impressive for a handheld device. But the most special feature is the possibility of developing your own programs with the SDK provided by the company and save them to SmartMedia Cards which were used as game cartridges; there were also a few commercial games, but not with an awesome quality. Anyway, their idea for game distribution was also interesting: some games were sold physically in their own cards, but some other were sold digitally via internet, to be downloaded and stored in your own card (obviously by a cheaper price 😛 ). As you can see, they implemented digital distribution long time before the “boom” we live in.

The GP32 wasn’t a huge success, but it was enough popular among hackers for the company to launch another machine, the GP2X, fully based on linux.

By the way, does any of you have a SmartMedia Card? Now I need one of those old relics 😉 .

Adventures upgrading eZ Publish to 4.0.1

Some weeks ago we upgraded our CMS, eZ Publish, to the latest version in that moment, 4.0.1, with the intention of leaving behind PHP4 and switching to PHP5, the only one supported by the 4.x series. And although there is nice documentation about the process in ez.no, you’ll probably find some little problems which aren’t documented there.

With the aim of helping those who could have similar problems to mine, I’ll list and explain them a bit. 🙂

Switching to UTF-8

There’s a script to convert all the data in the DB to UTF-8, but when I tried it I found some problems; most of the data were corrupted after running it. In that moment, I found a related entry in eZ Publish bug tracker (#13674) where there was a patch which worked for me, but it very likely you won’t have this problem any more; the bug is closed and it says the patch has already been merged to stable (in fact, now the latest version is 4.0.3. These guys work really hard! 😉 ).

Moving templates to the correct place

Once the server was upgraded and running again, we noticed some template files weren’t rendered. I discovered that you have to place new template files in the directory design/plain/templates by imperative in eZ 4, but in previous versions you could place them in design/plain/override/templates although there wasn’t any override. I had a lot of auxiliary files stored in override which were original files, not overrides, so I had to move them.

For example, I have a template file show_comments.tpl which I include from news.tpl and article.tpl. I had it stored in design/plain/override/templates with the latter two files. But show_comments.tpl is, obviously, an original file, not overridden (there isn’t any entry in settings/override.php for it), so I had to move it to design/plain/templates, while news.tpl and article.tpl stay in the override directory.

So, if you made the same mistake as me when writing template files, now it’s the time to amend it 🙂 .

eZ Archive cronjob script not working anymore

We have the archive cronjob script installed in our server, with some customization, to move old content to an archive. After the upgrade it broke due to differences between eZ 3.x and eZ 4.x APIs. This was the error message:

Fatal error: Using $this when not in object context in /var/www/ez/kernel/classes/ezcontentobjecttreenode.php on line 1954

The solution is changing this line in the file extension/archive/cronjobs/archive.php:

39c39
<     $nodes =& eZContentObjectTreeNode::subTree( array( 'ClassFilterType' => 'include',
---
>     $nodes =& eZContentObjectTreeNode::subTreeByNodeIde( array( 'ClassFilterType' => 'include',

Image files don’t appear

Finally, a quite stupid mistake from my part: I just forgot to set the correct permissions to the eZ directory. Because of that, the program couldn’t write the temporary files it uses when resizing images and images in the page didn’t load. So remember your good friends chown and chmod.

Bonus: Online Editor v5

eZ Publish 4.1.0 adds some nice features, but it’s still in a beta state and we prefer a stable release in our server. Anyway, we’ve managed to install the latest Online Editor in the current version of eZ.

To do it, we just took the Online Editor files from the eZ Publish 4.1.0beta release (directory extension/ezoe), copied it to eZ 4.0.1 and activated the new extension modifying the file settings/override/site.ini.append.php:

< ActiveExtensions[]=ezhtml
> ActiveExtensions[]=ezoe

Depending on the rewrite rules you have in your apache server, you could have to make this small change:

< RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
> RewriteRule ^/var/[^/]+/cache/(texttoimage|public)/.* - [L]