Welcome Guest, Not a member yet? Register   Sign In
CI4 App unable to locate helper on the cloud
#1

Hi,

I developed an app using version 4.1.8. I tested my app locally in my PC with Xampp and it worked fine. When i tested the same app using my hosting provider i get the following odd results and the app broke:
(1) I set the URL as  follows:
Code:
CI_ENVIRONMENT = development

#--------------------------------------------------------------------
# APP
#--------------------------------------------------------------------

app.baseURL = 'https://seekspacetime.com/ci4admin-access/'
# app.forceGlobalSecureRequests = false

# app.sessionDriver = 'CodeIgniter\Session\Handlers\FileHandler'
# app.sessionCookieName = 'ci_session'
app.sessionExpiration = 0
# app.sessionSavePath = null
# app.sessionMatchIP = false
# app.sessionTimeToUpdate = 300
# app.sessionRegenerateDestroy = false

# app.CSPEnabled = false

#--------------------------------------------------------------------

I got the error stating the app is unable to locate the first helper function when the helper exists:
Code:
Error

Call to undefined function App\Controllers\Auth\validate_appuser()

APPPATH/Controllers/Auth/UserMgmtController.php at line 67

60            if (!password_verify($params['password'], $userdbdata["password"])) {
61                $data['validation'] = '<h3>Error, Please login with correct credentials..</h3>';
62                return view('auth/login_view', $data);
63            }
64
65            // Validate and get details from Appuser
66
67            $statusInfo = validate_appuser(trim($params['username']));
68            // d($statusInfo);
69            if (!$statusInfo['goodstatus']) {
70                $action = $statusInfo['action'];
71                $message = $statusInfo['data'];
72                $data['validation'] = "<h3>$action</h3><p>$message</p>";
73                return view('auth/login_view', $data);
74            };

(2) Change the Base URL back to my local pc "http://localhost/MyDevelop/ci4admin-access" it appears to work only problem was it was running the code from my local PC which should not happen.
I tried the test using different PCs and Browers and all resulted in the same error. Am i defining something wrong in the env file?

http://localhost/MyDevelop/ci4adminx-model/
Reply
#2

Hi,

Please ignore this post. I resolved the issue. It was a case-sensitive issue again. I my windows PC, the helper Common_helper as defined as 'common' in the BaseController. This worked fine for windows but did not work well for Linux installs. The helper had to be defined exactly with case format.

Thank you to all who were trying to look at this problem.
Reply
#3

Good to hear.
Case-sensitive issue is a common problem on Windows and macOS.
I recommend to use always exact the same case letters.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB