Tristan Brookes
Jackie Chan

As some of you may have realised, yesterday I updated the remaining two of our available Joomla modules to be compatible with Joomla 3. I thought I'd talk about some of the issues I had and what help I found.

But wait, I hear you say, don't you have three modules and the responsive slider is already compatible with Joomla 3? Yes, we do and this sort of explains the issue nicely. Whereas the slider didn't really hook that deeply into Joomla, the accordion and the drawer both use articles, which caused me a few headaches.

Initially I asked our backend web developer Andy for some references about what's changed with Joomla 3 and what would need to be upgraded and he sent me two particularly helpful pages which I impart unto you now (though if you've googled this matter before, you've probably already found them in some form):

Let's fast forward the 2 hours of wading through code, commenting out lines to find the error and crying to the issue at hand. I had this line of code.

$model->setState('',', a.fulltext, a.title, a.alias, a.title_alias, a.introtext, a.state, a.catid');

And the issue here, which I frankly stumbled upon when removing different bits of lines of code (*cries*), is that first bit, the '' part was no longer welcome.

$model->setState(', a.fulltext, a.title, a.alias, a.title_alias, a.introtext, a.state, a.catid');

After two hours or so I had no desire to figure out why so I happily just got on with the rest of the module.

Another nice thing about Joomla 3 is the ability to use the built in jQuery framework. A bit of googling and I found this helpful article about including it whilst maintaining backwards compatibility with Joomla 2.5. Wunderbar!

I suppose this post has been sort of a rant but I hope the links provided help someone else with any similar updating headaches.

So from what I could see here, I only had to change my usage of JModel to JModelLegacy, this was simply a case of changing any call to JModel to be JModelLegacy. Sweet.

JModel::addIncludePath(JPATH_SITE.'/components/com_content/models', 'ContentModel');

JModelLegacy::addIncludePath(JPATH_SITE.'/components/com_content/models', 'ContentModel');

Commence the look on my face when the 500 errors stopped and returned a nice, empty accordion div.