diff options
author | David Rothstein <drothstein@gmail.com> | 2013-12-30 18:46:34 -0500 |
---|---|---|
committer | David Rothstein <drothstein@gmail.com> | 2013-12-30 18:46:34 -0500 |
commit | a4a72dc277fc89eb36964c1509ad1b30121a013a (patch) | |
tree | b433075f02648add69b02d7c89b356ff8c61d557 /modules/node/tests | |
parent | cb7127c514aee7e66659da3f20348db4c013a40c (diff) | |
download | brdo-a4a72dc277fc89eb36964c1509ad1b30121a013a.tar.gz brdo-a4a72dc277fc89eb36964c1509ad1b30121a013a.tar.bz2 |
Issue #1146244 by Dean Reilly, klausi, fago, firebird, David_Rothstein, aaronbauman, shenzhuxi, jaanhoinatski, themoep, citlacom: Node_access integrity constraint violation on module_invoke_all('node_' . $op, $node);.
Diffstat (limited to 'modules/node/tests')
-rw-r--r-- | modules/node/tests/node_test.module | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/node/tests/node_test.module b/modules/node/tests/node_test.module index fb6678521..edc175f19 100644 --- a/modules/node/tests/node_test.module +++ b/modules/node/tests/node_test.module @@ -161,3 +161,21 @@ function node_test_entity_view_mode_alter(&$view_mode, $context) { $view_mode = $change_view_mode; } } + +/** + * Implements hook_node_insert(). + * + * This tests saving a node on node insert. + * + * @see NodeSaveTest::testNodeSaveOnInsert() + */ +function node_test_node_insert($node) { + // Set the node title to the node ID and save. + if ($node->title == 'new') { + $node->title = 'Node '. $node->nid; + // Remove the is_new flag, so that the node is updated and not inserted + // again. + unset($node->is_new); + node_save($node); + } +} |