I hope this is not a duplicate, I looked and could not find this problem anywhere else.

After creating a clone of a node using the following code:

...

$n=node_load(36,NULL,FALSE);
$n->title=$nid; 
$n->uid=$uid; 
$n->nid=NULL; 
$n->vid=NULL; 
$n->created=NULL; 
node_save($n); 

...

Both the cloned node and the original node stop being viewable with any account other than the admin account.

Both forms are fully function for admin. Logged in with any account other account, users can see the submit button for the form but none of the fields.

The forms are being presented in a block, and there are no restrictions on the block.

I have checked all permissions and do not have any field level permission settings.

I have tried with webform settings for permission on individual webform both on and off on bloth the original and the cloned node.

If a user clicks the submit button the follow errors on shown, which I'm assuming is because the fields are empty.

 Notice: Undefined index: in _webform_filter_values() (line 2714 of /var/www/roleplayingmarket.com/html/sites/all/modules/webform/webform.module).
    Notice: Undefined index: in webform_component_include() (line 3281 of /var/www/roleplayingmarket.com/html/sites/all/modules/webform/webform.module).

Did I miss a step in the cloning if so why does the form work for Admin?

Any help would be greatly appreciated.

Comments

quicksketch’s picture

I'm guessing you may have discovered a bug with #313639: Public vs. private components (maybe).

Could you try creating a new node and see if it has the same problem with components disappearing after doing your custom cloning approach?

My guess is that the new "private" option is not getting copied over from forms that existed before we added that functionality. So any new forms you create will work fine.

I'm at a complete loss as to how the original node could be broken by this though, are you sure it's unmodified by any other code you're doing?

salientknight’s picture

Status: Active » Closed (cannot reproduce)

Thanks quicksketch.

I recreated the form and so far the code works fine. I'll mark this closed and re-open it if I see the error again.

Thanks much,

-=Daniel=-