Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

PHP fatal error in plugin activation #99

Closed
ernilambar opened this issue Feb 13, 2019 · 8 comments
Closed

PHP fatal error in plugin activation #99

ernilambar opened this issue Feb 13, 2019 · 8 comments
Assignees
Labels
Type: Bug There is a bug in the plugin.

Comments

@ernilambar
Copy link
Member

Fatal error: Uncaught TypeError: Return value of Theme_Sniffer\Assets\Assets_Handler::add() must be an instance of Theme_Sniffer\Assets\void, none returned in /var/www/review.dev/public_html/wp-content/plugins/theme-sniffer/src/assets/class-assets-handler.php:35 Stack trace: #0 /var/www/review.dev/public_html/wp-content/plugins/theme-sniffer/src/assets/assets-awareness-trait.php(41): Theme_Sniffer\Assets\Assets_Handler->add(Object(Theme_Sniffer\Assets\Script_Asset)) #1 /var/www/review.dev/public_html/wp-content/plugins/theme-sniffer/src/admin-menus/class-base-admin-menu.php(33): Theme_Sniffer\Admin_Menus\Base_Admin_Menu->register_assets() #2 /var/www/review.dev/public_html/wp-content/plugins/theme-sniffer/src/class-plugin.php(136): Theme_Sniffer\Admin_Menus\Base_Admin_Menu->register() #3 [internal function]: Theme_Sniffer\Core\Plugin->Theme_Sniffer\Core{closure}(Object(Theme_Sniffer\Admin_Menus\Sniff_Page), 1) #4 /var/www/review.dev/public_html/wp-content/plugins/theme-sniffer/src/class-plugin.php(137): array_walk(Array, in /var/www/review.dev/public_html/wp-content/plugins/theme-sniffer/src/assets/class-assets-handler.php on line 35

@ernilambar
Copy link
Member Author

@dingo-d
Copy link
Member

dingo-d commented Feb 13, 2019

I've updated the zip file, can you try again?

Thanks 🙂

@dingo-d dingo-d self-assigned this Feb 13, 2019
@dingo-d dingo-d added Type: Bug There is a bug in the plugin. issue: has PR labels Feb 13, 2019
@ernilambar
Copy link
Member Author

In the latest zip, I get following.
Fatal error: Uncaught TypeError: Argument 2 passed to Theme_Sniffer\Assets\Base_Asset::deferred_action() must be an instance of Theme_Sniffer\Assets\Closure, instance of Closure given, called in /var/www/review.dev/public_html/wp-content/plugins/theme-sniffer/src/assets/class-base-asset.php on line 48 and defined in /var/www/review.dev/public_html/wp-content/plugins/theme-sniffer/src/assets/class-base-asset.php:74 Stack trace: #0 /var/www/review.dev/public_html/wp-content/plugins/theme-sniffer/src/assets/class-base-asset.php(48): Theme_Sniffer\Assets\Base_Asset->deferred_action('admin_enqueue_s...', Object(Closure), 1) #1 /var/www/review.dev/public_html/wp-content/plugins/theme-sniffer/src/assets/class-assets-handler.php(44): Theme_Sniffer\Assets\Base_Asset->register() #2 /var/www/review.dev/public_html/wp-content/plugins/theme-sniffer/src/class-plugin.php(145): Theme_Sniffer\Assets\Assets_Handler->register() #3 /var/www/review.dev/public_html/wp-includes/class-wp-hook.php(286): Theme_Sniffer\Core\Plugin->register_assets_ in /var/www/review.dev/public_html/wp-content/plugins/theme-sniffer/src/assets/class-base-asset.php on line 74

@dingo-d
Copy link
Member

dingo-d commented Feb 13, 2019

Oh crap, I've removed the use Closureat the top 😬 On it! 😄

EDIT: Try downloading the new version now 🙂

@ernilambar
Copy link
Member Author

Ok, no fatal error. Is Hide Warnings checkbox working?

@dingo-d
Copy link
Member

dingo-d commented Feb 13, 2019

Nope, I'm having issues with that 😕 The new sniffing process is different than the old one so I have to create my own sniff runner

https://github.com/WPTRT/theme-sniffer/blob/feature/use-namespace/src/callback/class-run-sniffer-callback.php#L395

And there something is behaving odd...

@ernilambar
Copy link
Member Author

Ok, closing this issue for now.

@dingo-d
Copy link
Member

dingo-d commented Feb 15, 2019

If you find any more issues let me know 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug There is a bug in the plugin.
Projects
None yet
Development

No branches or pull requests

2 participants