Overrides

Started by logicalstep on 7 Feb 2011, 10:36 PM · Views: 1,487

Results 1 to 10 of 10
7 Feb 2011, 10:36 PM
#1
logicalstep avatar

logicalstep

New Zenner

Join Date:
Jan 2011
Posts:
44
Plugin Contributions:
0

Overrides

Hi all,

I'm still here! Learning lots.

I have a Q about the overrides system.

I get what the overrides system if for; so that you don;t break core files customising, when there is an update. All good an well.

But is it me or do some mods not fully use overrides and actually place files in areas that aren't in YourTemplate/Somthing/

For example:

The Zen lightbox (very cool mod BTW, thanks Dev)

It says in the instructions:

4.Upload the entire contents of the includes folder to your server, again keeping the file structure intact. (Note: All files make use of the overrides system.)

Well clearly not ALL files make use of the override system as I also have a classes and function folders to upload which don;t sit within an override folder.

Is this purely down to the fact that Zen cart hasn't included these folder locations when it looks for overrides in the system yet? and to get some working you just need to place them in a non- overridden directory?

I've had a couple other Mods require this as well and I'm just worried I'm going down a slippery path for when I need to upgrade to the next version, it also makes backing up just my override files an impossibility.

Hope someone can explain for me...many thanks in advance.

Logicalstep

to be able to get some of these

7 Feb 2011, 10:42 PM
#2
donal avatar

donal

Zen Follower

Join Date:
Jan 2009
Location:
Ireland
Posts:
442
Plugin Contributions:
0

Re: Overrides

Basicaly when upgrading zen will only update files that are part of the original core setup so if you have mods that alter rather than add files you would have to redo those in an upgrade unless the mod makes it into the core setup and then it would be upgraded to.

7 Feb 2011, 10:49 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Overrides

The /includes/functions/ folder has an /extra_functions/ subfolder where additional files can go and be autoloaded. There are a few other "override" type places which are not template-specific.

8 Feb 2011, 5:06 PM
#4
logicalstep avatar

logicalstep

New Zenner

Join Date:
Jan 2011
Posts:
44
Plugin Contributions:
0

Re: Overrides

So I guess that's my point, now having modified files in folder other than those which are overridden, means I have to hunt down all the files I've modified and replace them after an upgrade.
Doesn't this kind of make the overrides system a bit redundant?

Thanks again

Logicalstep

8 Feb 2011, 5:22 PM
#5
donal avatar

donal

Zen Follower

Join Date:
Jan 2009
Location:
Ireland
Posts:
442
Plugin Contributions:
0

Re: Overrides

no.. only if you have modified the core files themselves regardless of the folder.

8 Feb 2011, 5:23 PM
#6
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Overrides

A new version may have changed the files you already have in the override folder. So that means you have to also merge the updated files with your override files.

Upgrading is a complicated process if you have a lot of modified files in the override folders.

Override system to allow you to edit the files for your own need without having to replace Zen Cart original files. In case something goes wrong with you edited file you can always go back to Zen Cart original file and start over instead of having to download the whole shopping cart files again.

This is pretty common thing with all shopping cart and CMS.

8 Feb 2011, 5:31 PM
#7
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Overrides

The point of the overrides system is NOT having to "hunt down" your changes. Your changes are in your override folders. You only have to compare the contents of the files in your override folders to the latest version of the same files and integrate the changes.

Mods/add ons may involve editing core files because an override isn't possible. For those, I create an override folder anyway and keep a copy of the changed file there. It won't be used by Zen Cart, but it helps me keep track of what I modified and what I need to look at when upgrading.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

8 Feb 2011, 5:45 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Overrides

That's a good idea, keeping a "non-override" folder for changed core files as a reference.

The point I was making about /extra_functions/ etc. is that files there are overrides, or else additional code, and will not be touched by an upgrade. So nothing to hunt down and replace in any case.

9 Feb 2011, 12:39 PM
#9
logicalstep avatar

logicalstep

New Zenner

Join Date:
Jan 2011
Posts:
44
Plugin Contributions:
0

Re: Overrides

I get you, so I'm write about there being files that are added outside of the override system, but it doesn't matter because they are also outside the core system Zen Cart system. Makes sense.

Great idea about creating an override file for the modded file.

I guess it would also be a good idea to create a spread sheet listing all the mods you have installed and any no override folders they have files installed in. I think I'll do this as I can see it being useful for trouble shooting.

I wonder if, even though some mods use folders that aren't in the core system, if there could be a stipulation that mods have to use overridden folder name for any additional files?

Or even if the next release could enable a switch for checking non core file directories for overridden files.
This way people will always know that YourTemplate file is the only place where a mods can place files?

I have a feeling that kind of system would be a major implementation.

Many thanks for the answers.

Logicalstep

9 Feb 2011, 1:18 PM
#10
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Overrides

Yes it would be a major implementation and could bloat the code more than necessary. Mods usually have their own set of folders/files which act just like the override folders/files, but the mod is the only one that uses them.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey