Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning: Undefined array key "createRoute" #64

Open
cBeyerDK opened this issue Jun 2, 2021 · 2 comments
Open

Warning: Undefined array key "createRoute" #64

cBeyerDK opened this issue Jun 2, 2021 · 2 comments

Comments

@cBeyerDK
Copy link

cBeyerDK commented Jun 2, 2021

When I go to the website i just get this message
image

@bugsfixing
Copy link

same

@AgentBUB
Copy link

AgentBUB commented Sep 21, 2021

Here is what I did to fix that error:

// look if hooks existing
if (is_countable(self::$plugins[$hook] ?? null) && count(self::$plugins[$hook] ?? 0) != 0) {
// go throug all plugins
foreach (self::$plugins[$hook] as $name) {
// check if params are given
if (!is_array($params)) {
// call plugin without params
call_user_func([$name, $hook]);
} else {
// call plugin with params
call_user_func_array([$name, $hook], $params);
}
}
}

I'll be honest though, I'm not sure if it is the best fix, but seemed to work.
I just used a Null Coalesce Operator and did a check if the array is countable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants