Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Some contributed modules extend the functionality of entities using the Entity API for retrieving entity information. These contributed modules use entity names and bundle names for generating classes and functions. This doesn't work when entity or bundle names contain illegal characters such as hyphens. The XML Sitemap Menu module generates bundle names for the 'menu_link' entity it defines using menu names. Menu names can contain hyphens.
Proposed resolution
A simple replacing of hyphens with underscores would solve this issue.
Remaining tasks
Needs Review.
Comment | File | Size | Author |
---|---|---|---|
#6 | xmlsitemap-safe-bundle-names-1821268-5.patch | 630 bytes | jantoine |
#1 | xmlsitemap-safe-bundle-names-1821268.patch | 592 bytes | jantoine |
Comments
Comment #1
jantoine CreditAttribution: jantoine commentedThe attached patch replaces all hyphens in menu names with underscores when declaring entity bundles.
Comment #3
jantoine CreditAttribution: jantoine commented#1: xmlsitemap-safe-bundle-names-1821268.patch queued for re-testing.
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedMaybe move the str_replace before the array assignment.
I'm not saying this is the correct thing to do. Dave needs to weigh in on the change.
Comment #6
jantoine CreditAttribution: jantoine commentedNote sure why this would help, but attempting solution proposed in #5.
Comment #8
Anonymous (not verified) CreditAttribution: Anonymous commentedYour change is causing the drupalPost method of the DrupalWebTestCase to not find the status and priority fields on the form. You'll need to determine why.