joomla/joomla-cms — pull request #5472 by mbabker (2014-12-19 18:24:20+00:00)
Title: Namespace install app field/rule classes

### Issue

The installation app contains a `JFormFieldLanguage` class which has demonstrated previously why we cannot make the core `JFormField` classes autoloadable (see https://github.com/joomla/joomla-cms/pull/3116).

### Solution

`JForm` supports namespacing of classes by a dotted notation in the `type` attribute of a field's XML declaration. In this case, `type="language"` expects to load an instance of `JFormFieldLanguage` (which is a duplicated class). Using namespacing, we can use `type="installation.language"` to ask `JForm` to load a class named `InstallationFormFieldLanguage`.

### Additional Changes

Instead of only moving the problem class in the install app, I've instead moved all of the custom `JFormField` and `JFormRule` classes in the install app to use the `Installation` class prefix versus `J`. This allows us to demonstrate within core this feature of `JForm` (which truthfully isn't presented very well) and demonstrate that custom field elements can be loaded without the use of `addfieldpath` and `addrulepath` attributes in the form XMLs, which should be a preferred behavior in code that is autoloadable (such as the installation application).

### Testing Instructions

As this requires testing the installer, the patch tester can't be used (feasibly anyway) to apply this patch. So you'll need to apply the patch using a git client or you can download a full Joomla package via GitHub at https://github.com/mbabker/joomla-cms/archive/InstallLanguageField.zip. Once applied, simply test installing a new Joomla instance; everything should work as before.

### Backward Compatibility

Typically, the installation application has been excluded from backward compatibility concerns as the app is only used for new Joomla installations and the code immediately removed from a site. Therefore, class proxies or other practices used in the libraries or components are not applied here.