Just for clarification for people that are not familiar with the towns in the Yosemite area and will panic when they see the title of the thread. Midpines is about 25 miles from the Arch Rock entrance of Yosemite so this this did not happen in the park.
As for Midpines, it sounds like they have a storage problem with their trash and need to do something about this. This bear is now a nuisance bear and might eventually have to be killed.