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

moshe weitzman’s picture

Status: Active » Postponed (maintainer needs more info)

try head. wfm.

kars-t’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

I close this as can't reproduce as this error is gone. But now devel doesn't generate any nodes at all...

Now it's

File temporary://imagefield_AQa4LC.png could not be copied, because the destination directory %directory is not configured correctly.

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).

Notice: Undefined index: vid in _taxonomy_devel_generate() (line 23 of /home/karsten/www/d7-cvs/drupal/sites/all/modules/devel/devel_generate/taxonomy.devel_generate.inc).

Quiet frustrating. I will look if there are already issues about this or create new ones but close this.

Thanks Moshe!

kgaut’s picture

Version: 7.x-1.0-beta2 » 7.x-1.0-rc1
Status: Closed (cannot reproduce) » Active

same 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).

kgaut’s picture

Version: 7.x-1.0-rc1 » 7.x-1.2
salvis’s picture

Please 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...

Rob_Feature’s picture

Project: Devel » Drupal core
Version: 7.x-1.2 » 7.7
Component: devel_generate » file system

No 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.

kars-t’s picture

Hi

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?

salvis’s picture

We 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...

Von Gunther’s picture

Same 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.

kars-t’s picture

Status: Active » Fixed

I 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.

Status: Fixed » Closed (fixed)

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

josejayesh’s picture

Got 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

salvis’s picture

@josejayesh: Please open a new issue.

You get the same error message, but for a different reason.

kenorb’s picture

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] => 12459 [:db_insert_placeholder_4] => 1 ) in file_usage_add() (line 661 of /Users/kenorb/Sites/XXX/docroot/includes/file.inc).

Drupal 7.14
Any follow-up?
UPDATE: Found: #1627860: Unable to add new content with empty upgraded image/file field

salvis’s picture

You'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.

deltab’s picture

I 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

salvis’s picture

Version: 7.7 » 7.14
Status: Closed (fixed) » Active

#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.

deltab’s picture

@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?

salvis’s picture

Status: Active » Closed (fixed)

@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.

jenlampton’s picture

Version: 7.14 » 7.16
Status: Closed (fixed) » Closed (duplicate)

I 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.