Revision 582db59d
Added by Assos Assos almost 9 years ago
drupal7/modules/path/path.module | ||
---|---|---|
185 | 185 |
* Implements hook_node_insert(). |
186 | 186 |
*/ |
187 | 187 |
function path_node_insert($node) { |
188 |
if (isset($node->path)) { |
|
188 |
if (isset($node->path) && isset($node->path['alias'])) {
|
|
189 | 189 |
$path = $node->path; |
190 | 190 |
$path['alias'] = trim($path['alias']); |
191 | 191 |
// Only save a non-empty alias. |
... | ... | |
205 | 205 |
function path_node_update($node) { |
206 | 206 |
if (isset($node->path)) { |
207 | 207 |
$path = $node->path; |
208 |
$path['alias'] = trim($path['alias']);
|
|
208 |
$path['alias'] = isset($path['alias']) ? trim($path['alias']) : '';
|
|
209 | 209 |
// Delete old alias if user erased it. |
210 |
if (!empty($path['pid']) && empty($path['alias'])) {
|
|
210 |
if (!empty($path['pid']) && !$path['alias']) {
|
|
211 | 211 |
path_delete($path['pid']); |
212 | 212 |
} |
213 | 213 |
path_node_insert($node); |
Also available in: Unified diff
Update Drupal core to version 7.40