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

Uncaught Error: Call to undefined function is_plugin_active() #46

Closed
bobbingwide opened this issue Aug 4, 2021 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@bobbingwide
Copy link
Owner

Fatal error: Uncaught Error: Call to undefined function is_plugin_active() in C:\apache\htdocs\wordpress\wp-content\plugins\oik-blocks\oik-blocks.php:408

  | Stack trace:
  | #0 C:\apache\htdocs\wordpress\wp-content\plugins\oik-blocks\oik-blocks.php(316): oik_blocks_check_server_func('shortcodes/oik-...', 'oik-fields', 'bw_metadata')
  | #1 C:\apache\htdocs\wp55\wp-content\plugins\gutenberg\lib\compat.php(132): oik_blocks_dynamic_block_fields(Array, '', Object(WP_Block))
  | #2 C:\apache\htdocs\wp55\wp-includes\class-wp-block.php(221): {closure}(Array, '', Object(WP_Block))
  | #3 C:\apache\htdocs\wp55\wp-includes\class-wp-block.php(211): WP_Block->render()
  | #4 C:\apache\htdocs\wp55\wp-includes\blocks.php(864): WP_Block->render()
  | #5 C:\apache\htdocs\wp55\wp-includes\blocks.php(902): render_block(Array)
  | #6 C:\apache\htdocs\wp55\wp-content\plugins\gutenberg\build\block-library\blocks\template-part.php(89): do_blocks('<!-- wp:group {...')
  | #7 C:\apache\htdocs\wp55\wp-content\plugins\gutenberg\lib\compat.php(132): gutenberg_render_block_core_template_part(Array, '', Object(WP_Block))
  | #8 C:\apache\htdocs\wp55\wp-includes\class-wp-block.php(221): {closure}(Array, '', Object(WP_Block))
  | #9 C:\apache\htdocs\wp55\wp-includes\blocks.php(864): WP_Block->render()
  | #10 C:\apache\htdocs\wp55\wp-includes\blocks.php(902): render_block(Array)
  | #11 C:\apache\htdocs\wp55\wp-includes\block-template.php(171): do_blocks('<!-- wp:html --...')
  | #12 C:\apache\htdocs\wp55\wp-includes\template-canvas.php(12): get_the_block_template_html()
  | #13 C:\apache\htdocs\wp55\wp-includes\template-loader.php(106): include('C:\\apache\\htdoc...')
  | #14 C:\apache\htdocs\wp55\wp-blog-header.php(19): require_once('C:\\apache\\htdoc...')
  | #15 C:\apache\htdocs\wp55\index.php(17): require('C:\\apache\\htdoc...')
  | #16 {main}
  | thrown in <b>C:\apache\htdocs\wordpress\wp-content\plugins\oik-blocks\oik-blocks.php</b> on line <b>408</b><br />
@bobbingwide bobbingwide added the bug Something isn't working label Aug 4, 2021
@bobbingwide
Copy link
Owner Author

I got this again during the refactoring of the oik-blocks/fields block. The line number in oik-blocks.php is quite different due to the refactoring.

@bobbingwide bobbingwide self-assigned this Aug 12, 2021
@bobbingwide
Copy link
Owner Author

The pragmatic fix is to load the logic if it's missing.
eg in oik_blocks_check_server_func() add the following code.

if ( !function_exists( 'is_plugin_active') ) {
		require_once ABSPATH . 'wp-admin/includes/admin.php';
	}

@bobbingwide
Copy link
Owner Author

Fix was committed in 4e760d3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant