Skip to content

Upgrading Multisite to 3.1 with a site which hasnt a tree cause an error #3430

@GertTimmerman

Description

@GertTimmerman

Bug Description

I ran php please updates:run 3.0 but i encountered an error:

  ErrorException 

  Undefined index: tree

  at vendor/statamic/cms/src/UpdateScripts/UseDedicatedTrees.php:75
     71▕             }
     72▕ 
     73▕             $yaml = YAML::file($path)->parse();
     74▕ 
  ➜  75▕             return $nav->makeTree($site->handle(), $yaml['tree']);
     76▕         })->filter();
     77▕     }
     78▕ 
     79▕     private function singleSiteNavTrees($nav)

      +1 vendor frames 
  2   [internal]:0
      Statamic\UpdateScripts\UseDedicatedTrees::Statamic\UpdateScripts\{closure}(Object(Statamic\Sites\Site), "german")

      +26 vendor frames 
  29  please:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

How to Reproduce

I have an collection where some sites dont have any translations, they just use all the content from the origin. Some sites have translation but some don't. In this case, the german site dont have a tree, others sites do have a tree

Environment

Statamic 3.1.0 Pro
Laravel 8.34.0
PHP 7.4.15
gerttimmerman/statamic-alignment-fieldtype dev-master
joetannenbaum/antlers-stack-tags 0.1.0
optimoapps/statamic-bard-text-align V1.0.1
spatie/statamic-algolia-places 1.1.0
spatie/statamic-responsive-images 2.5.2
withcandour/aardvark-seo 2.0.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions