Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
If i try to link a file (file entity module) via entity reference with the inline entity form then there will no form showing up just the messages
Notice: Undefined property: stdClass::$fid in file_entity_access() (line 1616 of /var/www/vhosts/commercetest.malta1066.server4you.de/httpdocs/sites/all/modules/file_entity/file_entity.module).
Notice: Undefined property: stdClass::$fid in file_entity_access() (line 1616 of /var/www/vhosts/commercetest.malta1066.server4you.de/httpdocs/sites/all/modules/file_entity/file_entity.module).
Comments
Comment #1
TimG1 CreditAttribution: TimG1 commentedHello!
I am getting the same behavior on reference fields that reference a File Entity. The following error appears on the /node/add/my_entity_type page that contains an entity reference field to a File Entity.
Drupal v7.31
Entity API v7.x-1.5
Entity Reference v7.x-1.1
File Entity v7.x-2.0-alpha3 and v7.x-2.x-dev (2014-Sep-10)
Inline Entity Form v7.x-1.5 and v7.x-1.x-dev (2014-Mar-22)
Thanks for reading,
-Tim
Comment #2
TinaRey CreditAttribution: TinaRey commentedI think I'm having a similar problem, just that instead of showing errors, the entity form doesn't show up at all on the parent form. I found a module that works for me: https://www.drupal.org/project/file_entity_inline but this one doesn't work with the media widget.
Comment #3
euk CreditAttribution: euk commentedHello!
Just heads up for those who will be fixing this...
file_entity_access() expects the second argument to be a valid file object with file ID defined, while in case of inline entity form it can be either NULL or a file type object with just two properties: $file::type and $file::is_new.
In both cases, if {...} statement on line 1603 in file_entity_access() will fail:
...
Comment #4
euk CreditAttribution: euk commentedHello there!
Further investigation led me to the similar topic https://www.drupal.org/node/2312603
There is a patch that solves the notice.
However, File Entity support is still needed - the entity form doesn't show up cuz there is no controller that would display the form.
Cheers!
Comment #5
frobComment #6
bojanz CreditAttribution: bojanz commentedFile entity needs to add IEF integration, not the other way around.
See #2038053: Inline entity form support for an issue in the file_entity issue queue, for example.