Skip to content
Snippets Groups Projects
Commit 8b1900b1 authored by Chris Leppanen's avatar Chris Leppanen
Browse files

Issue #1245094 by chrisdejager, dman: Fixed Node menu link deleted on update.

parent 32969628
No related branches found
No related tags found
No related merge requests found
...@@ -46,6 +46,8 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -46,6 +46,8 @@ class FeedsNodeProcessor extends FeedsProcessor {
* *
* If the update existing method is not FEEDS_UPDATE_EXISTING, only the node * If the update existing method is not FEEDS_UPDATE_EXISTING, only the node
* table will be loaded, foregoing the node_load API for better performance. * table will be loaded, foregoing the node_load API for better performance.
*
* @todo Reevaluate the use of node_object_prepare().
*/ */
protected function entityLoad(FeedsSource $source, $nid) { protected function entityLoad(FeedsSource $source, $nid) {
if ($this->config['update_existing'] == FEEDS_UPDATE_EXISTING) { if ($this->config['update_existing'] == FEEDS_UPDATE_EXISTING) {
...@@ -57,6 +59,14 @@ class FeedsNodeProcessor extends FeedsProcessor { ...@@ -57,6 +59,14 @@ class FeedsNodeProcessor extends FeedsProcessor {
$node->uid = $this->config['author']; $node->uid = $this->config['author'];
} }
node_object_prepare($node); node_object_prepare($node);
// Workaround for issue #1247506. See #1245094 for backstory.
if (!empty($node->menu)) {
// If the node has a menu item(with a valid mlid) it must be flagged
// 'enabled'.
$node->menu['link']['enabled'] = (int) (bool) $node->menu['link']['mlid'];
}
// Populate properties that are set by node_object_prepare(). // Populate properties that are set by node_object_prepare().
if ($this->config['update_existing'] == FEEDS_UPDATE_EXISTING) { if ($this->config['update_existing'] == FEEDS_UPDATE_EXISTING) {
$node->log = 'Updated by FeedsNodeProcessor'; $node->log = 'Updated by FeedsNodeProcessor';
......
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