Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
gudman Posted February 24, 2017 Posted February 24, 2017 Hello, Dear colleagues, In file /system/Theme/Dev/Template.php (line 88) (version 4.1.18.2) may be more informative \BadMethodCallException message is: throw new \BadMethodCallException( 'NO_TEMPLATE_FILE - ' . $file . '; BIT - ' . $bit ); Very hard to debug with message: Quote NO_TEMPLATE_FILE - Thank you.
GriefCode Posted February 24, 2017 Posted February 24, 2017 Hey, not sure if i can follow you as it is working fine for me: BTW. Determining the file itself can be easy as we have this wonderful debug view: Just find the call and It will directly display the controller row. Greetings
gudman Posted February 24, 2017 Author Posted February 24, 2017 7 hours ago, GriefCode said: Hey, not sure if i can follow you as it is working fine for me: BTW. Determining the file itself can be easy as we have this wonderful debug view: Just find the call and It will directly display the controller row. Greetings Dear friend, you are right but in common case. Let's see the code: /* Find the file */ $file = NULL; if ( $this->sourceFolder === \IPS\ROOT_PATH . '/plugins' ) { foreach ( new \GlobIterator( $this->sourceFolder . '/*/dev/html/' . $bit . '.phtml' ) as $file ) { break; } } else { $file = $this->sourceFolder . $bit . '.phtml'; } /* Get the content */ if ( $file === NULL or !file_exists( $file ) ) { throw new \BadMethodCallException( 'NO_TEMPLATE_FILE - ' . $file ); } => if in foreach we won't file $file => variable $file is NULL. And we get not informative error message.
GriefCode Posted February 24, 2017 Posted February 24, 2017 5 minutes ago, gudman said: => if in foreach we won't file $file => variable $file is NULL. And we get not informative error message. Indeed, you are right. It could be enhanced by adding the bit also as output Not a big deal on both sides, adding it or not as it is more like "a nice to have", you can still find the call of a wrong/missing template with the debug tool.
Daniel F Posted February 26, 2017 Posted February 26, 2017 That's kind of a bug for me... 4.1.19 will return now a better message for missing plugin templates in IN_DEV mode, so you'll at least know what plugin template was tried to call.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.