valkyrjan Posted December 10, 2013 Share Posted December 10, 2013 Hi all, I was trying to update Tapatalk (from 3.9 to 4.2) on my forum (phpBB 3.0.12) and I get this error when I get to the external installer link (if anyone here's familiar with Tapatalk?) Fatal error: Cannot redeclare get_tapatlk_location() (previously declared in /forum/mobiquo/include/function_hook.php:4) /forum/mobiquo/hook/function_hook.php on line 62 Here is some of the code from that file, starting at line 50 going down to 62. break; case "viewonline.php": $param_arr['location'] = 'online'; break; default: $param_arr['location'] = 'index'; break; } $queryString = http_build_query($param_arr); $url = generate_board_url() . '/?' .$queryString; $url = preg_replace('/^(http|https)/isU', 'tapatalk', $url); return $url; } Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/284691-fatal-error-help-needed/ Share on other sites More sharing options...
Ch0cu3r Posted December 10, 2013 Share Posted December 10, 2013 The error says the get_tapatlk_location() function has been declared twice. Once in include/function_hook.php on line 4 and a second time in hook/function_hook.php on line 62 (notice the different folder names). The lines of code you have posted is not the problem. You need to remove the duplicate function declaration to clear the errors. Function names should be unique and only be declared once. Quote Link to comment https://forums.phpfreaks.com/topic/284691-fatal-error-help-needed/#findComment-1461983 Share on other sites More sharing options...
BrodaNoel Posted December 10, 2013 Share Posted December 10, 2013 Replace the "include" for "include_once" if only include a file for use their functions. Quote Link to comment https://forums.phpfreaks.com/topic/284691-fatal-error-help-needed/#findComment-1461985 Share on other sites More sharing options...
valkyrjan Posted December 10, 2013 Author Share Posted December 10, 2013 Thanks - I removed the duplicate function from hook/function_hook.php, but then it brings up the same error for a different function in that file. The location function and this second one are the only contents of hook/function_hook.php, so there would be nothing left if I were to remove them both and, since this is supposed to be an automatic update package, I assume it's supposed to be there? Quote Link to comment https://forums.phpfreaks.com/topic/284691-fatal-error-help-needed/#findComment-1461987 Share on other sites More sharing options...
Ch0cu3r Posted December 10, 2013 Share Posted December 10, 2013 Sounds to me hook/function_hook.php is a copy of include/function_hook.php. If you comment out the include/require for hook/function_hook.php does your app continue to function correctly? Quote Link to comment https://forums.phpfreaks.com/topic/284691-fatal-error-help-needed/#findComment-1461990 Share on other sites More sharing options...
valkyrjan Posted December 10, 2013 Author Share Posted December 10, 2013 I checked the include/function_hook and it was exactly the same as the hook/function_hook, so I deleted the former and I could carry on with the install. I think it's working fine now, thanks for the help! Quote Link to comment https://forums.phpfreaks.com/topic/284691-fatal-error-help-needed/#findComment-1461992 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.