Avoiding Mod Conflicts

From TNG_Wiki
Revision as of 09:58, 23 February 2011 by KenRoy (talk | contribs) (moved to TNG Mod Manager category)
Jump to navigation Jump to search

The easiest way to avoid a conflict sometimes is to insert a new line for the needed global rather than replacing an existing global line.

For example, the Edit User Profile Mod conflicts with the Site Menu Mod and potentially other personal mods that add entries to the drop down menu list.

The conflict in the Edit User Profile mod can be resolved by changing the following in the config file

%target:genlib.php%
%location:%
function tng_icons( $instance ) {
global $text, $allow_admin_db, $chooselang, $languages_table, $mylanguage, $tngconfig, $cms, $tngprint, $mediatypes, $languages_path;
%end:%
%replace:%
function tng_icons( $instance ) {
global $text, $allow_admin_db, $chooselang, $languages_table, $mylanguage, $tngconfig, $cms, $tngprint, $mediatypes, $languages_path, $currentuser;
%end:%

to use the following

%target:genlib.php%
%location:%
function tng_icons( $instance ) {
global $text, $allow_admin_db, $chooselang, $languages_table, $mylanguage, $tngconfig, $cms, $tngprint, $mediatypes, $languages_path, $templatepath;
%end:%
%insert:after%
global $currentuser;  // Edit User Profile mod
%end:%


Likewise the conflict in a personal mod to the drop down menu list was resolved by inserting a new global line

global $currentuser;  // Drop down menu mod

Note that the comments on the global line insert are necessary to avoid the Mod Manager returning a Not Unique error if only the global variable were inserted.