Skip to content
Snippets Groups Projects
Commit e719d5cf authored by David Rothstein's avatar David Rothstein
Browse files

Issue #1576552 by jhedstrom, jcisio, markie: Prevent PHP notices in...

Issue #1576552 by jhedstrom, jcisio, markie: Prevent PHP notices in path_node_insert/update if $node->path is defined but $node->path['alias'] is not
parent 21598ba6
No related branches found
No related tags found
No related merge requests found
......@@ -185,7 +185,7 @@ function path_form_element_validate($element, &$form_state, $complete_form) {
* Implements hook_node_insert().
*/
function path_node_insert($node) {
if (isset($node->path)) {
if (isset($node->path) && isset($node->path['alias'])) {
$path = $node->path;
$path['alias'] = trim($path['alias']);
// Only save a non-empty alias.
......@@ -205,9 +205,9 @@ function path_node_insert($node) {
function path_node_update($node) {
if (isset($node->path)) {
$path = $node->path;
$path['alias'] = trim($path['alias']);
$path['alias'] = isset($path['alias']) ? trim($path['alias']) : '';
// Delete old alias if user erased it.
if (!empty($path['pid']) && empty($path['alias'])) {
if (!empty($path['pid']) && !$path['alias']) {
path_delete($path['pid']);
}
path_node_insert($node);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment