help to better help you:
Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!
deactivated event and status code
deactivated event and status code
5 years 9 months ago
Hi everyone
When I deactivate or delete an event and then visit the (former) link to the detailed view I get an error message "Error. You are not authorised to view this resource." BUT I still get the satus code 200 OK in the response header.
I would like to get an 404 error header (Otherwise the links to the old events stay in the earch engines).
How can I do that?
thanks and greetings
When I deactivate or delete an event and then visit the (former) link to the detailed view I get an error message "Error. You are not authorised to view this resource." BUT I still get the satus code 200 OK in the response header.
I would like to get an 404 error header (Otherwise the links to the old events stay in the earch engines).
How can I do that?
thanks and greetings
Please Log in or Create an account to join the conversation.
Re: deactivated event and status code
5 years 8 months ago
OK, I found the line where it is generated:
in /components/com_jem/views/event/view.html.php on line 141 I found:
Even if there seems that the output should to be an 403 error, I still geht the status "200 OK" in the response header.
When I add a line
under line 141
then I get the correkt response header (403).
So why doesn't it work with the line JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));?
(or is it a general joomla issue?)
in /components/com_jem/views/event/view.html.php on line 141 I found:
Code:
JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
When I add a line
Code:
header("HTTP/1.1 403 Forbidden");
then I get the correkt response header (403).
So why doesn't it work with the line JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));?
(or is it a general joomla issue?)
Please Log in or Create an account to join the conversation.
Re: deactivated event and status code
5 years 8 months ago
Hey,
I am sorry, I can not answer to your question.
But I think its not important to think about JError, because it does not exist in Joomla 4 anymore, so sooner or later we need to replace JError messages anyway.
I am sorry, I can not answer to your question.
But I think its not important to think about JError, because it does not exist in Joomla 4 anymore, so sooner or later we need to replace JError messages anyway.
The following user(s) said Thank You: hekla
Please Log in or Create an account to join the conversation.
Re: deactivated event and status code
5 years 8 months ago
Ok, thank you.
I posted it also in the Joomla Forum at joomla.org with the question "general joomla issue or not?"
I posted it also in the Joomla Forum at joomla.org with the question "general joomla issue or not?"
Please Log in or Create an account to join the conversation.
Time to create page: 0.522 seconds