Thứ Sáu, 17 tháng 5, 2013

How to add custom filters to components


Overview

This is a how-to on how to add ordering and filtering (search, custom dropdown, state) to a component backend page.
This approach is almost exactly the same for the frontend.
In general, the process of adding a custom field filter breaks down into the following steps:
  • Creating the class that will generate the form dropdown options
  • Adapting the view to display the form dropdown input
  • Adapting the model to retrieve data from DB & to set submission values in the Joomla 'state'. For a better understanding of the code samples, the db table is called 'my_company' and the fields are: id, name, state, company, somefield, someotherfieldtosearchin.

Extend JFormFieldList (models / fields / fieldname.php)

Frequently your filter fields will be very basic; probably simply a dropdown list of one of the columns being displayed on the current page. Regardless, you will need to create your own field element. This really isn't a big deal - this file will probably be less than 70 lines, including comments. The code below will generate the dropdown element to filter by companies. For more information and complex examples on creating this class see Creating_a_custom_form_field_type.
My 'companies' dropdown element:
<?php
 
defined('JPATH_BASE') or die;
 
jimport('joomla.html.html');
jimport('joomla.form.formfield');
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
 
/**
* Custom Field class for the Joomla Framework.
*
* @package Joomla.Administrator
* @subpackage com_my
* @since 1.6
*/

class JFormFieldMyCompany extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/

protected $type = 'MyCompany';
 
/**
* Method to get the field options.
*
* @return array The field option objects.
* @since 1.6
*/

public function getOptions()
{
// Initialize variables.
$options = array();
 
$db = JFactory::getDbo();
$query = $db->getQuery(true);
 
$query->select('id As value, name As text');
$query->from('#__my_companies AS a');
$query->order('a.name');
$query->where('state = 1');
 
// Get the options.
$db->setQuery($query);
 
$options = $db->loadObjectList();
 
// Check for a database error.
if ($db->getErrorNum()) {
JError::raiseWarning(500, $db->getErrorMsg());
}
 
return $options;
}
}
Obviously, there is only one section here that needs to be customized:
                $query->select('id As value, name As text');
$query->from('#__my_companies AS a');
$query->order('a.name');
$query->where('state = 1');
Change the database name and adjust the sql as necessary. This will produce the text and values for the select element options. I highly recommend not changing the value and text names. Although I did not test this theory, it seems likely that ancestor classes are expecting these names as keys in the resulting array.

Modify Model (models / zzz.php)

In your model you have to include these two functions:
//Add this handy array with database fields to search in
protected $searchInFields = array('text','a.name','someotherfieldtosearchin');
 
//Override construct to allow filtering and ordering on our fields
public function __construct($config = array()) {
$config['filter_fields']=array_merge($this->searchInFields,array('a.company'));
parent::__construct($config);
}
 
protected function getListQuery(){
$db = JFactory::getDBO();
$query = $db->getQuery(true);
 
//CHANGE THIS QUERY AS YOU NEED...
$query->select('id As value, name As text, somefield')
->from('#__my_companies AS a')
->order( $db->escape($this->getState('list.ordering', 'pa.id')) . ' ' .
$db->escape($this->getState('list.direction', 'desc')));
 
 
 
// Filter search // Extra: Search more than one fields and for multiple words
$regex = str_replace(' ', '|', $this->getState('filter.search'));
if (!empty($regex)) {
$regex=' REGEXP '.$db->quote($regex);
$query->where('('.implode($regex.' OR ',$this->searchInFields).$regex.')');
}
 
// Filter company
$company= $db->escape($this->getState('filter.company'));
if (!empty($company)) {
$query->where('(a.company='.$company.')');
}
 
// Filter by state (published, trashed, etc.)
$state = $db->escape($this->getState('filter.state'));
if (is_numeric($state)) {
$query->where('a.state = ' . (int) $state);
}
elseif ($state === '') {
$query->where('(a.state = 0 OR a.state = 1)');
}
 
//echo $db->replacePrefix( (string) $query );//debug
return $query;
}
 
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @since 1.6
*/

protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
$app = JFactory::getApplication('administrator');
 
// Load the filter state.
$search = $this->getUserStateFromRequest($this->context.'.filter.search', 'filter_search');
//Omit double (white-)spaces and set state
$this->setState('filter.search', preg_replace('/\s+/',' ', $search));
 
//Filter (dropdown) state
$state = $this->getUserStateFromRequest($this->context.'.filter.state', 'filter_state', '', 'string');
$this->setState('filter.state', $state);
 
