Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: deactivated event and status code

deactivated event and status code 5 months 1 week ago #25829

  • hekla
  • hekla's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 148
  • Karma: 8
  • Thank you received: 75
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
JEM 2.2.3 / JEM 2.2.3 with core mods (custom fields) / 2.3dev (Egnarts Version)
Joomla always up to date
php 7.2/7.3

Please Log in or Create an account to join the conversation.

deactivated event and status code 4 months 2 weeks ago #25943

  • hekla
  • hekla's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 148
  • Karma: 8
  • Thank you received: 75
OK, I found the line where it is generated:
in /components/com_jem/views/event/view.html.php on line 141 I found:
JError::raiseError(403, JText::_('JERROR_ALERTNOAUTHOR'));
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
header("HTTP/1.1 403 Forbidden");
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?)
JEM 2.2.3 / JEM 2.2.3 with core mods (custom fields) / 2.3dev (Egnarts Version)
Joomla always up to date
php 7.2/7.3

Please Log in or Create an account to join the conversation.

deactivated event and status code 4 months 2 weeks ago #25945

  • Egnarts
  • Egnarts's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 262
  • Karma: -3
  • Thank you received: 110
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.
Take a look at the responsive version of JEM: The Responsive JEM
The following user(s) said Thank You: hekla

Please Log in or Create an account to join the conversation.

deactivated event and status code 4 months 2 weeks ago #25947

  • hekla
  • hekla's Avatar Topic Author
  • Offline
  • Expert Boarder
  • Expert Boarder
  • Posts: 148
  • Karma: 8
  • Thank you received: 75
Ok, thank you.
I posted it also in the Joomla Forum at joomla.org with the question "general joomla issue or not?"
JEM 2.2.3 / JEM 2.2.3 with core mods (custom fields) / 2.3dev (Egnarts Version)
Joomla always up to date
php 7.2/7.3

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.199 seconds

Donate

If you find JEM useful and if you use it on your site, please consider a donation to the project.

Private Messages

You are not logged in.