Elgg 3 - guidelines for plugins development

I started playing with Elgg 3 and I tried to upgrade one of my plugins for making it compatible with Elgg 3, unfortunately without success, even I tried to use some core plugins as an example.

Obviously something I didn't do right so when enabled the plugin the site stopped working without any error messages.

So the question is, is there any documentation or guidelines about plugins development for Elgg 3.

Or a plugin skeleton like this one for Elgg 2.x https://github.com/juho-jaakkola/Elgg/blob/3d6054d979776f5c4296c8600b01c7c4f214a30a/docs/guides/plugins/plugin-skeleton.rst ?

Thanks

  • There's

    https://github.com/Elgg/Elgg/blob/3.x/docs/guides/plugins/plugin-skeleton.rst

    And there's also

    https://github.com/Elgg/Elgg/blob/3.x/docs/appendix/upgrade-notes/2.x-to-3.0.rst

    https://github.com/Elgg/Elgg/blob/3.x/docs/guides/plugins.rst

    https://github.com/Elgg/Elgg/blob/3.x/docs/guides/guidelines.rst

    Even with the documentation I guess it might still take some time to learn about the troublesome code that needs to be updated to get a plugin working on 3.0 as some of the required changes might result in a silent fall if not done. I have not really started with upgrading my plugins yet (I did some initial small tests last year but just have not enough time to really work on it). If you have a simple plugin it might be best to start with upgrading this plugin as some changes seem necessary for a plugin to work at all on 3.0 and these might be easier to understand in a simple plugin. If the necessary basic changes to be done are understood, it might be easier to upgrade more complex plugins that require more than just the basic modifications. I have to admit that I currently feel rather horrified by the prospect of upgrading all my plugins again. The changes for 3.0 seem quite numerous with some of them might require some quite time consuming modifications (not speaking by experience yet but rather by looking at the list of changes). It seems like a work similar to the upgrade from 1.8 to 1.9 whereas all the upgrades after that seemed easy by comparison until now 3.0 arrives...

  • The plugin structure doesn't have to change, unless you want to take advantage of the new plugin Bootstrap interface or inject services. You can continue using start.php with event handlers. 

    Some of the areas to watch out for:

    - add_subtype() and update_subtype() have been removed, you should register entity classes at runtime using elgg-plugin.php

    - if you have written custom SQL queries for metastrings, you will most likely need to update them

    - make sure language files return an array and don't use register_translation()

    These are the 3 main areas that will cause failures in old plugins. There are many changes, but an average plugin won't need to do as much - unless you want to get rid of all the deprecation notices.

    If you don't see any errors in your logs, try changing config debug value in elgg-config/settings.php: $CONFIG->debug = 'WARNING';

  • Iionly linked to the documentation on github, but you can also view it in a somewhat more readable format here http://learn.elgg.org/en/3.x/appendix/upgrade-notes/2.x-to-3.0.html

    At the bottom left there is the option to switch between the different versions of Elgg for the correct documentation. Default is 'stable' (currently 2.3) if you switch to 3.x you'll get the documentation for Elgg 3.0.

    Like Ismayil said unless your plugin is doing some really special stuff it should work fine, (maybe with some deprecated notices but those are documented)

  • Thanks everybody for providing all this information