TSP Posted September 5, 2018 Posted September 5, 2018 Hi, On exporting a plugin I experience that it exports it with a double try/catch-block <?php public function commentFormElements() { try { try { // My code } catch ( \RuntimeException $e ) { if ( method_exists( get_parent_class(), __FUNCTION__ ) ) { return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() ); } else { throw $e; } } } catch ( \RuntimeException $e ) { if ( method_exists( get_parent_class(), __FUNCTION__ ) ) { return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() ); } else { throw $e; } } } How to avoid this? Okay, totally my bad. For some reason the try/catch-code is actually in the dev code. I don't remember putting it there though. I guess I can just remove it from the dev code for the plugin, right?
bfarber Posted September 5, 2018 Posted September 5, 2018 Yes, you can manually remove it from your plugin dev file. It is added on export, so if you exported at one point and then copied the exported file to your dev environment, that's how this would occur.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.