Entity Malformation Exception Error When I try to access some specific pages, I get the following errors in my log, one after the other:


  Notice: Trying to get property of non-object in ds_field_formatter_view() (line 1233 of /var/www/sites/all/modules/ds/ds.module).


Followed by


  EntityMalformedException: Missing bundle property on entity of type taxonomy_term. in entity_extract_ids() (line 7729 of /var/www/includes/common.inc).


And the page serves the following error:


  Error
  The website encountered an unexpected error. Please try again later. 


I had the modules taxonomy and taxonomy manager enabled. I disabled taxonomy manager, but no effect. I wanted to disable taxonomy too, but could not because there was a field with data in it. This has made almost 44 pages of the site with good content in accessible, so any help will be greatly appreciated.
The error was happening due to the fact that database records where not removed when a taxonomy term reference field was deleted. The solution was to install taxonomy orphanage module which removes such references.