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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jantoine’s picture

Status: Active » Needs review
FileSize
592 bytes

The attached patch replaces all hyphens in menu names with underscores when declaring entity bundles.

Status: Needs review » Needs work

The last submitted patch, xmlsitemap-safe-bundle-names-1821268.patch, failed testing.

jantoine’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, xmlsitemap-safe-bundle-names-1821268.patch, failed testing.

Anonymous’s picture

Maybe move the str_replace before the array assignment.

$text = str_replace('-', '_', $text);

I'm not saying this is the correct thing to do. Dave needs to weigh in on the change.

jantoine’s picture

Status: Needs work » Needs review
FileSize
630 bytes

Note sure why this would help, but attempting solution proposed in #5.

Status: Needs review » Needs work

The last submitted patch, xmlsitemap-safe-bundle-names-1821268-5.patch, failed testing.

Anonymous’s picture

Your 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.