Issue #3044234 by mikelutz, Neslee Canil Pinto: Replace deprecated entity_* calls with proper calls to the entity api