Hello
This is a weird one…
I have a file which contains many, many lines like this:
Tickets:
11111-111111
22222-222222
33333-333333
44444-444444
55555-555555
66666-666666
77777-777777
88888-888888
99999-999999
00000-000000
The user of my side gets send an email with one such tickets (the one in the first line). This ticket (it is a voucher based system) is ‘burned’ now and has to be removed from the file. So I ‘unset’ the line (I basiscally just want to remove the first line of the Tickets-list. Not sure if there is a better - more Kirby - way…)
This is my code:
$arr_tickets = $page->tickets()->nl2br()->split('<br>'); //Alle tickets im Array speichern
$data['ticket'] = $arr_tickets[0]; //Erstes Ticket speichern für E-Mail
unset($arr_tickets[0]); //Erstes Ticket aus dem Array löschen
$ubrige_tickets = implode("\n", $arr_tickets); //Das Array zu einem String umformen
$page->update([ 'tickets' => $ubrige_tickets ]); //Übrige Tickets wieder speichern
$anzahl_ubrige_tickets = count($arr_tickets); //Anzahl der übrigen Tickets bestimmen
The line $page->update([ 'tickets' => $ubrige_tickets ]);
breaks on the real server, on my local machine it works…
I checked the filesystem permissions, they are like this (should be fine):
An Exception is thrown:
Kirby \ Exception \ PermissionException (error.page.update.permission)
You are not allowed to update "wlanticket"
I am lost. Do you have any idea where to look?
Carsten