Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project.yaml - Can't import saved single section #3873

Open
MichaelCaraccio opened this issue Feb 20, 2019 · 9 comments
Open

Project.yaml - Can't import saved single section #3873

MichaelCaraccio opened this issue Feb 20, 2019 · 9 comments
Assignees

Comments

@MichaelCaraccio
Copy link

Description

It's probably linked with this issues #3872

The single section created in dev (my computer) can't be imported from production. But the information about the single section is saved in the project.yaml file and the save/import process worked without giving any warning or error.

Steps to reproduce

  1. Create a single section (about page)
  2. Save it
  3. Commit & push
  4. Pull on production
  5. connect to the admin backend
  6. Sync project.yaml successfully
  7. Settings -> Section -> About page not found

Content of the project.yaml file after saving the single section :

  1110210f-c336-4d4e-aa58-b88e747c34da:
    enableVersioning: true
    entryTypes:
      fe082a7a-8fde-42e8-aa38-6109efd67d55:
        fieldLayouts:
          b115c8ed-5043-4c01-8948-cd7851450efd:
            tabs:
              -
                fields:
                  4250bd56-6e1e-4ae5-9e53-14ead835c56c:
                    required: false
                    sortOrder: 1
                  6feb4c57-b081-47d7-beb6-53ce856da249:
                    required: false
                    sortOrder: 2
                name: Body
                sortOrder: 1
        handle: aboutUs
        hasTitleField: false
        name: 'About Us'
        sortOrder: 1
        titleFormat: '{section.name|raw}'
        titleLabel: ''
    handle: aboutUs
    name: 'About Us'
    propagateEntries: true
    siteSettings:
      8411df7a-72da-4f34-b4b6-95239a01a4e6:
        enabledByDefault: true
        hasUrls: true
        template: about-us.twig
        uriFormat: about-us
      ac387b80-8f2a-46d0-b351-1cba39d94849:
        enabledByDefault: true
        hasUrls: true
        template: about-us.twig
        uriFormat: about-us
      af413f49-9077-448b-b89b-aaebfe1cd80b:
        enabledByDefault: true
        hasUrls: true
        template: about-us.twig
        uriFormat: about-us
    type: single

Additional info

  • Craft version: 3.1.12
  • PHP version: 7.1.22
  • Database driver & version: MySQL 5.7.23
  • Plugins & versions:
  • Imager v2.1.4
  • Migration Manager 3.0.17
  • Redactor 2.3.1
  • Super Table 2.1.8
@brandonkelly
Copy link
Member

Do you have a database backup from before you synced the project config on production? If so can you please send that into [email protected], along with the updated project.yaml file, and your composer.json and composer.lock files?

@smcyr
Copy link

smcyr commented Feb 28, 2019

I just had the same problem, but for an entry type that I created in dev, it was added to the project.yaml, but after syncing in our staging environment, the entry type wasn't created.

