Page MenuHomePhabricator

New Pages not Inserting a new PageID Into hit_counter table
Open, Needs TriagePublic


MW 1.27.1
PHP 7.0.16

Expected behavior:
Create a new page, expect to insert the page_id with a page_counter count of 0 (or 1) as a starting number of page views into hit_counter table.

Output at bottom of page -> This page has been accessed once. (if 1 is used as a starting number of views)
Page added to Special page, popular pages, with a count.
The hit_counter_extension table starts to accumulate page views.

Actual behavior:
Create a new page, no page_id with a count is inserted into the hit_counter table.

Output at bottom of page -> {count is missing}
Page is missing from Special page, popular pages.
The hit_counter_extension table starts to accumulate page views to add to the page_counter field.

Work around:
Manually add the page_id to the hit_counter table and set a count in the page_count field as a starting point. The hit_counter_extension table will start accumulating page views. I have not seen the page counts populate to the actual hit_count table from the hit_counter_extension table yet.

Event Timeline

Hutchy68 created this task.Mar 9 2017, 10:36 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 9 2017, 10:36 PM
Cboltz added a subscriber: Cboltz.Mar 9 2017, 11:27 PM
Kghbln added a subscriber: Kghbln.Apr 26 2017, 10:10 PM

Hmm, I cannot confirm for MW 1.27.2, HC 0.3 on PHP 5.6. New pages actually start counting accesses. @Hutchy68 Are you using file caching on your site? File caching and HitCounters do not mix and then indeed not counting will happen.

Counting is happening just fine with file caching turned on. It's only when a new page is created the page id is not being added to the hit counter table. This is on PHP 7, maybe I'll downgrade and test. What I'm not seeing is a new row insert statement in the code. I see the update to row to accumulate the hits. I was thinking it might be a trigger issue. Insert row in hit counter table trigger on insert row in page table.

MarkAHershberger removed MarkAHershberger as the assignee of this task.May 20 2020, 6:42 PM
MarkAHershberger added a subscriber: MarkAHershberger.