Active
Project:
Embedded Media Field
Version:
6.x-3.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Oct 2011 at 16:12 UTC
Updated:
29 Nov 2011 at 08:27 UTC
I "believe" I've found an issue when creating nodes programmatically and switching databases.
Basically, when doing the following, the embedded video fails to save to the database. The node is created, but any reference to the emfield is just NULL'ed.
db_set_active("production");
$query = db_query("SELECT nid,title,type FROM {node} WHERE nid = 3150");
while($node = db_fetch_object($query)) {
$source = node_load($node->nid);
}
db_set_active("default");
$node = array(
"title" => $source->title,
"body" => $source->body,
"type" => "story"
);
$node["field_video"][0]["embed"] = "http://www.youtube.com/watch?v=cFEarBzelBs";
if ($node = node_submit($node)) {
node_save($node);
}
When removing any db switching, it works fine.
Comments
Comment #1
ytokan commentedHi
look here http://realize.be/nodeload-after-switching-database-cck-dangerous and the comment's
I have the same probleme. It's come with the node_load function and CCKfied cache
I trie this function to swith databe
Yto