Cannot Find property after adding it with hook_entity_property_info_alter (callback not firing) I'm very new to drupal, so forgive me if this is a simple question, but I have been working on this for a few days and have not yet found a solution.

I have an entity, to which I've added the property "hour_created" via the hook_entity_property_info_alter() function. The property has a getter_callback function that simply returns an integer for now. I can see that this property has been added by calling watchdog("normal", print_r($info, true)) after adding the property in the same hook_entity_property_info_alter() function.

The problem is that it does not appear this property is ever actual added to the entity when I try to look at it through Drupal. I added a watchdog("normal", print_r($item, true)); call in the callback, but the watchdog is never called, and never appears in the logs. To try and get the callback to fire, I have tried the following:


node-load through drush
loading the node through the site directly
directly attempting to access the property with php


Unfortunately, I have had no success with any of my above attempts. I suppose what we can boil this question down to is 'How can I make my entity property getter_callback fire, and why isn't it fired when I load the node?' I apologize if any of this is a little muddled, please let me know if any of this is unclear or if you need more information.

Thanks!

EDIT:
Here's the code for my callback:

function mymodule_test_property_getter_callback($item) {
  watchdog("normal", print_r($item, true));
  return 10;
}


And here's my hook_entity_property_info_alter() function:

function mymodule_entity_property_info_alter(&amp;$info) {
  $info['node']['bundles']['mynode']['properties']['test_property'] = array(
    'label' =&gt; t('Just a test!'),
    'type' =&gt; 'integer',
    'computed' =&gt; TRUE,
    'required' =&gt; TRUE,
    'getter callback' =&gt; 'mymodule_test_property_getter_callback'
  );
  watchdog("normal", print_r($info, true));
}
I think this is what's going on...

With your current code you've described the property to the entity API module; if you want to access it via that you already can:

$node = node_load($nid);
$wrapper = entity_metadata_wrapper('node', $node);
print $wrapper-&gt;test_property-&gt;value(); // Prints '10'


But the core entity system has no knowledge of test_property, so it doesn't show up on a node object from node_load(). To get it there, you'll need to implement hook_node_load():

function mymodule_node_load($nodes, $types) {
  foreach ($nodes as $node) {
    if ($type == 'mynode') {
      $node-&gt;test_property = mymodule_test_property_getter_callback($node);
    }
  }
}


There's also the outside chance that your getter callback will rely on something having been added to the node object already, by another module's implementation of hook_node_load(). You can get past that by moving your implementation to last in the queue, with hook_module_implements_alter().

If you want Views support, I think you'll also need to implement hook_views_data_alter() to add the property to the node table. But maybe the entity module will magic that up for you, it's a good'un.