Im using the following function in XenForo and the checkboxes are created for each node and the chosen options are saved in the db, but when the option is reloaded, the saved values are not being repopulated in the form.
Option:
<option option_id="hc_watched_forums_list" edit_format="callback" data_type="array" can_backup="1">
<default_value>a:6:{i:0;s:1:"4";i:1;s:1:"5";i:2;s:1:"6";i:3;s:1:"7";i:4;s:2:"36";i:5;s:2:"38";}</default_value>
<edit_format_params>HotCopper_Option_NodeChooser::renderCheckbox</edit_format_params>
<sub_options>*</sub_options>
<relation group_id="hc_misc_options" display_order="3306"/>
</option>
Function: (simplified)
class HotCopper_Option_NodeChooser extends XenForo_Option_NodeChooser
{
public static function renderCheckBox(XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
return self::_render('option_list_option_checkbox', $view, $fieldPrefix, $preparedOption, $canEdit);
}
}
Can you suggest why its not repopulating the checkboxes and what I can do to fix it. Thanks