Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Rob Pearson Posted May 30, 2017 Posted May 30, 2017 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
Daniel F Posted June 3, 2017 Posted June 3, 2017 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.
Rob Pearson Posted June 3, 2017 Author Posted June 3, 2017 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
Rob Pearson Posted June 5, 2017 Author Posted June 5, 2017 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.
Rob Pearson Posted June 7, 2017 Author Posted June 7, 2017 @Daniel F could you possibly help with this?
opentype Posted June 11, 2017 Posted June 11, 2017 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.
Rob Pearson Posted June 11, 2017 Author Posted June 11, 2017 Ok fantastic. Ill report it now @opentype
Recommended Posts
Archived
This topic is now archived and is closed to further replies.