Page MenuHomePhabricator

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

Description

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

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.