Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292924

node_preview() shouldn't call hook_field_load()

$
0
0

According to the documentation hook_field_load() seems to be the place to load additional data for a field-type once the field item has been loaded from the field-storage.

During my investigations of the field API (that have ended in my blogpost) I've found that it also is invoked during node_preview(). This is rather odd as the the field-storage is not even involved when previewing a node.

There is also no obvious way to discern this two cases as statet in #1064582: How to determine when in preview mode in hook_field_load() . Most modules work around this by adding extra checks to their implementation of hook_field_load() that make it indempotent.


Viewing all articles
Browse latest Browse all 292924

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>