I use the addToStructure function to update a page. This works fine but strangely only on the desktop PC, not on the cell phone. This seems totally illogical to me. Can anyone explain this? There are also no error messages due to the exception.
function addToStructureNew($page, $field, $data = array()){
$fieldData = page($page)->$field()->yaml();
$fieldData[] = $data;
$fieldData = yaml::encode($fieldData);
try {
page($page)->update(array($field => $fieldData));
return true;
} catch(Exception $e) {
return $e->getMessage();
}
}
addToStructureNew($page, 'archiv',[
'datum' => date('d.m.Y'),
'uhrzeit' => date('G:i:s')
]);