//Filter (dropdown) company
$state = $this->getUserStateFromRequest($this->context.'.filter.company', 'filter_company', '', 'string');
$this->setState('filter.company', $state);
 
//Takes care of states: list. limit / start / ordering / direction
parent::populateState('a.name', 'asc');
}
For the frontend: your $app variable looks like this:
  protected function populateState($ordering = null, $direction = null)
{
// Initialise variables.
$app = JFactory::getApplication();

Modify View (views / zzz / view.html.php)

In you view class, you have to set the state, like this:
                $this->items            = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
 
//Following variables used more than once
$this->sortColumn = $this->state->get('list.ordering');
$this->sortDirection = $this->state->get('list.direction');
$this->searchterms = $this->state->get('filter.search');

Modify Template (views / zzz / tmpl / default.php)

Basic

Top of template somewhere:
//Get companie options
JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
$companies = JFormHelper::loadFieldType('MyCompany', false);
$companyOptions=$companies->getOptions(); // works only if you set your field getOptions on public!!
In your template file, this fieldset reflects filter options:
        <fieldset id="filter-bar">
<div class="filter-search fltlft">
<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->searchterms); ?>" title="<?php echo JText::_('Search in company, etc.'); ?>" />
<button type="submit">
<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>
</button>
<button type="button" onclick="document.id('filter_search').value='';this.form.submit();">
<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>
</button>
</div>
<div class="filter-select fltrt">
<select name="filter_state" class="inputbox" onchange="this.form.submit()">
<option value="">
<?php echo JText::_('JOPTION_SELECT_PUBLISHED');?>
</option>
<?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('archived'=>false)), 'value', 'text', $this->state->get('filter.state'), true);?>
</select>
 
<select name="filter_type" class="inputbox" onchange="this.form.submit()">
<option value=""> - Select Company - </option>
<?php echo JHtml::_('select.options', $companyOptions, 'value', 'text', $this->state->get('filter.company'));?>
</select>
 
</div>
</fieldset>
Remark: the name of the select tag must be the same as defined in the populateState function. In the example:
    //populateState function
$state = $this->getUserStateFromRequest($this->context.'.filter.state', 'filter_state', '', 'string');
 
//template
<select name="filter_state" class="inputbox" onchange="this.form.submit()">

Extra: highlighting search terms

Here is some extra to visually mark the found search terms in the results page.

Template

Add this somewhere at top somehwere:
$searchterms = $this->state->get('filter.search');
 
//Highlight search terms with js (if we did a search => more performant and otherwise crash)
if (strlen($searchterms)>1) JHtml::_('behavior.highlighter', explode(' ',$searchterms));
And further in your template, enclose the specific fields with the default highlighter finder.
Example:
<span id="highlighter-start"></span>
<table class="adminlist">
...
</table>
<span id="highlighter-end"></span>

CSS

