Hi,
I am using a CVS D7 and just want to create some nodes. Than I run into those errors:
* Warning: Parameter 1 to devel_generate_node_insert() expected to be a reference, value given in module_invoke_all() (line 755 of /home/karsten/www/d7-cvs/drupal/includes/module.inc).
* The specified file temporary://imagefield_8Owj5t.png could not be copied, because the destination public://field/image/imagefield_8Owj5t.png is not properly configured. This is often caused by a problem with file or directory permissions.
* Notice: Trying to get property of non-object in _image_devel_generate() (line 34 of /home/karsten/www/d7-cvs/drupal/sites/all/modules/devel/devel_generate/image.devel_generate.inc).
* Notice: Trying to get property of non-object in _image_devel_generate() (line 45 of /home/karsten/www/d7-cvs/drupal/sites/all/modules/devel/devel_generate/image.devel_generate.inc).
* Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 167 of /home/karsten/www/d7-cvs/drupal/includes/entity.inc).
* Notice: Trying to get property of non-object in file_field_presave() (line 221 of /home/karsten/www/d7-cvs/drupal/modules/file/file.field.inc).
* Notice: Undefined property: stdClass::$uri in file_save() (line 535 of /home/karsten/www/d7-cvs/drupal/includes/file.inc).
* PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'fid' cannot be null: INSERT INTO {file_usage} (count, fid, module, type, id) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => file [:db_insert_placeholder_3] => node [:db_insert_placeholder_4] => 12 ) in file_usage_add() (line 616 of /home/karsten/www/d7-cvs/drupal/includes/file.inc).
I set file access to 777 so it shouldn't be an access problem. But I can't create articles which use an image. Stories run without any problems. Ubuntu lucid lynx PHP 5.3.
Comments
Comment #1
moshe weitzman commentedtry head. wfm.
Comment #2
kars-t commentedI close this as can't reproduce as this error is gone. But now devel doesn't generate any nodes at all...
Now it's
Quiet frustrating. I will look if there are already issues about this or create new ones but close this.
Thanks Moshe!
Comment #3
kgaut commentedsame problem here with drupal 7.7
PDOException : SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'fid' cannot be null: INSERT INTO {file_usage} (fid, module, type, id, count) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => file [:db_insert_placeholder_2] => node [:db_insert_placeholder_3] => 2771 [:db_insert_placeholder_4] => 1 ) dans file_usage_add() (ligne 663 dans /media/www/MYSITE/includes/file.inc).
Comment #4
kgaut commentedComment #5
salvisPlease enable Devel's Traceback Error Handler and post the call stack, so we can see where this is coming from. You can also check the functions and their arguments, maybe you'll find the cause of the problem yourself...
Comment #6
Rob_Feature commentedNo sure why this is listed as a devel issue. I dont have devel installed, and am seeing it in Drupal 7.7. I think this should be assigned to core.
I have an imagefield which is not required. If you create a node without uploading an image, I see this error.
Comment #7
kars-t commentedHi
I put this into the devel issue queue because the error seemed to reside in devels node creation. And the issue is nearly a year old now.
So how do you create the nodes?
Comment #8
salvisWe should probably start by fixing the file system issue. This may take care of the subsequent errors.
Start by fixing the non-replacement of the %directory variable, so that you can see where you're trying to copy to.
Have you by any chance configured open_basedir? I have the feeling that this is working for most sites...
Comment #9
Von Gunther commentedSame problem 'PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'fid' cannot be null: INSERT INTO {file_usage} ...'
If you try to save a node and do not upload an image file it throws the above exception.
I created and attached the fields programmatically, when the image field is created using the gui interface the problem disapears, so i guess the problem is the non existent documentation on how to programmatically create image fields, or alternatively a bug in the _createfield code.
I have to congratulate Drupal for the novel documentation system, i.e. dissasemble and learn.
Comment #10
kars-t commentedI am setting this to fixed again because I can't see any clear bug for this issue.
@Gunther
Your problems don't seem to be releated to the devel module. If the problem resides please collect more information an open a core issue.
Comment #12
josejayesh commentedGot the same problem (when performed a login operation)
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'identifier' cannot be null: INSERT INTO {flood} (event, identifier, timestamp, expiration) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3); Array ( [:db_insert_placeholder_0] => failed_login_attempt_ip [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => 1325164794 [:db_insert_placeholder_3] => 1325168394 ) in flood_register_event() (line 1153 of /var/www/html/fast/includes/common.inc).
Version - Drupal 7.10
Comment #13
salvis@josejayesh: Please open a new issue.
You get the same error message, but for a different reason.
Comment #14
kenorb commentedDrupal 7.14
Any follow-up?
UPDATE: Found: #1627860: Unable to add new content with empty upgraded image/file field
Comment #15
salvisYou're showing the same error as #3. The answer is #5. Since you're not using image, as you state in the other thread, there may be two different issues leading to the same error.
If there's no follow-up from those who have an issue, nothing will happen, obviously.
Comment #16
deltab commentedI also get this. Is there a solution for non-developers? I apologize, I am not a developer, and would still like to export and import my "nodes" into my sites, if it is humanly possible please let me know.
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'fid' cannot be null: INSERT INTO {file_usage} (fid, module, type, id, count) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4); Array
Comment #17
salvis#5 is not a solution or work-around, it's just the first step in trying to diagnose where the error comes from. You don't need to be a developer (nor apologize for that :-)) -- you can still install the Devel module, go to its configuration page and enable its backtrace error handler. With user 1 do whatever it takes to get the error and you should see additional information. Post a screenshot of that.
Comment #18
deltab commented@salvis, I just want a hassle-free way of copying all my nodes from one database to another, if it is possible in Drupal. I said I am not a developer and it will be very difficult for me to "diagnose" anything, I just want to copy nodes from one site to another.
Is it possible in Drupal or I should manually copy-paste all 4,000 nodes?
Comment #19
salvis@deltab:
I've offered to look into the problem, which might lead to a solution. However, the problem is on your site and I cannot see what you see, so I've asked you to cooperate at the site administrator level, not at the developer level.
It doesn't take a developer to install a module and upload a screenshot, but you don't want to do that, and that's fine.
Comment #20
jenlamptonI think this is still a problem, so changing the status since it has not been fixed. For others having this problem please see #1627860: Unable to add new content with empty upgraded image/file field where we are actively working on a solution.