
Originally Posted by
ladyink
Well, Now I have the very same issue. I'm getting error:
Fatal error: Call to undefined function: init_template() in /catalog/admin/module_manager.php on line 14
I too am experiencing this problem. I am testing this on my local machine using XAMPP. I believe that I have narrowed it down to the init_yclass.php file.
When I first install Module Manager everything installs and works perfectly. Then when I install the Just Another Cross-Sell Module, overwriting the config.yclass.php and init_yclass.php files, I get the error mentioned above. However, if I don't overwrite the two mentioned files, then it "appears" to work properly.
I then did some digging into the files and noticed that the confi.yclass.php files that are in the Module Manager and the Cross-Sell Module are identical. However the init_yclass.php files are different.
Here is what the init_yclass.php file contains for the Module Manager:
Code:
<?php
require_once(DIR_FS_CATALOG.'includes/init_includes/init_yclass.php');
?>
Here is what the init_yclass.php file contains for the Just Another Cross-Sell Module:
Code:
<?php
// y stands for yellow1912 :p. I simply add this to store all the functions frequently used in my mods
// PHP4 always pass object by value (default) while PHP5 pass by reference
if (version_compare(phpversion(), '5.0') < 0) {
eval('
function clone($object) {
return $object;
}
');
}
class yclass{
function db_result_to_string($glue, $db_result){
$temp_array = array();
if($this->is_obj($db_result,'queryFactoryResult')){
// We need to clone, because we don't want to touch the real object
while(!$db_result->EOF){
$temp_array[] = $db_result->fields['products_'.XSELL_FORM_INPUT_TYPE];
$db_result->MoveNext();
}
$db_result->Move(0);
$db_result->MoveNext();
}
return implode($glue,$temp_array);
}
// This function does not work for all languages! BEWARE
function array_to_upper(&$entries){
foreach($entries as $entry){
$entry = strtoupper($entry);
}
}
// http://us3.php.net/manual/en/function.is-object.php#66370
function is_obj( &$object, $check=null, $strict=true ){
if (is_object($object)) {
if ($check == null) {
return true;
} else {
$object_name = get_class($object);
return ($strict === true)?( $object_name == $check ):( strtolower($object_name) == strtolower($check) );
}
} else {
return false;
}
}
}
?>
Why is it that when I write over the init_yclass.php file that the Module Manger with the one from the Just Another Cross-Sell Module, I receive the error mentioned above? I was assuming that this file should be written over once we copy the Just Another Cross-Sell Module files over into our installation.
I am confused on the proper way to install this module and I would greatly appreciate any help on how to do this install.
Thanks,
Chris
Bookmarks