Problem/Motivation

Whenever I try and build the sitemap for the first time, I always hit this error:

InvalidArgumentException: Field changed is unknown. in Drupal\Core\Entity\ContentEntityBase->getTranslatedField()

because of this building the site map always fails.

Proposed resolution

Figure out why the module is looking for a changed field on an entity that doesn't have that field.

Remaining tasks

  1. Write Patch

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

davidwbarratt created an issue. See original summary.

davidwbarratt’s picture

Status: Active » Closed (works as designed)

Nevermind, looks like I had an entity that was using Drupal\Core\Entity\EntityChangedTrait without actually having the changed field.

Karthikeyan Kathiresan’s picture

Hi davidwbarratt,

I'm also facing the same issue. Can you please help me to solve this issue ?

Thanks

alexpott’s picture

Status: Closed (works as designed) » Needs review
FileSize
815 bytes

The way the code is looking for the method is a bit old skool - why not just use the interface. Maybe the interface did not exist when this code was written though... it was added in #2044583: Add EntityChangedInterface to allow entities with "changed" field to be properly cached. This will be more reliable.

  • juampynr committed cac6912 on 8.x-1.x authored by alexpott
    Issue #2747373 by alexpott: InvalidArgumentException: Field changed is...
juampynr’s picture

Status: Needs review » Fixed

Committed. Thanks!

Status: Fixed » Closed (fixed)

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