CMS MADE SIMPLE FORGE

ListItExtended

 

[#9429] Allow ability to override upgrade of instance class

avatar
Created By: Mike Crowe (drmikecrowe)
Date Submitted: 2013-07-25 22:38

Assigned To: Tapio Löytty (Stikki)
Resolution: Won't Fix
State: Open
Summary:
Allow ability to override upgrade of instance class
Detailed Description:
In 1.4, the instance class file is upgraded when the main Listit2 is upgraded.

My instance class is something like:

class ListIt2MobileList extends ListIt2 {
....
}

For instance, I needed to add some routes to an instance for custom custom URL
redirects.  I added the action.redirect.php in the new instance directory, added
a new GetVersion() function to indicate this was a different version, and added
something like this to this instance class:

	public function InitializeFrontend() {
.....
		// Custom
$this->RegisterRoute('/' . $this->prefix .
'\/redirect\/(?P<returnid>[0-9]+)\/(?P<item>[0-9]+?)\/(?P<returnpage>.+?)$/',
array('action' => 'redirect'));
....
        }

ListIt2 is prone to upgrade this file regularly and overwrite my changes.

Is there an easier way to avoid this?  I ended up deleting the Instance
reference in the listit2_instances DB table, and am managing this new instance
as a generic module.

TIA
Mike

History

Comments
avatar
Date: 2013-07-26 09:34
Posted By: Tapio Löytty (Stikki)

Yo,

Nope there is no way to fix this. This is only file that gets overwritten each
time you upgrade LI2 modules.

I have no intention to change this behavior, maybe writing own API
functionalities that makes customizing easier, but this won't change.

Image folder will be removed at some point, and moved to framework folder, so
that part gets easier.

I just added capability to overwrite actions inside instance modules, so you can
overwrite basically all actions if you want.

read order: module_custom -> instance -> framework.

Class is just impossible cause i need something to control this stuff. Sorry.
      
Updates

Updated: 2013-07-26 09:34
resolution_id: => 8
assigned_to_id: 100 => 11306