Page 1 of 1

Community Builder

Posted: Thu Feb 09, 2006 8:55 am
by Beat
as my postings in:
http://forum.joomla.org/index.php/topic ... #msg200520
belong more to this thread, i'm "moving" my post here:

The backwards compatibility is indeed fabulous, considering that the whole engine running  Joomla! has been re-factored.

There are very few fundamental changes, most of which that I welcome warmly, which will need slight adaptations on some components. These changes are backwards-compatible with Joomla 1.0/Mambo 4.5.

Here are the ones that we have spotted (and chosen not to correct for backwards compatibility at this stage):
  • Global scope: For security enhancement reasons and better encapsulation reasons, the components are not anymore just included from the main index.php, but called from a function. Thus their variables scope is not the global scope anymore.
    This means that variables created in the main part of a component, which are not declared as "global" before creation belong to the component's main execution, and are not accessible as global from the components functions.
    The adaptation is trivial: just add one line in the begin of the component: "global ...." enumerating the global variables of the component, and the ones of Joomla it is using.
  • Global parameters in variables: By default URL parameters are not translated anymore into globals of same name, but should be accessed the standard way.
    Here too, the change is trivial: instead of looking directly at for instance at $form, do first a $form=mosGetParam( $_REQUEST, 'reportform'); .
    This will prevent SQL injection attacks by the way, as mosGetParam does escaping even with magicquotes off.
  • Start of changes in ACL: The tables structure of the used phpGACL has changed slightly, due to an update to latest phpGACL.
    The $acl->.... methods remain backwards compatible, so components which do not access ACL tables wildly are ok.
  • Modules path: Each module is installed in its own sub-directory, like components, meaning if they have images or other files, the path changes.
  • Plugins: The mambots have been renamed to joomla plugins, as well as the directory, so same remark applies there.
This list is probably not complete, might need adjustments, and should probably go into the new http://dev.joomla.org portal.

So overall, the backwards compatibility is excellent, but not granted without small changes for all existing components, modules and mambots. 3PD are encouraged to download Joomla! 1.1 alpha 2 now, and to adapt their extensions to Joomla! 1.1 now. These adaptations can keep them backwards compatible to Joomla! 1.0, avoiding to have to mange two versions :).

Hope these indications will help other 3PDs ;)

If you see other things, please add them to my list, and/or add these to the official list :P

Re: BC findings during Community Builder testing and adaptation

Posted: Fri Feb 10, 2006 2:15 pm
by alikon
Thank's for this very intersting and usefull reading , let me read more proof....

Re: BC findings during Community Builder testing and adaptation

Posted: Fri Feb 10, 2006 3:41 pm
by gram
Good post Beat, very useful.

I will see if I can encapsulate the session differences and add them to this thread. 

GRAM

Re: BC findings during Community Builder testing and adaptation

Posted: Fri Feb 10, 2006 6:50 pm
by Hackwar
Hi Beat,
I wrote you about the changes in ACL with the different function call. Since I'm extremely short on time, could you copy the information over to this thread? BTW: You could put this in an article in the wiki

Re: BC findings during Community Builder testing and adaptation

Posted: Mon Feb 13, 2006 12:05 am
by Beat
I've added the changes to the dev wiki into chapter 7.1 here:

http://dev.joomla.org/index.php?option= ... nsions_fit

