Stefanowitsch Posted October 19 Share Posted October 19 I have a trivial problem that is driving me insane. I am saving JSON Data into a field: $groupOverview->json_calendar_data = json_encode($eventsData); $groupOverview->save(); The JSON string is valid, as I have testet. In the frontend I turn this string back into an array like this: $eventsData = json_decode($groupOverview->json_calendar_data, true); bd($eventsData); The problem is: It always returns NULL. Printing out the field value as string works fine though, this is not a field selector issue. Link to comment Share on other sites More sharing options...
virtualgadjo Posted October 19 Share Posted October 19 hi, looking at your dump, it sounds more like a htmlspecialchars encoding, you may either remove it from the field setting or use htmlspecialchars_decode on the output before json_decode 🙂 have a nice day 2 Link to comment Share on other sites More sharing options...
Stefanowitsch Posted October 19 Author Share Posted October 19 14 minutes ago, virtualgadjo said: hi, looking at your dump, it sounds more like a htmlspecialchars encoding, you may either remove it from the field setting or use htmlspecialchars_decode on the output before json_decode 🙂 have a nice day Thanks! You are right. After removing the HTML Entity Encoder Text Formatter form the field the decoding works. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now