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

Display name for a content part field in a recipe is being ignored on import / export #15062

Closed
rjpowers10 opened this issue Jan 11, 2024 · 2 comments · Fixed by #15080
Closed
Labels

Comments

@rjpowers10
Copy link
Contributor

Describe the bug

I'm trying to update to OC 1.8.1. In my recipe I specify a display name that is different than the technical name. This worked all the way up to OC 1.8, but in OC 1.8.1 my display name is being ignored and the technical name is used instead.

Similarly, if I set the desired display name through the UI and export the content part field definition into a recipe, the display name is set to the technical name.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new OC 1.8.1 site using the blog recipe
  2. Create a new content type as follows: technical name "MyContentType", display name "My Content Type".
  3. Add a boolean field to the content type as follows: technical name "MyBooleanField", display name "My Boolean Field"
  4. Go to /Admin/DeploymentPlan/Index and create a new deployment plan. Add the "Update Content Definitions" step and check the box for "My Content Type"
  5. Execute the deployment plan

Expected behavior

The resulting recipe has the correct technical and display names for the content type, but not the content part.

{
  "name": "",
  "displayName": "",
  "description": "",
  "author": "",
  "website": "",
  "version": "",
  "issetuprecipe": false,
  "categories": [],
  "tags": [],
  "steps": [
    {
      "name": "ContentDefinition",
      "ContentTypes": [
        {
          "Name": "MyContentType",
          "DisplayName": "My Content Type",
          "Settings": {
            "ContentTypeSettings": {
              "Creatable": true,
              "Listable": true,
              "Draftable": true,
              "Versionable": true,
              "Securable": true
            },
            "FullTextAspectSettings": {}
          },
          "ContentTypePartDefinitionRecords": [
            {
              "PartName": "MyContentType",
              "Name": "MyContentType",
              "Settings": {
                "ContentTypePartSettings": {
                  "Position": "0"
                }
              }
            }
          ]
        }
      ],
      "ContentParts": [
        {
          "Name": "MyContentType",
          "Settings": {},
          "ContentPartFieldDefinitionRecords": [
            {
              "FieldName": "BooleanField",
              "Name": "MyBooleanField",
              "Settings": {
                "ContentPartFieldSettings": {
                  "DisplayName": "MyBooleanField",
                  "Position": "0"
                }
              }
            }
          ]
        }
      ]
    }
  ]
}

To Reproduce the other issue

Now, I start a brand new site from scratch. Instead of creating the content type from the UI, I import it from the following recipe (note the corrected display name). Go to /Admin/DeploymentPlan/Import/Json and paste in this recipe.

{
  "name": "",
  "displayName": "",
  "description": "",
  "author": "",
  "website": "",
  "version": "",
  "issetuprecipe": false,
  "categories": [],
  "tags": [],
  "steps": [
    {
      "name": "ContentDefinition",
      "ContentTypes": [
        {
          "Name": "MyContentType",
          "DisplayName": "My Content Type",
          "Settings": {
            "ContentTypeSettings": {
              "Creatable": true,
              "Listable": true,
              "Draftable": true,
              "Versionable": true,
              "Securable": true
            },
            "FullTextAspectSettings": {}
          },
          "ContentTypePartDefinitionRecords": [
            {
              "PartName": "MyContentType",
              "Name": "MyContentType",
              "Settings": {
                "ContentTypePartSettings": {
                  "Position": "0"
                }
              }
            }
          ]
        }
      ],
      "ContentParts": [
        {
          "Name": "MyContentType",
          "Settings": {},
          "ContentPartFieldDefinitionRecords": [
            {
              "FieldName": "BooleanField",
              "Name": "MyBooleanField",
              "Settings": {
                "ContentPartFieldSettings": {
                  "DisplayName": "My Boolean Field",
                  "Position": "0"
                }
              }
            }
          ]
        }
      ]
    }
  ]
}

Go to /Admin/ContentParts/MyContentType/Fields/MyBooleanField/Edit and note the display name is incorrectly set to the technical name.

image

@MikeAlhayek could this be related to #15013?

@MikeAlhayek
Copy link
Member

@rjpowers10 this issue was in 1.8.0. It was fixed in 1.8.1. Are you able to test 1.8.1 and see if that solves the problem?

Related to #14985 .

@rjpowers10
Copy link
Contributor Author

rjpowers10 commented Jan 11, 2024

@MikeAlhayek I was in the process of updating to OC 1.8, and I did not encounter the issue then. It was only after I did another update to 1.8.1 that I got the issue. After I noticed the issue in my app I tried to reproduce it in a plain old OC 1.8.1 app (as described in my initial post) and I got the same issue there.

MikeAlhayek added a commit that referenced this issue Jan 12, 2024
MikeAlhayek added a commit that referenced this issue Jan 12, 2024
hishamco pushed a commit that referenced this issue Jan 12, 2024
MikeAlhayek added a commit that referenced this issue Jan 17, 2024
Skrypt pushed a commit that referenced this issue Jan 25, 2024
hishamco pushed a commit that referenced this issue Feb 1, 2024
urbanit pushed a commit to urbanit/OrchardCore that referenced this issue Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants