Post by HKOCH » Wed Aug 02, 2017 8:32 pm

Dear all
I have a working extension in OC 1.4.9.5 where I send URL messages from module .tpl code to controller code and returns a response back trom the controller code to the .tpl code which are being used to print out status. I have now ported this code to 1.5.6.4 I can still send the messages from the .tpl code to the controller code. But the problem is that I can't return any messages (JSON encoded) back to the module .tpl code. The payload is empty even when I try to push just a string back from the controller. I can't figure out why this is happening. Is this some kind of limitation that have been built into this OC 1.5.6.4 that was not existing in 1.4.9.5?

I hope some of you can help me find an answer on this

regards
/HKOCH

New member

Posts

Joined
Sun Dec 20, 2009 3:33 am
Location - near to Copenhagen, Denmark

Post by HKOCH » Thu Aug 03, 2017 4:46 am

I found the answer myselves:


The JSON helper method has changed

Code: Select all

//v1.5.1.2 or earlier    
$this->load->library('json');    
$this->response->setOutput(Json::encode($data));
should be replaced with

Code: Select all

$this->response->setOutput(json_encode($data));
And then the responses are working again ;)

New member

Posts

Joined
Sun Dec 20, 2009 3:33 am
Location - near to Copenhagen, Denmark
Who is online

Users browsing this forum: No registered users and 9 guests