i have created a view displaying field: Content statistics: Total views (total views)
no matter how much i click to view a content , the counter remain to 0
checking the db, the table node_counter is empty
The counting is activated here
/admin/config/system/statistics
Any ideas ?
is there a useful breakpoint i can make to pinpoint the problem?
here is my view
uuid: 119c0f29-7265-4d33-ae7a-c268ed795a62
langcode: en
status: true
dependencies:
config:
- node.type.article
- node.type.page
module:
- node
- statistics
id: most_read
label: 'les plus lus'
module: views
description: ''
tag: ''
base_table: node_field_data
base_field: nid
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: none
options: { }
cache:
type: none
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: mini
options:
items_per_page: 10
offset: 0
id: 0
total_pages: null
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
tags:
previous: ‹‹
next: ››
style:
type: default
row:
type: fields
fields:
title:
id: title
table: node_field_data
field: title
entity_type: node
entity_field: title
label: ''
alter:
alter_text: false
make_link: false
absolute: false
trim: false
word_boundary: false
ellipsis: false
strip_tags: false
html: false
hide_empty: false
empty_zero: false
settings:
link_to_entity: true
plugin_id: field
relationship: none
group_type: group
admin_label: ''
exclude: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_alter_empty: true
click_sort_column: value
type: string
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
totalcount:
id: totalcount
table: node_counter
field: totalcount
relationship: none
group_type: group
admin_label: ''
label: 'total views'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
set_precision: false
precision: 0
decimal: .
separator: ','
format_plural: false
format_plural_string: "1\x03@count"
prefix: ''
suffix: ''
plugin_id: statistics_numeric
filters:
status:
value: '1'
table: node_field_data
field: status
plugin_id: boolean
entity_type: node
entity_field: status
id: status
expose:
operator: ''
group: 1
type:
id: type
table: node_field_data
field: type
relationship: none
group_type: group
admin_label: ''
operator: in
value:
article: article
page: page
group: 1
exposed: false
expose:
operator_id: ''
label: ''
description: ''
use_operator: false
operator: ''
identifier: ''
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: node
entity_field: type
plugin_id: bundle
sorts:
created:
id: created
table: node_field_data
field: created
order: DESC
entity_type: node
entity_field: created
plugin_id: date
relationship: none
group_type: group
admin_label: ''
exposed: false
expose:
label: ''
granularity: second
totalcount:
id: totalcount
table: node_counter
field: totalcount
relationship: none
group_type: group
admin_label: ''
order: ASC
exposed: false
expose:
label: ''
plugin_id: standard
title: 'les plus lus'
header: { }
footer: { }
empty: { }
relationships: { }
arguments: { }
display_extenders: { }
use_ajax: true
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url.query_args
- 'user.node_grants:view'
tags: { }
block_1:
display_plugin: block
id: block_1
display_title: Block
position: 2
display_options:
display_extenders: { }
pager:
type: none
options:
offset: 0
defaults:
pager: false
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- 'user.node_grants:view'
tags: { }
page_1:
display_plugin: page
id: page_1
display_title: Page
position: 1
display_options:
display_extenders: { }
path: les-plus-lus
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url.query_args
- 'user.node_grants:view'
tags: { }
Comments
Comment #2
timmillwoodis statistics.php firing?
Comment #3
matoeil CreditAttribution: matoeil commentedwhen i click on , say , /node/58 ?
it is not !
what does it mean ?
As a control , my breakpoint works in function statistics_cron() {]
Comment #4
timmillwoodstatistics.php is what counts the node views. If that's not firing then that's the issue. Could your theme be preventing some of core's javascript from being added?
Comment #5
matoeil CreditAttribution: matoeil commentedthanks you are right ! there is a js "NetworkError: 404 Not Found - /core/modules/statistics/statistics.php"
i still need to find out how to solve it.
putting back bartik does not
any idea ?
Comment #6
mallezieIs your site installed in a subdirectory? (http://domein/subfolder) Seems the path in the js file, does not find the php file.
Comment #7
matoeil CreditAttribution: matoeil commentedhi mallezie
it is a multisite installation but i believe the mapping between the web root path and the folder root path is correct.
Coud it not be a nginx configuration problem?
what are the correct nginx parameters for drupal 8 with JQuery Ajax to work ?
http://drupal.stackexchange.com/questions/217296/place-block-ajax-error-...
https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/
Comment #8
Wim LeersLooks like the nginx Drupal recipe has been fixed: https://drupal.stackexchange.com/a/217301 + https://github.com/nginxinc/nginx-wiki/pull/315