I created an entity/bundle with ECK and added the bundle as a field in a custom content type. Using Inline Entity Form, I was able to successfully configure the form and page display view modes and create a new node. Upon editing the same node I get a fatal php error:

Call to undefined method Drupal\\eck\\Entity\\EckEntity::getChangedTime()

Adding the function to this file allows me to edit the node.

Issue fork eck-2659916

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

snappermorgan created an issue. See original summary.

akalata’s picture

Adding the function to this file allows me to edit the node.

What function did you add to what file?

Other questions since I am not able to reproduce the issue:

  • What version of Inline Editing Form are you using?
  • What base fields do you have configured for your base ECK entity?

Looking at core for examples, this module should probably add EntityChangedInterface as an extend to the EckEntity base class (or in EckEntityInterface?), but I can't be sure that this will fix OP's issue.

legolasbo’s picture

Issue tags: +Quick fix
pratik.mehta19’s picture

rshafakian’s picture

Status: Active » Closed (cannot reproduce)

CLosing this as it cannot be reproduced. This can be reopen with detailed steps to reproduce the issue if it still exists.

demonde’s picture

I have the same error when I have a paragraph from the paragraphs project within a ECK entity bundle

Error: Call to undefined method Drupal\eck\Entity\EckEntity::getChangedTime() in paragraphs_edit_paragraph_view_alter() (line 54 of modules/paragraphs_edit/paragraphs_edit.module).

This is kind of strange because I did not use paragraphs edit in this context.

legolasbo’s picture

Status: Closed (cannot reproduce) » Active

Thanks for reporting that this still is an issue @demonde.

Would it at all be possible to provide us with clear steps to reproduce on a vanilla Drupal installation? These steps should contain something following:

  1. Install modules X, Y, Z
  2. Create eck entity type X
  3. Add bundle Y to eck entity type X
  4. Add fields A, B to bundle Y
  5. etc...
  6. Create eck entity of type X
  7. etc...
  8. See things go boom.
demonde’s picture

This will take me a moment @legolasbo since this is a complex installation.

Right now my configuration is a

  • block entity "component" that has a
  • inline entity reference
  • to a ECK entity "component"
  • with the bundle "block" that
  • has paragraphs field.

The reason is that for such a complex nested structure is to build a page footer that contains dynamic paragraphs editable by editors.

If I uninstall the paragraphs edit project the error message is gone. That is what is sufficient for me right now. Anyway there must me an entity expectation by the paragraphs edit project that is broken.

I cannot promise to rebuild this structure in a way to find the "go boom" factor in the upcoming days since I am quite busy right now.

demonde’s picture

Ok, I found the probable culprit:

https://www.drupal.org/project/paragraphs_edit/issues/2914976

Revisions log does not attribute author or timestamp correctly

I will test the patch soon.

demonde’s picture

Status: Active » Closed (works as designed)
Related issues: +#2914976: Revisions log does not attribute author or timestamp correctly

Ok, this patch solves this issue. Thus it is not a problem of ECK but of paragraphs edit and the issue can be closed.

But you have a case how this bug can be reasoned.

elgordogrande’s picture

I followed the thread mentioned in #10 and had no success with the patches there. I was able to fix my issue by adding the trait to the EckEntity. I have attached a small patch here.

Matroskeen’s picture

Status: Closed (works as designed) » Needs review

Re-opening because there is a patch.

elgordogrande’s picture

Re-roll to account for poor path management in patch.

Matroskeen’s picture

Given those fields can be missing (they are configurable on entity type level), we cannot use methods provided by EntityChangedTrait trait.

I opened a merge request with our own implementation, that returns either timestamp or NULL if value doesn't not exist and added the same for "created" field.

@elgordogrande, can you review and see if it works for you?
Thanks!

dgroene’s picture

  • Matroskeen committed f144325 on 8.x-1.x
    Issue #2659916 by Matroskeen, elgordogrande, dgroene: Call to undefined...
Matroskeen’s picture

Status: Needs review » Fixed

The merge request was merged into 8.x-1.x.
Thanks!

Status: Fixed » Closed (fixed)

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