vtigerCRM-Spain::Upgrade vtlib modules

Changes from 5.1.0 to 5.2.0

  • CallRelatedList
    • minor translation
    • new related list functionality
  • DetailViewAjax
    • new related list functionality
  • DetailView
    • new widget button support !!!
    • new related list functionality
  • EditView
    • minor translation
  • ListView
    • fix 5.1.0 navigation error
    • query and search performance enhancements
    • multi-page selection support !!!
    • custom link support !!!
  • ModuleFile
    • getListQuery enhancement to support multiple relations between modules (fixes elegantly an error on 5.1.0)
    • query and search performance enhancements

Ok, now that we know what has changed we can proceed to upgrade our modules.

Create new install module from existing module

  • unzip the module file
  • compare each of the scripts above with a standard vtlib/ModuleDir/5.1.0
    • If the script is the same (it wasn't modified for any reason), overwrite it with the same file in vtlib/ModuleDir/5.2.0
    • If the script is different you have to manually and intellectually merge the changes.
    • ModuleFile is always going to be different. I would recommend starting from the 5.2.0 version and moving over the necessary changes. In general, you should be able to directly copy the whole first part of the class, up to the first function
  • if your module requires base code modifications for any reason, you must now review those changes against the new version to see which of them are still needed and how to apply them to create a new patch. This step also requires intellectual attention.
  • manually modify the manifest file. Basically change the version
  • reached this point
    • zip your modified module file
    • test install and functionality on a fresh 5.2.0 install
    • fix and repeat until it works
  • test it again :-)

Create upgrade module from existing module

I thought that an upgrade module would be necessary, but from the little testing I have done it seems that the same install module file obtained by the above procedure serves as the necessary update module. So, if you upgrade an install with a vtlib module installed, once on the migrated install you only have to activate the module and update through the module manager. When asked for the file you give it the file you prepared in the previous procedure.

Obviously you must upgrade the modules version number.

Changes from 5.2.0 to 5.2.1

Only the ListView.php file has changed with a small enhancement. As in the procedure before, if you have not modified this file in your module then just overwrite and zip it again to have your module upgraded. If you have modified the file for any reason this is the change you will manually have to add:

Index: vtlib/ModuleDir/5.2.0/ListView.php
===================================================================
--- vtlib/ModuleDir/5.2.0/ListView.php	(revisión: 3580)
+++ vtlib/ModuleDir/5.2.0/ListView.php	(copia de trabajo)
@@ -33,6 +33,10 @@
 
 $focus = new $currentModule();
 $focus->initSortbyField($currentModule);
+
+if(ListViewSession::hasViewChanged($currentModule,$viewid)) {
+	$_SESSION[$currentModule."_Order_By"] = '';
+}
 $sorder = $focus->getSortOrder();
 $order_by = $focus->getOrderBy();
 

Changes from 5.2.1 to 5.3.0

  • index.php
    • minor change in verification function
  • ListView.php
    • minor change in verification function
  • Save.php
    • minor change in verification function
  • EditView.php
    • major change which makes all edit view functionality common among all modules and based on a shared version in modules/Vtiger, fundamentally to support new picklist dependency extension but also has some other minor changes

Create install or upgrade module from existing module

  • unzip the module file
  • compare each of the scripts above with a standard vtlib/ModuleDir/5.2.0
    • If the script is the same (it wasn't modified for any reason), overwrite it with the same file in vtlib/ModuleDir/5.3.0
    • If the script is different you have to manually and intellectually merge the changes.
      • The three files, index.php, ListView.php and Save.php are very simple. Edit these files in your module and change
        checkFileAccess(...)

        which can be found at the beginning of the script for

        checkFileAccessForInclusion(...)
      • If your EditView.php script is different, then I would recommend you copy modules/Vtiger/EditView.php into your module's vtlib EditView.php in place of the include directive that is there and then compare and add in your changes depending on what is needed
  • if your module requires base code modifications for any reason, you must now review those changes against the new version to see which of them are still needed and how to apply them to create a new patch. This step also requires intellectual attention.
  • manually modify the manifest file. Basically change the version, very important if you want to be able to upgrade prior versions
  • reached this point
    • zip your modified module file
    • test install and functionality on a fresh 5.3.0 install
    • fix and repeat until it works
  • test it again :-)

Changes from 5.3.0 to 5.4.0

  • language/xx_xx.lang.php
    • add
      'ModuleName ID' => 'Module Name ID',
  • FindDuplicateRecords.php
    • minor change in require theme layout file
  • ListView.php
    • major change which makes all list view functionality common among all modules and based on a shared version in modules/Vtiger
  • MassEdit.php
    • major change which makes all mass edit functionality common among all modules and based on a shared version in modules/Vtiger
  • manually modify the manifest file. Basically change the version, very important if you want to be able to upgrade prior versions

Changes from 5.4.0 to 6.0.0

It is not worth trying to describe all the changes. vtiger CRM 6.0.0 is a whole new application, it has been totally rewritten and almost everything has changed. In the major part for better, but it still requires a lot of testing and adapting.

Create install or upgrade module from existing module

  • create a new directory where we will setup the new module
  • unzip the 5.4.0 module file
  • copy the manifest.xml file to the new directory
  • edit the manifest.xml file and change the version numbering and licensing dates
    • it is important to put the vtiger version like this:
      <vtiger_version>6.0.0</vtiger_version>
  • you will most probably have to make some changes in the related lists and customlinks if you have any, but we'll get to that later
  • in our new directory create a subdirectory called “languages”
  • inside languages create a directory for each language file supported
  • copy each language file from you 5.4.0 into it's corresponding directory in the new structure and rename it to the same name of your module
  • edit each language file and change the name of the variable from $mod_strings to $languageStrings
  • create new subdirectory modules/<modulename>
  • copy inside vtlib/ModuleDir/6.0.0/ModuleName.php to modules/<modulename>
  • rename vtlib/ModuleDir/6.0.0/ModuleName.php to <modulename>.php
  • compare your main module's file from the 5.4.0 version and copy over the required definitions to <modulename>.php
  • this is the minimum required for a funtional module in 6.0. if your module has no changes you should be done
  • compare your modules base files with a standard vtlib/ModuleDir/5.4.0
    • If the script is the same (it wasn't modified for any reason), completly ignore it
    • If the script is different you have to manually and intellectually find a way to implement the same functionality in vtiger CRM 6.0. I really can't say much more here as everything has changed so each change will require it's own set of solutions.
  • if your module requires base code modifications for any reason, you must now review those changes against the new version to see which of them are still needed and how to apply them to create a new patch. This step also requires intellectual attention.
  • reached this point
    • zip your modified module file
    • test install and functionality on a fresh 5.3.0 install
    • fix and repeat until it works
  • test it again :-)