Skip to main content
Topic: 1.0 to 1.1 addons/themes migration guide (Read 8871 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

1.0 to 1.1 addons/themes migration guide

The idea about ElkArte versioning is to stick as much as possible to the so called "semantic versioning":
QuoteGiven a version number MAJOR.MINOR.PATCH, increment the:

    MAJOR version when you make incompatible API changes,
    MINOR version when you add functionality in a backwards-compatible manner, and
    PATCH version when you make backwards-compatible bug fixes.

Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.

That said, since ElkArte 1.x is still an "heavily" developed piece of code that is meant to change and hopefully ( :P ) improve, it may be that some "low level" stuff (e.g. database schema, less-used files, etc.) may require changes creating some compatibility issue.
Of course we will try to reduce these changes to a minimum, but some are (or will be) really necessary in order not to restrict the development too much.

This topic is meant to track changes that developer of addons and themes should be informed about, so that they will be able to evaluate the steps necessary in order to prepare for future releases.
Please remember that any change reported here may change again in the future before the 1.1 version is released, so feel free to discuss the changes, disagree with them and ask any question. Maybe opening a new topic, so that people can subscribe to this one to receive notifications. ;)

Of course you can keep track of actual development following the commits to the development branch at github:
https://github.com/elkarte/Elkarte/tree/development
Bugs creator.
Features destroyer.
Template killer.

[addons]

Reply #1

Incompatible changes

The schema of the table {db_prefix}log_mentions changed to:
Code: [Select]
		array('name' => 'id_mention',     'type' => 'int', 'size' => 10, 'unsigned' => true, 'auto' => true),
array('name' => 'id_member',      'type' => 'mediumint', 'size' => 8, 'unsigned' => true, 'default' => 0),
array('name' => 'id_target',      'type' => 'int', 'size' => 10, 'unsigned' => true, 'default' => 0),
array('name' => 'status',         'type' => 'tinyint', 'size' => 1, 'default' => 0),
array('name' => 'is_accessible',  'type' => 'tinyint', 'size' => 1, 'default' => 0),
array('name' => 'id_member_from', 'type' => 'mediumint', 'size' => 8, 'unsigned' => true, 'default' => 0),
array('name' => 'log_time',       'type' => 'int', 'size' => 10, 'unsigned' => true, 'default' => 0),
array('name' => 'mention_type',   'type' => 'varchar', 'size' => 12, 'default' => ''),

The hook integrate_add_mention has been removed.
New mentions are now added via files.

Details will follow (and if they don't feel free to ask for them).

Backward compatible relevant changes

Introduction of "events" (let's say a sort of hooks under steroids - hopefully).
Introduction of "modules" and "integrations" (pattern-based classes automatically loaded when needed, an hopefully easier way to extend the core).
* Scheduled tasks are now split each one to its own file for easier extension.

Reference for all the items listed here is the following pull request:
https://github.com/elkarte/Elkarte/pull/1950
Last Edit: March 07, 2015, 02:26:27 pm by emanuele
Bugs creator.
Features destroyer.
Template killer.

[addons]

Reply #2

Incompatible changes
Procedural controllers are no more supported in ElkArte 1.1, only controller classes are accepted and used.
If you have a controller in the form:
Code: [Select]
<?php
function my_controller()
{

}

function my_pre_dispatch_controller()
{

}

Please take your time to convert it into a class in the form:
Code: [Select]
<?php
class Myaction_Controller extends Action_Controller
{
    public function pre_dispatch()
    {
        // Pre-dispatching code
    }

    public function action_index()
    {
        // Default action
    }
}

TODO Write documentation about controllers and naming patterns.
TODO Write a todo addon. LOL

Reference: https://github.com/elkarte/Elkarte/pull/1979
Bugs creator.
Features destroyer.
Template killer.

Re: 1.0 to 1.1 addons/themes migration guide

Reply #3

I have been thinking on how to do that all this while. May be I'll attempt it in the near future...

Re: 1.0 to 1.1 addons/themes migration guide

Reply #4

It's easier to do than explain. ;)

The code I wrote above, put into a file named Myaction.controller.php and into the controllers directory is already able to "react" to ?action=myaction
Bugs creator.
Features destroyer.
Template killer.

New folder addon?

Reply #5

In the last pull request #2340 from emanuele45/formatting there is a new folder addon. In recent pull requests there have been many changes for 1.1 dev.  What these changes mean for creating Addons / Themes?
Last Edit: January 05, 2016, 03:09:06 am by wintstar
Regards Stephan

Re: 1.0 to 1.1 addons/themes migration guide

Reply #6

Quote from: emanuele – Incompatible changes

The BBC parser has been completely replaced, so the way to add new bbcodes and all the hooks have changed as well.
TODO write documentation of the new BBC parse.

Backward compatible relevant changes

* Introduced an "addons" directory where addons can reside and work in almost complete isolation from the core.

TODO write documentation about it. I swear I already did, but apparently I didn't.
Bugs creator.
Features destroyer.
Template killer.

Re: 1.0 to 1.1 addons/themes migration guide

Reply #7

Quote from: wintstar – What these changes mean for creating Addons / Themes?
I merged your topic in this one so it's easier to keep track. I hope. :P

Quick and dirty: addons can almost entirely work from that particular directory, so you can have an addon there reproducing the directory structure of ElkArte (at least for now in regards to controllers and subs, it should be somehow extended to themes and languages as well). I'm not (yet) sure it works 100% in the intended way, it requires some documentation and testing before.
Bugs creator.
Features destroyer.
Template killer.

Re: 1.0 to 1.1 addons/themes migration guide

Reply #8

When will publish a Dokumentation? I am currently doing my addons prepare for the upcoming version 1.1 *.

Regards Stephan

Re: 1.0 to 1.1 addons/themes migration guide

Reply #9

heh... Don't you have another question? O:-)
Bugs creator.
Features destroyer.
Template killer.

Re: 1.0 to 1.1 addons/themes migration guide

Reply #10

Oh I had many, many question 8) But I think most of them can not yet be answered :-[ 

Regards Stephan