Skip to content
Snippets Groups Projects
Commit 634893f2 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch 5683 by JonBob: changes the multiple type delimiter from / to -.
parent b4f628c1
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -227,7 +227,7 @@ function node_teaser($body) { ...@@ -227,7 +227,7 @@ function node_teaser($body) {
*/ */
function node_get_module_name($node) { function node_get_module_name($node) {
if (is_array($node)) { if (is_array($node)) {
if ($pos = strpos($node['type'], '/')) { if ($pos = strpos($node['type'], '-')) {
return substr($node['type'], 0, $pos); return substr($node['type'], 0, $pos);
} }
else { else {
...@@ -235,7 +235,7 @@ function node_get_module_name($node) { ...@@ -235,7 +235,7 @@ function node_get_module_name($node) {
} }
} }
else if (is_object($node)) { else if (is_object($node)) {
if ($pos = strpos($node->type, '/')) { if ($pos = strpos($node->type, '-')) {
return substr($node->type, 0, $pos); return substr($node->type, 0, $pos);
} }
else { else {
...@@ -243,7 +243,7 @@ function node_get_module_name($node) { ...@@ -243,7 +243,7 @@ function node_get_module_name($node) {
} }
} }
else if (is_string($node)) { else if (is_string($node)) {
if ($pos = strpos($node, '/')) { if ($pos = strpos($node, '-')) {
return substr($node, 0, $pos); return substr($node, 0, $pos);
} }
else { else {
...@@ -1521,8 +1521,7 @@ function node_page() { ...@@ -1521,8 +1521,7 @@ function node_page() {
node_feed(); node_feed();
return; return;
case 'add': case 'add':
// When a module defines multiple node types, the URL is of the form 'foo/bar': print theme('page', node_add(arg(2)));
print theme('page', node_add(arg(3) ? arg(2) ."/". arg(3) : arg(2)));
break; break;
case 'edit': case 'edit':
print theme('page', node_edit(arg(2))); print theme('page', node_edit(arg(2)));
......
...@@ -227,7 +227,7 @@ function node_teaser($body) { ...@@ -227,7 +227,7 @@ function node_teaser($body) {
*/ */
function node_get_module_name($node) { function node_get_module_name($node) {
if (is_array($node)) { if (is_array($node)) {
if ($pos = strpos($node['type'], '/')) { if ($pos = strpos($node['type'], '-')) {
return substr($node['type'], 0, $pos); return substr($node['type'], 0, $pos);
} }
else { else {
...@@ -235,7 +235,7 @@ function node_get_module_name($node) { ...@@ -235,7 +235,7 @@ function node_get_module_name($node) {
} }
} }
else if (is_object($node)) { else if (is_object($node)) {
if ($pos = strpos($node->type, '/')) { if ($pos = strpos($node->type, '-')) {
return substr($node->type, 0, $pos); return substr($node->type, 0, $pos);
} }
else { else {
...@@ -243,7 +243,7 @@ function node_get_module_name($node) { ...@@ -243,7 +243,7 @@ function node_get_module_name($node) {
} }
} }
else if (is_string($node)) { else if (is_string($node)) {
if ($pos = strpos($node, '/')) { if ($pos = strpos($node, '-')) {
return substr($node, 0, $pos); return substr($node, 0, $pos);
} }
else { else {
...@@ -1521,8 +1521,7 @@ function node_page() { ...@@ -1521,8 +1521,7 @@ function node_page() {
node_feed(); node_feed();
return; return;
case 'add': case 'add':
// When a module defines multiple node types, the URL is of the form 'foo/bar': print theme('page', node_add(arg(2)));
print theme('page', node_add(arg(3) ? arg(2) ."/". arg(3) : arg(2)));
break; break;
case 'edit': case 'edit':
print theme('page', node_edit(arg(2))); print theme('page', node_edit(arg(2)));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment