Closed (fixed)
Project:
Feeds
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
17 Sep 2010 at 16:55 UTC
Updated:
19 Oct 2012 at 11:01 UTC
With a new install of D7 dev with devel and pathauto, running on ubuntu 8.04 with php 5.2.4.
devel_generate fails to create content of the default type "Article" with the following error:
Fatal error: Cannot access empty property in /var/www/public/modules/field/field.attach.inc on line 198.
It works for Basic pages and for a custom content type, but fails as soon as I include articles.
Comments
Comment #1
nomonstersinme commentedThis is also happening for me... except i get the following error message:
I can get it to generate any other node type except article, so i'm assuming although the error messages are different that they are some how related.. hope that helps! :)
Comment #2
moshe weitzman commentedfile permissions problem. see file settings in admin.
"The specified file temporary://imagefield_LdK4cm.png could not be copied, because the destination directory is not properly configured. This may be caused by a problem with file or directory permissions. More information is available in the system log."
Comment #4
Argus commentedI also get a
Fatal error: Cannot access empty property in /var/www/public/modules/field/field.attach.inc on line 198.
In a fresh installation (Drupal 7.0-beta1) logged in as administrator, the sites/default/files directory has the proper rights ((image)field module can write). For instance it's no problem to manually create an article containing an image.
So imho this issue should not have the status fixed, I'm so bold to reopen the issue. Correct me if I'm wrong :)
Comment #5
westba commentedI get the following warning when generating a page content type (pages are generated) ...
Warning: Parameter 1 to devel_generate_node_insert() expected to be a reference, value given in module_invoke_all() (line 768 of C:\xampp\htdocs\drupal7\includes\module.inc).
There are no messages and no content is generated when attempting to generate Article content type. HOWEVER, when I delete the Tags field from the Article content type, content IS generated with the same warning message as above.
Comment #6
acouch commentedI had the same problems described above. It seems like this is two issues.
1) Generate fails when the 'field' directory in the 'files' directory is not created. That directory (sites/default/files/field) is created, I assume by the field module, once I upload an image through imagefield or I manually add that directory.
So either core should create that upon install or devel_generate should check that it exists first.
2) When the taxonomy module is on I get the following:
Fatal error: Cannot access empty property in /var/www/example/modules/field/field.attach.inc on line 198
Comment #7
mynameispj commentedI'm having similar issues. The server drops the connection if I try to generate nodes in the stock Article content type.
If I try to create "Basic Page" nodes or Term nodes it has no problem.
Furthermore, I can delete the stock Article content type, and then recreate it with the exact same name and settings, and suddenly Generate Content works perfectly.
Comment #8
doublejosh commented(EDITED)
Believe @aaroncouch and @mynameispj are right.
Uploaded one node first to create the directory within /files... (since it doesn't get created by adding/saving the file field while managing the content type, though that's an idea) ...and I still get the same devel error: Cannot access empty property - field.attach.inc on line 198
Then added a basic page just fine.
and Still couldn't create a default type Post, which is nothing but a node with tags.
Definitely saw this same issue with a ternary test on an isset with empty object property just a few weeks ago in the Drupal5 Node Import module, ha! My work around was to set a default on the above equivalent of
$entity->{$field_name}But it's more likely devel will be patched first, so what's calling...
function _field_invoke($op, $entity_type, $entity, &$a = NULL, &$b = NULL, $options = array()) {...because devel is not?
I don't have trace or debugging going, just a configer and themer :)
Comment #9
moshe weitzman commentedCould someone find the code that creates these subdirs inside of files? Then we can add the same code to File field's devel_generate implementation.
Comment #10
acouch commentedhi Moshe:
These two bugs were fixed in the 7.x-1.x-dev version when you cleaned up the taxonomy generation and added 'file_prepare_directory($destination_dir, FILE_CREATE_DIRECTORY);' to the image.devel_generate.inc' file.
I'm marking as closed.
Comment #12
safetypinI just encountered this error after updating to the latest dev release of devel (02/25). I'm not using a fresh install, but testing out the upgrade path for an existing site with one custom content type, and several content types that utilize fields.
What should I do to figure out where this is coming from?
Comment #13
moshe weitzman commentedComment #14
emkamau commentedHi
Same problem, but with the feeds module in D7 and feeds 7.x-2.x-dev and 7.x-2.x-alpha3
Previously successful csv file imports suddenly started failing with the following error
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: /batch?id=68&op=do StatusText: OK ResponseText: Fatal error: Cannot access empty property in .../modules/field/field.attach.inc on line 198
I don't know what happened as the same file was being imported successfully.
THe imports are successful if I replace the data in the file with nothing but numbers. However, adding any text causes the import to fail with above error.
I'm generating the csv from a libreoffice calc spreadsheet and saving as UTF8.
emk
PS I posted this in the Feeds issue queue and got no response. Posting here seems to be more appropriate.
Comment #15
brink commentedNote that this happens if you ever hit "save" on the Mappings page without selecting a mapping. The code apparently doesn't check to make sure you aren't submitting defaults, which results in a feed item -> node mapping of [select source]->[select target]
Furthermore, proper checking is never done in the code to ensure that the mapped item is not blank (which is what you get if you have "select item select source" saved
Interim fix is to remove the bad mapping
Comment #16
emackn commentedComment #17
twistor commentedIf #12 is correct, then this was fixed some time ago.