Hi,

I was investigating how to add support for the statistics core module, when I figured out that files already exists that attempted this. These were however never used..
So first I tried just adding 'statistics' to _entity_metadata_core_modules. This got the fields, but data wasn't returned correctly, so I turned to look at entity_metadata_statistics_node_get_properties. This didn't provide default-values (statistics_get returns NULL if no statistics were found for the node), and also the properties were wrong (dayviews vs daycount).

I've attached a patch that fixes entity_metadata_statistics_node_get_properties, and enables statistics in _entity_metadata_core_modules.

-Morten

CommentFileSizeAuthor
fix_statistics_support.patch1.79 KBfangel

Comments

fago’s picture

Status: Active » Fixed

Oh, indeed that code does not seem to be used at all.

I've fixed the code style issues in your patch (missing spaces) + committed it. Thanks.

fangel’s picture

Just for the record, what was the code style issues (so I can improve my patch-foo :))

fago’s picture

array('totalcount'=>0, 'daycount'=>0, 'timestamp'=>NULL);
should be

array('totalcount' => 0, 'daycount' => 0, 'timestamp' => NULL);
fangel’s picture

Sweet. So I wasn't totally off in my style :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.