Does calling a JSON file in PHP work with CF8?

Call a JSON file in PHP with ChronoForms 8.

Overview

The issue occurs because the PHP variable containing the decoded JSON data is not explicitly returned to the form.
Ensure your PHP code explicitly returns the variable you need to use in the form.

Answered
ChronoForms v8
Fr Fredolino 25 Oct, 2025

Hello,

In CF7, I was able to use a JSON file in the form with PHP.

Example:

$file = file_get_contents("map.json");

$json_decoded = json_decode($file);

How does this work now in CF8? I can display the file directly in the browser, but in CF8 the debugger outputs:

[map_json_encoded] => Array([returned] => NULL))

What is the problem?

F.

Max_admin Max_admin 26 Oct, 2025
Answer

Hi Fred

Same in v8, you always have to return the PHP variable you need to be set in the Var list:

return $json_decoded;
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Post a Reply