Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted May 30, 20177 yr Hello On our custom error page we insert the IPB tags (error_message) as shown in image one: However upon access a restricted page and then revisiting the code it removed the IPB tags and replaced them with text. This means that error are no longer identified properly on our pages. It instead says 'sorry you do not have permission to view this page. See image below. Surely the tags should remain so it can present different reasons/errors. I look forward to getting this resolved. Thanks Rob
June 3, 20177 yr The errors are replaced on runtime in following method cms/Pages::errorPage /** * Show a custom error page * * @param string $title Title of the page * @param string $message language key for error message * @param mixed $code Error code * @param int $httpStatusCode HTTP Status Code * @param array $httpHeaders Additional HTTP Headers * @return void */ static public function errorPage( $title, $message, $code, $httpStatusCode, $httpHeaders ) { try { $page = static::load( \IPS\Settings::i()->cms_error_page ); $page->content = str_replace( '{error_message}', $message, $page->content ); $page->content = str_replace( '{error_code}', $code, $page->content ); ... If you want to customize here something, you'll have to create a plugin and override this method.
June 3, 20177 yr Author Hello @Daniel F, Thanks for the response. I'm not looking to override the system i just want to know why when using the (error_message) tag it doesn't work and converts the tags into text. Surely using the tag means it would detect different errors or is that not the case with custom error pages? Thanks Rob
June 5, 20177 yr Author It just seems the custom error tag doesn't detect the different errors but instead just checks the first one and then saves it as text. Still not found a solution yet.
June 11, 20177 yr Okay, I tried it and see the problem. That is actually a bug. Please open a ticket for that. The error page TEMPLATE gets changed once used, not just the front-end output. That’s clearly not intentional, but it wasn’t perfectly clear from your first post. Not sure what version you use, but I can confirm it for the latest 4.2 beta as well.
Archived
This topic is now archived and is closed to further replies.