Update() with language param somehow not working

hello everyone. i am using kirby 3.9.8 and having some trouble. the following code is not working, even though it used to work a few updates before.

  1. i have a multi language site
  2. i am trying to save submissions from the frontend for an event page
  3. the submissions are stored in a structure
  4. only the main language has the structure, otherwise every language would have different submissions
  5. hence the structure field in yaml is defined as translate: false
  6. calling update() with the language argument is not working somehow, though. if i send data in the main language (german) the data is saved. if i send it in english, nothing is saved.
  7. and if i set translate to true AND send data in english, even though i am calling with the update parameter of ‘de’, the english structure gets created (just as a test that i did, since as i said before there should be only one structure)

i have checked all data that is being prepared with the Kirbylog() plugin, everything seems fine there, in DE and EN the yaml for the structure is created fine etc, but somehow i cannot save the data in the german file.

any help is appreciated! :slight_smile:

// page uuid is passed via form
$pg = page($data['fb_pg_id']);
$log = $pg->fb_received_submissions()->yaml();
// add our new submission:
$log[] = $submission;
$logyaml = Yaml::encode($log);
// finally, try to update the field in the content file:
try {
   $updatedpg = $pg->update([
    'fb_received_submissions' => $logyaml
   ], 'de');

   } catch (Exception $error) {
   $errors .= 'Submission logging failed: ' . $error->getMessage() . '. ';

also interesting. i changed the data array to this:

$updatedpg = $pg->update([
  'fb_received_submissions' => $logyaml,
  'test' => 'it is saving and ignoring lang!'
  ], 'de');

and update keeps saving always in the current language, as if ‘de’ is not getting recognised at all. also tried kirby()->defaultLanguage() instead of ‘de’, still nothing :frowning:

ok, i got it. i am just dumb :hugs: my event pages have a model that rewrites update() and i was not passing the lang param to the parent::update function. solved