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

Importing vocabulary with field shows PHP warnings #6715

Open
yorkshire-pudding opened this issue Sep 16, 2024 · 1 comment
Open

Importing vocabulary with field shows PHP warnings #6715

yorkshire-pudding opened this issue Sep 16, 2024 · 1 comment

Comments

@yorkshire-pudding
Copy link
Member

Description of the bug

Found on PHP 8.3 but could arise in earlier versions.
I found this while testing the fix for #2237
If importing a taxonomy vocabulary with field(s), it imports but warnings are shown

Steps To Reproduce

To reproduce the behavior:

  1. Create a taxonomy vocab with a field
  2. Export config
  3. Delete the vocab in the UI
  4. Run import

Actual behavior

Vocab was successfully imported but warnings:

user@machine:~/projects/bee/backdrop$ lando bee config-import
The following config will be imported:

| Config                                       | Status |
| field.bundle.taxonomy_term.test              | create |
| field.field.field_test                       | create |
| field.instance.taxonomy_term.test.field_test | create |
| taxonomy.vocabulary.test                     | create |

Would you like to continue? (y/N): y

 ⚠️  Warning: Attempt to read property "weight" on false
in {closure}() (line 1247 of /app/backdrop/core/modules/taxonomy/taxonomy.module).

 ⚠️  Warning: Attempt to read property "name" on false
in taxonomy_entity_info() (line 126 of /app/backdrop/core/modules/taxonomy/taxonomy.module).

 ⚠️  Warning: Attempt to read property "weight" on false
in {closure}() (line 1247 of /app/backdrop/core/modules/taxonomy/taxonomy.module).

 ⚠️  Warning: Attempt to read property "name" on false
in taxonomy_entity_info() (line 126 of /app/backdrop/core/modules/taxonomy/taxonomy.module).

 ✔  Config was imported to './files/config_1e61159187070230b1449cb58f5770dd/active'.
 ℹ  4 files were synced.

Expected behavior

user@machine:~/projects/bee/backdrop$ lando bee config-import
The following config will be imported:

| Config                                       | Status |
| field.bundle.taxonomy_term.test              | create |
| field.field.field_test                       | create |
| field.instance.taxonomy_term.test.field_test | create |
| taxonomy.vocabulary.test                     | create |

Would you like to continue? (y/N): y

 ✔  Config was imported to './files/config_1e61159187070230b1449cb58f5770dd/active'.
 ℹ  4 files were synced.

Additional information

Add any other information that could help, such as:

  • Backdrop CMS version: 1.29.x-dev
  • PHP version: 8.3
@yorkshire-pudding
Copy link
Member Author

I think part of the issue is this file, which doesn't seem to be populated with name. I wonder if this file is redundant as I don't see comparable files for node types.

field.bundle.taxonomy_term.[vocab_name]
{
    "_config_name": "field.bundle.taxonomy_term.test",
    "bundle": "test",
    "entity_type": "taxonomy_term",
    "view_modes": [],
    "extra_fields": {
        "form": {
            "name": {
                "weight": "-5"
            },
            "description": {
                "weight": "0"
            }
        },
        "display": []
    }
}

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

No branches or pull requests

1 participant