Warning: Undefined array key "label"

Created on 2 November 2023, 8 months ago
Updated 6 November 2023, 8 months ago

Problem/Motivation

Warning: Undefined array key "label" in Drupal\simple_sitemap\Form\SimpleSitemapTypeEntityForm->Drupal\simple_sitemap\Form\{closure}() (line 105 of modules/contrib/simple_sitemap/src/Form/SimpleSitemapTypeEntityForm.php).
Drupal\simple_sitemap\Form\SimpleSitemapTypeEntityForm->Drupal\simple_sitemap\Form\{closure}(Array)
array_map(Object, Array) (Line: 106)

Steps to reproduce

Visit any of the below
admin/config/search/simplesitemap/types/default_hreflang
admin/config/search/simplesitemap/types/index

Proposed resolution

Add a index check

πŸ’¬ Support request
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia pasan.gamage

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @pasan.gamage
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 8.1 & MySQL 8
    last update 8 months ago
    32 pass
  • @pasangamage opened merge request.
  • Status changed to Needs review 8 months ago
  • Status changed to Postponed: needs info 8 months ago
  • πŸ‡©πŸ‡ͺGermany gbyte Berlin

    The question is rather why doesn't your sitemap type entity have a label?

    If you don't provide it while creating the entity, it should be creates automatically from the machine name.

    Please provide a reproducible way of getting this warning.

  • πŸ‡¦πŸ‡ΊAustralia pasan.gamage

    Hi @gbyte
    The issue was caused when updating the module from D9 simple_sitemap 3.5, to D10 4.1.7.
    I also noticed that the variants related configs gets deleted because there's no update path to migrate those configs.
    Thanks

  • Status changed to Fixed 8 months ago
  • πŸ‡©πŸ‡ͺGermany gbyte Berlin

    The issue was caused when updating the module from D9 simple_sitemap 3.5, to D10 4.1.7.

    This may be specific to your instance as I have never heard of this problem before and we have tens of thousands of sites migrating from 2.x/3.x to 4.x.

    I also noticed that the variants related configs gets deleted because there's no update path to migrate those configs.

    You got it backwards. The configs get deleted because there *is* an upgrade path. Variants are now Drupal entities and have a different storage. Your variants got migrated.

    In any case, just go to the variant edit form and create a label or alternatively just klick save.

  • πŸ‡¦πŸ‡ΊAustralia pasan.gamage

    Hi @gbyte
    Thank you very much for the explanations and helping me understand.
    You mentioned the the varients were migrated. Which path in admin can I navigate to view them because I couldn't find any varient configuration from admin/config/search/simplesitemap.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024