Elgg Blog: Updating 1.7 Plugins for 1.8 While Still Using 1.7

Plugin authors, there are a few steps that you can take to update your plugins for 1.8 before it is released. Completing these steps will make it just that much easier to be ready for 1.8.

Manifest files
Make sure you have one! If you don't, Elgg won't load your plugin in 1.8.

Replacing deprecated functions
Elgg 1.7 deprecated a lot of functions as it added a better API for getting and listing entities. If you are still using the older functions like get_entities(), users will get visible error messages. Common deprecated functions to look out for are extend_view() plus the get_entities*() and list_entities*() functions. Using the new elgg_get_entities*() functions will mean that Elgg 1.6 sites won't be able to use the newest version of your plugins (but those sites really should be upgraded to 1.7!)

Update your page handling
Elgg 1.8 introduces a standard set of URLs for the content plugins (think blogs, bookmarks, and files). If your plugins implement that same pattern, it will be easier to use the new content layout that we've added in 1.8. To see an example of these URLs, check out the bookmarks plugin's page handler. (Be sure to keep the /pg/ at the front of the URL for Elgg 1.7.)

Standardize your code
With Elgg 1.7 we introduced coding standards. Finally in 1.8, we have brought the plugins bundled with Elgg up to these standards. No more crazily formatted code or impossible to read if statements. Now is a great time to read through those standards and update your plugins. Want to see how well your plugins conform to the standards? Check out this tool.

 
By following these steps, you'll have plugins that work with 1.7 and are easier to update for 1.8 when it is released.

Latest comments