RTC bug PR-5.2-dev Pending

User tests: Successful: Unsuccessful:

avatar Hackwar
Hackwar
8 Apr 2024

Pull Request for Issue #40476 .

Summary of Changes

Right now, Joomla registers every call to the URL of a content item as a hit. However, there are cases where for example FeedBurner does HEAD requests to the URL, which isn't really a real request to get the content item. This PR filters the requests to only be registered as a hit when triggered by GET or POST.

Testing Instructions

Install the testing sample data and visit an article of your choice, for example "Content Component". See the hit counter. Request the same URL with a tool like Postman as a HEAD request.

Actual result BEFORE applying this Pull Request

The HEAD request is counted as a hit.

Expected result AFTER applying this Pull Request

The HEAD request is not counted as a hit.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar Hackwar Hackwar - open - 8 Apr 2024
avatar Hackwar Hackwar - change - 8 Apr 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 8 Apr 2024
Category Front End com_contact com_content com_newsfeeds com_tags
avatar Hackwar Hackwar - change - 8 Apr 2024
Labels Added: PR-5.2-dev
avatar Ruud68
Ruud68 - comment - 9 Apr 2024

Hi @Hackwar , can you eleborate what is the reason for doing these changes in the controller / view and not in the model or table hit function?

avatar Hackwar
Hackwar - comment - 9 Apr 2024

The model and table do the actual work of registering the hit. The decision if the hit should be counted has to be done by the controller/view. Normally, the code should be unified to check this either in the controller or in the view and not one time in the controller and the other time in the view. I can't say which solution is the right one right now. In the end, you might want to use the model or table in another context (a JSON API or CLI code) and register that as a hit, which would then create problems when you have the additional checks in there.

avatar Hackwar Hackwar - change - 8 Jul 2024
Labels Added: Feature
avatar crommie crommie - test_item - 24 Aug 2024 - Tested successfully
avatar crommie
crommie - comment - 24 Aug 2024

I have tested this item ✅ successfully on 98a9ed5

Works as described.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43231.

avatar TLWebdesign TLWebdesign - test_item - 24 Aug 2024 - Tested successfully
avatar TLWebdesign
TLWebdesign - comment - 24 Aug 2024

I have tested this item ✅ successfully on 98a9ed5


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43231.

avatar Quy Quy - change - 24 Aug 2024
Status Pending Ready to Commit
avatar Quy
Quy - comment - 24 Aug 2024

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43231.

avatar pe7er pe7er - change - 26 Aug 2024
Labels Added: RTC bug
Removed: Feature
avatar pe7er pe7er - change - 26 Aug 2024
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2024-08-26 12:12:31
Closed_By pe7er
avatar pe7er pe7er - close - 26 Aug 2024
avatar pe7er pe7er - merge - 26 Aug 2024
avatar pe7er
pe7er - comment - 26 Aug 2024

Thanks @Hackwar !

Add a Comment

Login with GitHub to post a comment