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.
I'm getting the "Fatal error: Call to a member function label() on a non-object in /sites/all/modules/contrib/entity/entity.module on line 1075" error when I click on "Import mailchimp activity entity" (on /admin/config/services/mailchimp/activity/import) using the MailChimp module. Updating the module to 7.x-1.2 does not fix the issue :-(
Anyone having this issue?
Comment | File | Size | Author |
---|---|---|---|
#25 | entity-label-2112755-25.patch | 1.57 KB | kristiaanvandeneynde |
#11 | entity-fixed-call-non-object-label-2112755-11.patch | 2.17 KB | kristiaanvandeneynde |
#6 | entity-fix-entity_ui_get_page_title-2112755-6.patch | 1.07 KB | ruscoe |
#3 | entity-2112755-3.patch | 1.59 KB | SchnWalter |
Comments
Comment #1
SchnWalter CreditAttribution: SchnWalter commentedIt looks like EntityDefaultUIController::hook_menu() calls drupal_get_form with NULL instaed of an entity. entity_ui_get_page_title() crashes when trying to get the label. There is a fix in the attached diff.
Comment #3
SchnWalter CreditAttribution: SchnWalter commentedAdded patch
Comment #4
SchnWalter CreditAttribution: SchnWalter commentedComment #5
SchnWalter CreditAttribution: SchnWalter commentedComment #6
ruscoe CreditAttribution: ruscoe commentedRefactored entity_ui_get_page_title to avoid function call on non-object in entity_label when $entity is NULL. Patched against latest dev version.
Comment #7
magicmyth CreditAttribution: magicmyth commentedPatch #6 works for me against 7.x-1.5 and solves the problem I was having with Mailchimp module. Holding of on RTBC this until I've tested a bit more but looking good so far.
Comment #8
entendu CreditAttribution: entendu commented#6 works for me and solves a problem with importing Workflows. Commit ASAP IMO.
Comment #9
magicmyth CreditAttribution: magicmyth commentedNothing has gone boom after over a week so RTBC.
Comment #10
basvredelingAgreed, patch in #6 is fine
Comment #11
kristiaanvandeneyndeAlthough this issue should be resolved asap, the patch in #6 is broken. By removing the check for an entity, you're just moving the WSOD further down the line, check entity_extract_ids():
Attached is a different approach.
Comment #12
phenaproximaThe patch in #11 fixes this bug for me, as it occurs in the CER module: #2341403: WSOD at admin/config/content/cer/import. Marking RTBC.
Comment #13
basvredeling#11 looks good
Comment #14
fagoThis now calls entity_ui_get_action_title() with other than the support opersations, thus is bogus.
I'd suggest keeping the old flow instead but falling back to another label if no $entity is given, e.g. the entity type label.
Comment #15
kristiaanvandeneyndeI'm not sure...
How does it call that entity_ui_get_action_title() with any $op except 'add' and 'import'? Any other operation requires an entity ('edit', 'clone', 'delete', 'revert', 'view', 'export') and would thus get caught in the switch.
The only ones that should fall through are the ones that generally don't need an entity at all: 'add', 'import' and any other unsupported operator that someone should manually pass on, which would break anyway.
Comment #16
fagoNot any more if the entity is NULL. The documentation says I can call it without entity in all cases, thus it should work in all of those cases. I'd suggest generating $label as the entity type label if no entity is passed and keeping the existing flow of things.
Comment #17
kristiaanvandeneyndeOkay, I'll try to update the patch when I can (currently at Drupalcon).
Comment #18
ofry CreditAttribution: ofry commentedThere is my patch with generating $label as entity type label if $entity = NULL.
Comment #20
phenaproxima@ofry, it looks like that patch had bad header information (it contained the full path to your clone of Entity API, starting with "C:/"), so the testbot couldn't handle it. I have re-rolled the patch and attached it.
Comment #21
kristiaanvandeneyndeThe patch in #18 (copied in #20) contains several flaws:
Comment #22
phenaproximaHere's a streamlined and modified version of @ofry's patch, addressing the issues you mentioned. Even the whitespace. ;)
Comment #23
phenaproximaNah, screw that, here's a better one.
Comment #24
phenaproximaHiding broken patches in issue summary.
Comment #25
kristiaanvandeneyndeIsn't this much cleaner?
It takes a small hit on extracting the bundle whether you need it or not, but has all the checks at the top.
Comment #26
kristiaanvandeneynde#23 looks clean too, so I'm even.
Comment #27
phenaproximaI like your version better. #25 looks great to me.
Comment #28
kristiaanvandeneyndeGreat, back to fago then :)
Comment #29
fagoThanks, committed.