Edit: I just tried with the production database and it worked, so maybe something was off with the staging database (I don't have a backup from before the sync sadly)

@gregkohn
Copy link

I'm appearing to have the same or a similar issue.

Locally, I created a new single, several fields, and assigned those fields to the single. The single itself appears in the project.yaml as reproduced below. After syncing with staging, there's no error and the section settings and fields are correctly created and applied. However, the entry itself is not showing up inside of Singles nor the craft_entries table.

f240937b-d8cf-47ad-aeaa-1e202fbdaf03:
    name: Homepage
    handle: homepage
    type: single
    enableVersioning: '1'
    propagateEntries: '1'
    siteSettings:
      b9ec6e9e-5737-4ac6-a624-708bb65448f5:
        enabledByDefault: '1'
        hasUrls: '1'
        uriFormat: __home__
        template: index
    entryTypes:
      43ce5177-ce56-4f20-b1b6-d03533e28c6b:
        name: Homepage
        handle: homepage
        hasTitleField: '0'
        titleLabel: ''
        titleFormat: '{section.name|raw}'
        sortOrder: '1'
        fieldLayouts:
          b7292b0c-5a99-4818-af5a-cf61fc723b0d:
            tabs:
              -
                name: 'Section 1'
                sortOrder: '1'
                fields:
                  4a789bec-1e82-41a3-8183-8672e76a8ae2:
                    required: '1'
                    sortOrder: '1'
                  3909d56a-2f97-4935-a759-0d40672d31a5:
                    required: '1'
                    sortOrder: '2'
                  5b807dff-cafa-4b47-bc0d-cf4834900de3:
                    required: '1'
                    sortOrder: '3'
                  a72eb760-6786-49db-8a02-358d5d5f52fc:
                    required: '1'
                    sortOrder: '4'
                  dbba8d00-cd7d-4a8d-a8e2-579b18d69739:
                    required: '1'
                    sortOrder: '5'
                  5d368f40-9c75-4c03-86b6-21dd79774445:
                    required: '1'
                    sortOrder: '6'
              -
                name: 'Section 2'
                sortOrder: '2'
                fields:
                  316ba665-49d5-462b-a192-aedd52f3732e:
                    required: '1'
                    sortOrder: '1'
                  f60c47fc-3b41-4cfe-bf25-8cbfcb2d0481:
                    required: '1'
                    sortOrder: '2'
                  57a29dce-b387-4f2a-9525-c03ab1f6f876:
                    required: '1'
                    sortOrder: '3'
                  ecabc043-7fe8-4849-9846-9a6401e28fb8:
                    required: '1'
                    sortOrder: '4'
                  11750c04-db1b-4cbe-8484-ffb9ede71bd3:
                    required: '1'
                    sortOrder: '5'
              -
                name: 'Section 3'
                sortOrder: '3'
                fields:
                  b2325653-a331-458a-8707-2242b43922df:
                    required: '1'
                    sortOrder: '1'
                  d62194c8-4e25-49bd-8612-bb4b664e0f4d:
                    required: '1'
                    sortOrder: '2'
                  1f0568ed-fa03-4bd0-8096-54ac68536469:
                    required: '1'
                    sortOrder: '3'
                  fd922eef-47b1-4881-8ae9-0fc608dfc874:
                    required: '1'
                    sortOrder: '4'
                  a1e7d8fa-9cf3-4da0-8c86-838c0815b9be:
                    required: '1'
                    sortOrder: '5'
              -
                name: 'Section 4'
                sortOrder: '4'
                fields:
                  2dcebb0a-b806-4b21-a386-d83b4f82b48b:
                    required: '1'
                    sortOrder: '1'
                  f63c987b-4ec8-4fb6-bc91-7de4ab5d3166:
                    required: '1'
                    sortOrder: '2'
                  23b24101-ff0e-4431-9db7-4859eed8ac75:
                    required: '1'
                    sortOrder: '3'
                  ce8303f9-c1fc-48d7-a531-f809ce3cda93:
                    required: '1'
                    sortOrder: '4'
                  a3f5243b-2840-4fac-a021-e0fae1ffc857:
                    required: '1'
                    sortOrder: '5'
                  b692b527-e026-4387-8d4d-4c54e76ee3b1:
                    required: '1'
                    sortOrder: '6'
              -
                name: 'Section 5'
                sortOrder: '5'
                fields:
                  84325471-0604-4710-b51c-50367b8d3f53:
                    required: '1'
                    sortOrder: '1'
                  a0dcd702-b81b-4b41-9775-09d8e083a0f8:
                    required: '1'
                    sortOrder: '2'

@gregkohn
Copy link

Temporarily allowing admin changes on staging and resaving the section created the missing entry. Perhaps there's a step missing in the sync for new singles?

@jsunsawyer
Copy link

jsunsawyer commented Jul 9, 2019

I just experienced this same issue in Craft 3.1.33. Even did a ./craft project-config/rebuild command locally and re-synced in production. My new single entry does not exist in production after a project config sync.

@brandonkelly
Copy link
Member

@jsunsawyer Did the section itself make it in, and just not the actual entry? Or neither?

@jsunsawyer
Copy link

@brandonkelly I pulled down the remote db and re-synced my project config. It looks like the section (single) is being created, but it has 0 entry types and there doesn't seem to be a way to add one to a single. Will try to recreate the section and re-sync.

@jsunsawyer
Copy link

@brandonkelly After recreating the section, entryTypes: was properly added to my project config. Not really sure where things went wrong. Might have something to do with running project-config/rebuild. This seems to have added my missing section to the project.yaml file, but without an entry type.

@brandonkelly
Copy link
Member

FYI the project-config/rebuild behavior changed in Craft 3.1.34 to be more like you’d likely expect; it will now rebuild it from scratch (where possible) based on what’s in the database. So after updating to 3.1.34+ you may have better luck with it. Also, in this case project-config/sync --force may have helped, as that will force Craft to reprocess everything in the project config, even if it thinks it already knows about something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants