MDL-38171 editpdf: Fixes for php warnings (not seen normally because of ajax)