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

Component aliases not always found. #183

Closed
gin0115 opened this issue Jan 4, 2024 · 1 comment · Fixed by #184, #185 or #186
Closed

Component aliases not always found. #183

gin0115 opened this issue Jan 4, 2024 · 1 comment · Fixed by #184, #185 or #186

Comments

@gin0115
Copy link
Contributor

gin0115 commented Jan 4, 2024

When an alias is added via a 3rd party module, isset() sometimes fail, this should be replaced with array_key_exists()

@gin0115
Copy link
Contributor Author

gin0115 commented Jan 4, 2024

in get_component_path() of Component_Compiler class, change

if ( \isset( $this->component_aliases[get_class( $component ) ] ) ) {
   return esc_attr( $aliases[ get_class( $component ) ] );
}

to

if ( \array_key_exists( get_class( $component ), $this->component_aliases ) ) {
   return esc_attr( $aliases[ get_class( $component ) ] );
}

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