Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I'm using scald in a cope environment and transformed the atom entity in a remote entity. The only PITA I ran into right now is scald_is_registered(), which bypasses the entity controller for loading. Looking at the code I do not see why it's not a simple scald_fetch() operation - as entity loading has already the static memory cache. This should be better than loading it twice - once with scald_is_registered() and another time in a probably anyway pursued scald_fetch() call.
Thus, attached patch deprecates scald_is_registered() in favor of scald_fetch().
Comment | File | Size | Author |
---|---|---|---|
#2 | d7_scald_is_registered.patch | 1.49 KB | fago |
d7_scald_is_registered.patch | 1.88 KB | fago | |
Comments
Comment #2
fagoFigured that scald_fetch() does permission checking as well - thus it's not really deprecated. Instead it's basically the same as entity load, thus I've updated the patch to make it use entity load instead.
Also, re-rolled patch with proper paths.
Comment #3
jcisio CreditAttribution: jcisio commentedscald_is_registered is a lightweight way to check and get atom properties, without loading the whole entity. It is like $GLOBALS['user']. This was a useful optimization, but I'm not sure if it is still now.
Comment #5
jcisio CreditAttribution: jcisio commentedI've just checked and scald_is_registered() is only used in scald_render() now, so there is no need for a dirty db_select that bypasses the entity controller. Fixed a few comments and committed. Thanks.