Call to a member function getItemDefinition() on null in media_requirements()