I customized a space and then created a blueprint clone.

Then when I went to try it out by creating a new space from the blueprint it seemed to construct the cloned space ok but produced six of these warnings (There are six sections):

Notice: Undefined variable: original_node in oa_clone_save() (line 391 of /usr/local/www/apache22/data/oa/profiles/openatrium/modules/contrib/oa_core/modules/oa_clone/oa_clone.module).

Comments

glennnz’s picture

I am having the same issue.

The Sections are created, but the menu items are not being created.

glennnz’s picture

Priority: Normal » Major

$original_node is not being found in this code:

function oa_clone_save($node) {
  node_save($node);
  if (module_exists('rules')) {
    rules_invoke_event('clone_node', $node, $original_node);
  }
}

I don't know how to fix this...

Argus’s picture

They are not Warnings but Notices. I cannot reproduce it. I cloned a Space and created a new Space with the Blueprint. I get no Notices at all. I think the notices are not very important, and could be ignored. Can you repeat the issue for yourself on a clean installation?

glennnz’s picture

@Argus,

Sure; nevertheless some error or bug is causing a low-level error notification to come up.

Also, having the menu items being created by default would be excellent...

glennnz’s picture

Ah, re my last.

There is a setting on the config page for this but it doesn't work; the enu items are not copied from the section pages of the blueprint.

I suspect this is where the error is coming from but don't have the ability to diagnose further.

christianadamski’s picture

This is oa_clone

function oa_clone($original_node, $space_nid = NULL, $section_nid = NULL, $bypass_access_check = FALSE) {
  $node = oa_clone_prepare($original_node, $space_nid, $section_nid, $bypass_access_check);
  if ($node) {
    oa_clone_save($node);
  }
  return $node;
}

As far as I can tell, it's the only call of oa_clone_save(). And it does not hand over the "original_node" variable. So I would consider this a bug.

christianadamski’s picture

A patch proposal

christianadamski’s picture

Status: Active » Needs review

Forgot to change status

glennnz’s picture

Status: Needs review » Active

For this patch I get the Sections being duplicated, but not the menu items, and get this:

Notice: Undefined variable: original_node in oa_clone_save() (line 391 of /profiles/openatrium/modules/contrib/oa_core/modules/oa_clone/oa_clone.module).

Argus’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

Could you update to the latest OA and check if the issue still exists?

glennnz’s picture

@Argus

Updated, problem still exists.

Argus’s picture

Version: 7.x-2.19 » 7.x-2.21
Status: Postponed (maintainer needs more info) » Active
mpotter’s picture

Status: Active » Needs review

The patch in #7 looks good to me. It doesn't sound like #9 properly applied the patch since that error message isn't possible when the patch is applied.

So, marking this patch for review.

mpotter’s picture

Status: Needs review » Fixed

Had to apply the patch by hand since it refers to the oa_clone in the oa_core/modules dir rather than the new /app/oa_clone directory. But committed it to the -dev of oa_clone module.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.