How to change value of a field in hook_node_view In hook_node_view() I want to rewrite some fields' values. The $node parameter is not referenced, so how can I rewrite a value?
Take a look at the API documentation for hook_node_view, specifically the comments at the end of the page -> Has anyone been able to successfully modify a node object?. There's talk of using hook_node_load as a solution as well as many of the hooks that are field specific. Note the comments at the bottom of the hook_node_load API page that explains why $nodes is not called by reference but is still changed when changes are made to the variable within the hook re: OOP -> http://php.net/manual/en/language.oop5.references.php.