I noticed some invalid code in path.inc, drupal_valid_path() while stepping through.

$form_item doesn't exist, and the keys being referenced don't exist in the menu_router table. (link_path, link_title)

$item['link_path'] and $item['link_title'] are being used in _menu_link_translate() and _menu_item_localize(), so I fixed the var and array key names to populate those.

Relative code in core/includes/path.inc

<?php
if ($item = db_query("SELECT * FROM {menu_router} where path = :path", array(':path' => $path))->fetchAssoc()) {
 
$item['link_path']  = $form_item['link_path'];
 
$item['link_title'] = $form_item['link_title'];
 
$item['external']   = FALSE;
 
$item['options'] = '';
 
_menu_link_translate($item);
}
?>

Cleaned up version.

<?php
if ($item = db_query("SELECT * FROM {menu_router} where path = :path", array(':path' => $path))->fetchAssoc()) {
 
$item['link_path']  = $item['path'];
 
$item['link_title'] = $item['title'];
 
$item['external']   = FALSE;
 
$item['options'] = '';
 
_menu_link_translate($item);
}
?>

That said, I'm not sure how menu link items are supposed to support wildcards. You can trigger this code by adding a menu item with "/%" somewhere in the path.

Files: 
CommentFileSizeAuthor
#4 drupal_valid_path_cleanup-7-2106129-4.patch775 bytesbrad.bulger
PASSED: [[SimpleTest]]: [MySQL] 40,907 pass(es).
[ View ]
drupal_valid_path_cleanup.patch795 bytesmmilano
PASSED: [[SimpleTest]]: [MySQL] 58,835 pass(es).
[ View ]

Comments

Priority:Major» Normal
Status:Needs review» Reviewed & tested by the community

Nice find!
Thankfully we're actively working to remove the {menu_router} table, so this is not a major bug.
Also, I don't think we need tests for that case either, same reason.

So, RTBC!

Status:Reviewed & tested by the community» Fixed

Hm. Okie doke then!

Committed and pushed to 8.x. Thanks!

Status:Fixed» Closed (fixed)

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

Issue summary:View changes

additional info

Version:8.x-dev» 7.x-dev
Issue summary:View changes
Status:Closed (fixed)» Needs review
Issue tags:+Needs backport to 7.x
StatusFileSize
new775 bytes
PASSED: [[SimpleTest]]: [MySQL] 40,907 pass(es).
[ View ]

Same issue and fix applies in 7.x

Status:Needs review» Reviewed & tested by the community

Thanks!

Issue tags:+Quick fix

#4 fixes an issue I had with trying to use a to_arg function within a custom menu item. Hope this can be committed soon!