0

I use the amazing extension tx_news. I want to check if a news really does not exist (404) or the access is not possible due to a missing login. (403)

Is there a way to do this? By default, only a 404 is shown and i want to give the visitor a different feedback 404/403 or use the Errorhandling in my site-config

N1ck
  • 323
  • 1
  • 14

1 Answers1

1

I don't think that you can get that information as a http status in an easy way.

The page for detail views in general would be accessible, so no status 403 would be given. Then the plugin will be rendered where the controller tries to get the news record with a standard query. in this query all restrictions are executed as usual ('enableFields'). In this way the query will result in an empty set and no information about a non accessible record.

If you want that information you have to intercept. here or earlier. As soon as you identify a record you can insert a test for accessibility restriction for missing login and return with the appropriate error.
Be careful as a record may exist, but the restriction also could be a time-restriction (starttime/endtime)

The record identification could be inside a slug-enhancer or in the replacment of the original news controller.

Bernd Wilke πφ
  • 10,390
  • 1
  • 19
  • 38