Custom block save returns blank page with code
Permalink
I have created a custom block to use with my site. Actually this is my second block I build. First one worked like a charm and I had no problems at all.
But next one, when I click Save in add/edit I get a blank white page with the following;
{"aID":"16","arHandle":"Main","cID":"1","error":false,"bID":"119"}
I have no idea why. Or how this happens. I Guess something is wrong, but I cannot figure it out since I did the exact same way as for my first block.
Everything does seem to save correctly and if I click edit I get it loads all variables correctly into my form.
Some parts of the code, the important part as I would guess:
But next one, when I click Save in add/edit I get a blank white page with the following;
{"aID":"16","arHandle":"Main","cID":"1","error":false,"bID":"119"}
I have no idea why. Or how this happens. I Guess something is wrong, but I cannot figure it out since I did the exact same way as for my first block.
Everything does seem to save correctly and if I click edit I get it loads all variables correctly into my form.
Some parts of the code, the important part as I would guess:
class GmapBlockController extends BlockController { protected $btTable = 'btGmap'; protected $btInterfaceWidth = "400"; protected $btInterfaceHeight = "450"; /** More code here.... **/ function save($data) { $args['mapid'] = isset($data['mapid']) ? trim($data['mapid']) : ''; $args['maptype'] = isset($data['maptype']) ? trim($data['maptype']) : ''; $args['disableDefaultUI'] = isset($data['disableDefaultUI']) ? trim($data['disableDefaultUI']) : ''; $args['height'] = isset($data['height']) ? trim($data['height']) : ''; $args['width'] = isset($data['width']) ? trim($data['width']) : ''; $args['zoom'] = isset($data['zoom']) ? trim($data['zoom']) : ''; $args['marker_location'] = isset($data['marker_location']) ? trim($data['marker_location']) : '';
Viewing 15 lines of 22 lines. View entire code block.