Look, those poppy candies surely had a minimal dosage of poppy seeds in them, just enough for the medicine to be just a mild sedative. Don't forget that there is often a fine line between medicine and common drugs, moreover, certain drugs are often used in this field, like morphine.