Pennebaker / craft-architect

A plugin for importing and exporting content models from Craft 3/4 using JSON.
MIT License
72 stars 6 forks source link

Update Sections via cli #41

Closed joepagan closed 2 years ago

joepagan commented 4 years ago

What changes made

Why

Sections cannot be updated via the cli

Concerns

I am concerned about adding continue here as I am not sure if there is anything necessary further down in the method that this could skip. Previously, without this continue, the method could reach the bottom, and in turn running both update and save methods for a processor. This would result in console errors because of the 2nd save running, even though the update was successful along the lines of:

home already exists

Testing

/var/www/site/update.json:

{
  "sections": [
      {
          "name": "Home12",
          "handle": "home",
          "type": "single",
          "enableVersioning": true,
          "siteSettings": [
              {
                  "hasUrls": true,
                  "uriFormat": "__home__",
                  "template": "index12.twig",
                  "enabledByDefault": true
              }
          ]
      }
  ]
}

Run with:

./var/www/site/craft/craft architect/import/update /var/www/site/update.json

spAnser commented 4 years ago

I can check this later this week.