If your default admin template doesn't have required css, you should add the class in your component css.
Example in controller:
JHtml::stylesheet('com_peopleactions/admin.css', array(), true);
In admin.css:
.highlight {   background: none repeat scroll 0 0 #FFFF00; }

Adding view layout configuration parameters


Background

When creating views for a custom component, you can create a series of .xml files that will both describe the view and allow administrators to configure the view as they require. The .xml files are used by the com_menu core component (ilink.php) to create the menu trees that are shown when an administrator creates a new menu item.

View title and description

First give a title and description to your view. This is done by including a metadata.xml file in the view directory:
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="CAST_VIEW">
<message><![CDATA[CAST_VIEW_DESC]]></message>
</view>
</metadata>
The 'title' element is shown as the 1st level entry under your component name when a new menu item is created. The 'message' element is the descriptive tool tip that is shown when the mouse hovers over the 'title' element. The example is using JText placeholders for the title and message. Just add the corresponding tags to your language definition files. You did create them didn't you?

Hiding a view from the menu

If you don't want this view to be selectable for a new menu item, then add the hidden="true" parameter to the view element (e.g. <view title="CAST_VIEW" hidden="true">). You can also hide a view by using an underscore '_' in the name. Be careful with naming your views or you can spend hours trying to figure out why it doesn't appear in the new menu item tree!

Template names, description, parameters

You can also create .xml files for the individual files in the tmpl folders. This is a cool way to have a name other than 'default' show up in the new menu item tree. Make sure that the name of the .xml file is the same as the name of your template file. I.E. if your file name is default.php, then your xml file name is default.xml. Its probably more productive to name your template files something other than default. That way, when you have 10 of them open in your favorite IDE, you won't get totally confused as to which file you are editing. That also avoids the nightmare of uploading the wrong file to the wrong directory!
These will also be hidden by including an underscore '_' in their name. This is a bit of a gotcha. Also ensure the filenames for these and the layotus are in lower case. CamelCase does not work for these.
Note: To use a temp/layout file name other than 'default', pass a configuration array to the __construct function parent in the view.html file. EG:
        function __construct()  {
$config = array();
$config['layout'] = 'bookslayout';
parent::__construct($config);
}
The .xml file for the template can be very simple with just a title and message or very complex with basic and/or advanced parameters:
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="STANDARD_CATEGORY_LAYOUT">
<message>
<![CDATA[STANDARD_CATEGORY_LAYOUT DESC]]>
</message>
</layout>
<state>
<name>STANDARD_CATEGORY_LAYOUT</name>
<description>STANDARD_CATEGORY_LAYOUT_DESC</description>
<url>
</url>
<params>
</params>
<advanced>
</advanced>
</state>
</metadata>
See components\com_content\views\frontpage\tmpl\default.xml, or components\com_content\views\section\tmpl\default.xml for examples of how to specify both basic and advanced parameters for your views. See also Standard parameter types for information on defining parameters.
You can also add the hidden="true" to the layout element if you don't want this particular template file to be selected as a new menu item.

Final touches

Remember to create JText language definitions for your titles and messages so they can be easily translated. Have fun giving your views cool names and descriptions for that final bit of polish on your custom component!

Creating a toolbar for your component


Note: This applies when using the MVC structure.
By default the Joomla Toolbar uses a Delete, Edit, New, Publish, Unpublish and Parameters buttons. To use them in your component you must write the following code in the view.html.php of your view file (below your display function).
      JToolBarHelper::title( 'your_component_view_page_title', 'generic.png' );
JToolBarHelper::deleteList(); // Will call the task/function "remove" in your controller
JToolBarHelper::editListX(); // Will call the task/function "edit" in your controller
JToolBarHelper::addNewX(); // Will call the task/function "add" in your controller
JToolBarHelper::publishList(); // Will call the task/function "publish" in your controller
JToolBarHelper::unpublishList(); // Will call the task/function "unpublish" in your controller
JToolBarHelper::preferences('your_component_xml_file', 'height');
So (i.e.) your code would look like this:
 class HelloViewHellos extends JView
{
function display($tpl = null) {
global $mainframe, $option;
JToolBarHelper::title( 'Hello Component', 'generic.png' );
JToolBarHelper::deleteList();
JToolBarHelper::editListX();
JToolBarHelper::addNewX();
JToolBarHelper::publishList();
JToolBarHelper::unpublishList();
JToolBarHelper::preferences('com_hello', '500');
An example of creating a custom button in the admin list of records of your component Joomla 3.1 could be:

administrator/views/hellos/view.html.php
        public function display($tpl = null)
{
 
$this->state = $this->get('State');
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
 
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseError(500, implode("\n", $errors));
return false;
}
 
$this->addToolbar();
 
$this->sidebar = JHtmlSidebar::render();
parent::display($tpl);
 
}
 
protected function addToolbar()
{
// assuming you have other toolbar buttons ...
 
JToolBarHelper::custom('hellos.extrahello', 'extrahello.png', 'extrahello_f2.png', 'Extra Hello', true);
 
}
administrator/controllers/hellos.php
    public function extrahello()
{
 
// Get the input
$input = JFactory::getApplication()->input;
$pks = $input->post->get('cid', array(), 'array');
 
// Sanitize the input
JArrayHelper::toInteger($pks);
 
// Get the model
$model = $this->getModel();
 
$return = $model->extrahello($pks);
 
// Redirect to the list screen.
$this->setRedirect(JRoute::_('index.php?option=com_hello&view=hellos', false));
 
}
administrator/models/hello.php (note: the singular model)
    public function extrahello($pks)
{
 
// perform whatever you want on each item checked in the list
 
return true;
 
}

Adding sortable columns to a table in a component


Given that you have a table of data already in your component, how do you make some, or all, of the table columns sortable, like many of them are in the Joomla Administrator? It's not particularly hard to do, but there are several steps required and details you need to be aware of so everything fits together properly. There are variations on the procedure given here and once you are confident that you understand how it all works you should feel free to explore other possibilities that may suit your purposes better.
This procedure assumes that your component is structured according to the Model-View-Controller (MVC) design pattern. The general idea behind the procedure will still be applicable to non-MVC components if you apply a bit of imagination!

Step 1: The Model

Note: Since Joomla 2.5 the populateState of JModelList does pagination and ordering via it's own populateState() and you can skip this part. If you need other states than the parent provides just do a parent::populateState(); in your specific one (and make sure "filter_order" is in your filter_fields config)
The first thing is to add the filter_order and filter_order_Dir request populateState() method of your model. Change 'default_column_name' to the name of the column you want to use as the default sort, and change the filter order direction if you wish Adding this information to the State object here insures it's accessible to all of the code that might need it.
public function populateState() {
$filter_order = JRequest::getCmd('filter_order');
$filter_order_Dir = JRequest::getCmd('filter_order_Dir');
 
$this->setState('filter_order', $filter_order);
$this->setState('filter_order_Dir', $filter_order_Dir);
}

In the model which generates the data that will form the table, you need to make a change to the method which builds the database query that will be used to populate the HTML table. Most often this is the getListQuery() method, but might not be.
The model could pull data in from anywhere; it doesn't have to be a database, but in the vast majority of cases the model will be using the Joomla database API to submit SQL queries to a database. Assuming that to be the case, you need to adjust the query so that the sort parameters are taken into account.
This information gets called by whatever function builds the ORDER BY clause, typically a private function like this:
public function getListQuery() {
$db = JFactory::getDbo();
$query = $db->getQuery(true);
 
// ...
 
$query->order($db->getEscaped($this->getState('filter_order', 'default_sort_column')) . ' ' . $db->getEscaped($this->getState('filter_order_Dir', 'ASC')));
 
return $query;
}
Replace 'default_sort_column' with the column you want to sort by by default. You can also change 'ASC' to 'DESC', depending on which way you want to sort by default.

Step 2: The View

Having generated the sorting variables in the model, you need to assign them to the view so that they show up on the page when it is displayed.
To do this you need to add a few lines of code to your view file, typically view.html.php with code similar to this:
public function display($tpl=null) {
$items = $this->get('Items');
$state = $this->get('State');
 
$this->sortDirection = $state->get('filter_order_Dir');
$this->sortColumn = $state->get('filter_order');
 
parent::display($tpl);
}

Step 3: The Template

Now you need to add some elements to the component layout file. The table must be included in a form. This might already be the case as, for example, you might already have implemented pagination or filtering on the table. But if the table is not yet in a form then now is the time to wrap it in <form> and </form> tags. The reason that a form is required is that the sortable columns rely on a bit of JavaScript that will submit the form with sort parameters added. Naturally, this will involve a page load, so if you would prefer an AJAX-based solution, then this procedure is not for you.
The form tags will look something like this:
<form id="adminForm" action="<?php echo JRoute::_( 'index.php' );?>" method="post" name="adminForm">
 
.... table goes here ....
 
</form>
Notice that the form name must be "adminForm". You may need to adjust the action URL in some cases.
You also need to add a couple of hidden fields to the form. They can be placed anywhere between the <form> and </form> tags, but generally they are placed just before the closing tag, like this:
<form id="adminForm" action="<?php echo JRoute::_( 'index.php' );?>" method="post" name="adminForm">
 
.... table goes here ....
 
<input type="hidden" name="filter_order" value="<?php echo $this->sortColumn; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->sortDirection; ?>" />
</form>
Now look at the table itself. You might have a table with static headings already, looking vaguely like this:
<tr>
<th>Name</th>
<th>Description</th>
</tr>
You need to replace the static column names with calls to the Joomla JHTML static class, so that your code will look something like this:
<tr>
<th><?php echo JHTML::_( 'grid.sort', 'Name', 'DbNameColumn', $this->sortDirection, $this->sortColumn); ?></th>
<th><?php echo JHTML::_( 'grid.sort', 'Description', 'DbDescriptionColumn', $this->sortDirection, $this->sortColumn); ?></th>
</tr>
You will definitely need to adapt this code to your specific requirements. The arguments to the JHTML call are as follows:
  1. Must be 'grid.sort' so that JHTML will insert the correct behaviour for a sortable column.
  2. This is the name of the column that your visitors will actually see. You need to change this for your particular table columns.
  3. This is the name of the corresponding database field (column) that is to be sorted on. This will be passed to the model, most likely so it can be added to an "ORDER BY" clause in the SQL query statement.
  4. Must be exactly as shown here. It is the current order direction (ascending or descending) and comes from the view (see later).
  5. Must be exactly as shown here. It is the name of the column that the table is currently sorted on and comes from the view (see later).
In short, you need to amend the second and third arguments to each JHTML call appropriately.
Finally, if your sortable table is going to be in the front-end of your site, then you need to add a little snippet of JavaScript to the layout. Alternatively, you can add it to the view code (usingJDocument->addScriptDeclaration) if you would rather keep your JavaScript code in the HTML <head> section.
<script language="javascript" type="text/javascript">
function tableOrdering( order, dir, task )
{
var form = document.adminForm;
 
form.filter_order.value = order;
form.filter_order_Dir.value = dir;
document.adminForm.submit( task );
}
</script>
You don't need to add this code if your sortable table is in the Administrator as this code is loaded for you automatically anyway.
This completes the changes you need to make to the layout. JHTML grid.sort will now add a call to the tableOrdering function so that tableOrdering will be called whenever the user clicks on the column header. tableOrdering puts the name of the column that was clicked, and the sort direction, into the hidden form fields and submits the form. In the next step you will see how the model picks up those field values and amends the database query appropriately.

Step 4: Styling the result

Finally. you might want to apply a bit of CSS styling to make the output a bit more attractive.
Selecting the sortable columns can only be done via their context, so you will probably need to add a CSS class to the <table>, the <tr> or to the <th> tags. This is what the output might look like with a class added to the tag:
<tr class="sortable">
<th><a href="javascript:tableOrdering('DbName','asc','');" title="Click to sort by this column">Training provider</a></th>
<th><a href="javascript:tableOrdering('DbDescription','asc','');" title="Click to sort by this column">Location</a></th>
</tr>
To add a bit of space between the column name and the ascending/descending indicator image (a common requirement), you could then apply CSS like this:
tr.sortable th img {
margin-left: 5px;
}

Thứ Năm, 16 tháng 5, 2013

J2.5:Migrating from Joomla 1.5 to Joomla 2.5 Part4


Clean the Database

This procedure is optional. In the process of migration using jUpgrade, the MySQL database has grown. At the end of the migration, the old tables and some newly-acquired tables are no longer needed.

Verify the Database Prefix

In your new site's Administrator, open the Global Configuration page. Then select the Server tab and look in the Database Settings area for the Database Tables Prefix field. Any tables with that prefix must not be removed during the following cleaning operations.

Use PHPMyAdmin to Remove Excess MySQL Tables

  1. Backup the database by Exporting it. If you Drop essential tables, your site will break. Be prepared to Import the database backup and start over.
  2. In the database Structure display, check and then Drop the tables with the "jupgrade_" prefix.
  3. Test your site. If it still functions, continue. If not, restore the database by Importing it.
  4. Check and drop tables associated with your old Joomla 1.5 site. Those usually have the "jos_" prefix.
  5. Test your site again. If all is well, continue.
  6. Verify that the remaining tables have the prefix noted earlier on your site's Global Configuration page. Remove any additional tables without that prefix.
  7. Site still working? If so, you're done with this procedure.

How to Manually Migrate Joomla

If Jupgrade did not work out for you like many of us, you might want to consider manual upgrade. Be warned, however, that this process is very tedious (especially see step 6 below), and the procedure is not well tested as of yet (if at all). So just like the Jupgrade method, you will want to backup your database just in case. Before upgrading you should check to make sure every extension you want is Joomla 2.5 compatible. Also back up your directory files just in case and keep a list of the extensions you used.
Now onto the upgrade; please note that the following procedure should only be chosen if all else fails, and requires a good working knowledge of MySQL! See the last paragraph of this section for a possibly less tedious alternative to doing steps 1, 2, 6 and 7) :
Step 0: First of all, as always before big changes, backup all your data; that includes all files as well as exporting all database tables.
Step 1: If you want, you can convert the prefixes of all the tables in your database. This is especially useful if you would like to keep your 1.5 database in parallel to your new installation, at least for the transition period. It is best done using a script; the "MySQL Table Prefix Changer Tool" available at Nilop is one that worked well.
Note: Executing this script will stop your old site from working because after the prefix conversion, your old installation can't access the database anymore (it will still try to access the tables by their old prefix)! If you wish to re-enable your old Joomla installation, wait until the script has finished and import the database you exported in step 0.
In order to run the script, first upload it via FTP to the root of your site. Now you can launch it by pointing your browser at Mysite.com/prefix.php (assuming you named the script "prefix.php"). The script will ask you for several pieces of information before it can do its job. Among them is of course the new prefix you wish to use for the new version of Joomla. Joomla 1.5 defaults to a prefix of "jos" -- whatever prefix you choose make sure it is different from that; we recommend "jml" or "j16", for example. Once you have filled in all the information, the script is ready to perform the prefix conversion.
Changer.JPG
Notice in the following screen shot that the table prefix of our Joomla 1.5 installation is "jos":
Tables.JPG
For Joomla 2.5 you want it converted to "jml" as seen here:
Prefix.JPG
Step 2: Export all the database tables you would like to use on your Joomla 1.6+ site. Usually this corresponds to content and components.
Export.JPG
Step 3: Uninstall your old site including the database, files, and directories that are associated with Joomla. Or if you would rather just test the upgrade, skip this step and create a new directory for your joomla 2.5 installation.
Step 4: Install the new version of Joomla via FTP or cPanel. If you have no database associated with it, install a new database and user.
Step 5: Install upgraded components and other extensions you used before onto your new Joomla 2.5 site. This should be done now to prevent your old database tables from getting overwritten later.Note: It is possible that some developers made changes to the SQL schema of individual tables when they upgraded their extension to joomla 2.5. We recommend that you check the documentation for each extension you had installed on your old Joomla site and for which you install an upgrade into your new Joomla site concerning special database upgrade considerations.
Step 6: Convert the table schemas in the .sql file you exported in step 2 (containing your Joomla 1.5 tables) such that they are compatible with the version of Joomla! you are upgrading to. This is a very tedious process - you'll have to check the database schemas for changes between the version of Joomla you're upgrading from and the 2.5 version you're upgrading to, and modify the SQL file accordingly. Note: This step could use a more detailed description, if you have ever done a manual Joomla migration, please help and share your experiences and knowledge here!
Step 7: Import the upgraded .sql file into your Joomla 2.5 database.
Keep the following in mind: It is possible for settings to get lost depending on how each component stored them. From personal experience it worked just fine, but you may want to review the settings of each component.
For an easier way to migrate articles, categories/sections, contacts, images, and users, be sure to use J2XML for exporting and J2XML Importer for importing the data.

Troubleshooting

  • Verify that you have PHP version 5 or later. (use phpinfo() or /usr/bin/php --version)
  • jUpgrade cannot download Joomla x.y package? - When the download fails (timeouts, JavaScript issues, etc.) you can download it manually here: Browse Releases at Joomlacode.org. Put the downloaded file into your ROOT/tmp directory. Then, in the preferences of jUpgrade, you must set 'Skip Download' to 'Yes'. After that, run the jUpgrade again.
  • Are you getting errors with the progress bar in Internet Explorer (Windows XP)? - Use the Firefox browser: http://www.mozilla.com/en-US/firefox/
  • Go through the Requirements and Before You Get Started sections above and double check everything!
  • Report Bugs: http://matware.com.ar/foros/jupgrade.html
  • Support: http://matware.com.ar/foros/jupgrade.html

Check for Override Errors

Turn on debug feature: Administrator > Site > Global Configuration > System > Debug Settings > Debug System > Yes.
Load a page of the Website. Any errors? If you see any errors reported or if the content does not appear, remember that overrides must also be edited when moving from version 1.5 to later versions.
Does your (custom) template have an html directory? If yes, that indicates the presence of overrides. You can quickly check whether overrides are causing problems. Temporarily rename thetemplates/<template_name>/html directory.
Another method to locate template problems is to switch to one of the templates provided in the core distribution of Joomla such as Beez.

How You Can Contribute and Help

Creating an extension as significant as jUpgrade requires an enormous amount of time and effort considering the major structural changes between Joomla 1.5 and the later versions. Add to this the fact that during each release of Joomla 1.6 betas, the extension would have to be modified to work with the new changes between releases, and all of a sudden it's too hard for any one person to complete in a short period of time (especially when you are not being paid).
With this being said, it's time to step up and make a difference, whether big or small. Have you profited from Joomla in the last year? Are you excited about the future of Joomla? Would you like to contribute back and show your gratitude? Now you can in this project! We, as part of the Joomla community, are calling on the entire Joomla community to help out in whatever way you can. You don't have to be a master developer, just go through this tutorial on a test site and if you come across any bugs, report it. If you know how to fix it, create a patch for it. If you are a master developer, step up to the challenge.