Please reply here in similar formating if things need to be added (if you can't directly edit the wiki).

I saw once a post regarding WYSIWYG editor usage changes, but just can't find it again. Anyone has the link ?

Re: BC findings during Community Builder testing and adaptation

Posted: Mon Feb 13, 2006 9:31 am
by Hackwar
Hi Beat,
you wrote that ACL didn't really change, but:
1. The ACL system didn't change from its "roots"
2. There was no update to the phpGACL-API that affects the system.
3. There is a change to the acl_check-function to make transition in the future easier. Since the check is at the moment dependend on $my->usertype and it will change in future versions to $my->id, Louis created a wrapper. The new call would look like this:

Code: Select all

/*
 * Make sure the user is authorized to view this page
 */
$user = & $mainframe->getUser();
if (!$user->authorize( 'com_config', 'manage' ))
{
	josRedirect('index2.php?', JText :: _('ALERTNOTAUTH'));
}
More advanced acl-functions will come in Joomla 1.2.

Hannes

Re: BC findings during Community Builder testing and adaptation

Posted: Mon Feb 13, 2006 9:35 am
by Hackwar
I forgot:
mosgetparam changed, too. Its now wrapped in JRequest::getVar. Don't know any more about this, Johan just told me.

Re: BC findings during Community Builder testing and adaptation

Posted: Mon Feb 13, 2006 9:49 am
by Beat
Hackwar wrote: Hi Beat,
you wrote that ACL didn't really change, but:
1. The ACL system didn't change from its "roots"
2. There was no update to the phpGACL-API that affects the system.
3. There is a change to the acl_check-function to make transition in the future easier. Since the check is at the moment dependend on $my->usertype and it will change in future versions to $my->id, Louis created a wrapper. The new call would look like this:

Code: Select all

/*
 * Make sure the user is authorized to view this page
 */
$user = & $mainframe->getUser();
if (!$user->authorize( 'com_config', 'manage' ))
{
	josRedirect('index2.php?', JText :: _('ALERTNOTAUTH'));
}
More advanced acl-functions will come in Joomla 1.2.

Hannes
Well, the ACL changed slightly, but sufficiently to break any direct access to the acl tables (as is needed for BC with mambo 4.5.0 API, yes we are stretching far from 4.5.0 up to 1.1)...as some "group_id" and others "xxx_id" columns changed into "id" naming, for reasons unknown to Johan at BC-tests-time. We supposed during our BC-tests that this was due to update to latest phpGACL by Andrew, but we might be wrong. Maybe you have a better explanation of a good reason why the columns changed name between 1.0 and 1.1.

Yes, we noticed also the changes in acl_check, but Louis made them better backwards-compliant during BC-tests.

Yes, I'm noticing and appreciating highly your work on ACL, and also highly appreciating the fact that it's updating will be concentrated into 1 release (1.2).

My wiki article is a first draft... better a start than nothing. ;)

Thanks also for the pointer to mosGetParam, i will recheck. It didn't bother me as it looked BC-compliant :D

Re: BC findings during Community Builder testing and adaptation

Posted: Mon Feb 13, 2006 10:11 am
by Hackwar
When the tables were created, Andrew used the scheme of phpGACL, but changed it a bit, so that it was group_id instead of id. Now, since we want to use the original phpGACL-API without changing, we had to change it back. Those are preparations for the future system. In 1.2, we will delete #__groups and #__usertypes. Most likely we will change #__users and remove the field gid. What we will do with usertype, I don't know. We could remove it or we could use it to store a group-name that is shown for a user in the forum or elsewhere. Besides these changes, we will only add new tables, no further alterations. At least not for user-authentication and access managment.

Re: Community Builder

Posted: Sat Oct 21, 2006 8:12 am
by MJH
Any ideas when CB will be working with 1.5 again?

Re: Community Builder

Posted: Sat Oct 21, 2006 8:16 am
by Tonie
Please read this.

Re: Community Builder

Posted: Sun Oct 14, 2007 3:51 am
by modemlooper
I have been testing 1.5 and 98% of the old extensions do not work so I can't understand why you would praise its backwards compatibility.

Re: Community Builder

Posted: Sun Oct 14, 2007 10:35 am
by Tonie
The code that has been in Mambo/Joomla is old. Through the years, several coding practices came into being. All of these are currently running under Joomla 1.0.x. When creating the legacy layer, some of the older (and less correct) methods do not work any more. It's true that most extensions need a little bit of tweaking to get them running on 1.5. The changes are not big in a lot of cases. My first ever written extension worked in half an hour of tweaking a few minor issues. My first template written worked out of the box. These were written in a time I was learning Mambo and had no prior knowledge in coding for it.