getkirby / cli

Kirby Command Line Interface
MIT License
51 stars 5 forks source link

clean:content throws exception on translations #72

Closed grommasdietz closed 6 months ago

grommasdietz commented 6 months ago

When using multiple tabs on site blueprint like:

tabs:

  content: tabs/site/content
  meta: tabs/global/meta
  wellknown: tabs/site/wellknown

It seems that only the fields of the first tab are kept, the rest gets deleted. I can’t really figure out why, but to narrow it down: I use a multilingual setup with German as the current default language. Tested it briefly with an English translation. In this scenario the English translation of the site content does not get processed at all, ending up in the following error:

Exception: Cannot traverse an already closed generator in /Users/user/.composer/vendor/getkirby/cli/commands/clean/content.php:12
Stack trace:
#0 /Users/user/.composer/vendor/getkirby/cli/commands/clean/content.php(70): clean(Object(Generator), Array, 'en')
#1 /Users/user/.composer/vendor/getkirby/cli/src/CLI/CLI.php(539): Kirby\CLI\CLI::{closure}(Object(Kirby\CLI\CLI))
#2 /Users/user/.composer/vendor/getkirby/cli/src/CLI/CLI.php(103): Kirby\CLI\CLI->run('clean:content')
#3 /Users/user/.composer/vendor/getkirby/cli/bin/kirby(15): Kirby\CLI\CLI::command('clean:content')
#4 /Users/user/.composer/vendor/bin/kirby(119): include('/Users/user...')
#5 {main}
grommasdietz commented 6 months ago

Had the idea that programmable blueprints were responsible, but could not reproduce the aggressive cleaning anymore. Besides of that I checked again the cleaning of my translation, the error persists and prevents the translation to be cleaned.