by sam marshall.
You need to construct the completion_info object, you can't just refer to a variable called $completioninfo that probably doesn't exist. Search through existing code to find other places that call this method, for examples.
Also ensure you have debugging set to developer level while developing (there should be other warnings that would make this clearer).
--sam