Download & Extend

PHP safe bundle names

Project:XML sitemap
Version:7.x-2.x-dev
Component:xmlsitemap_menu.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

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.

Comments

#1

Status:active» needs review

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

AttachmentSizeStatusTest resultOperations
xmlsitemap-safe-bundle-names-1821268.patch592 bytesIdleFAILED: [[SimpleTest]]: [MySQL] 524 pass(es), 3 fail(s), and 0 exception(s).View details | Re-test

#2

Status:needs review» needs work

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

#3

Status:needs work» needs review

#1: xmlsitemap-safe-bundle-names-1821268.patch queued for re-testing.

#4

Status:needs review» needs work

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

#5

Maybe move the str_replace before the array assignment.

<?php
$text
= str_replace('-', '_', $text);
?>

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

#6

Status:needs work» needs review

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

AttachmentSizeStatusTest resultOperations
xmlsitemap-safe-bundle-names-1821268-5.patch630 bytesIdleFAILED: [[SimpleTest]]: [MySQL] 524 pass(es), 3 fail(s), and 0 exception(s).View details | Re-test

#7

Status:needs review» needs work

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

#8

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.

nobody click here