Verified Commit de1a892e authored by Dave Long's avatar Dave Long
Browse files

Issue #3556493 by longwave, alexpott, catch: Fix deprecation in ContentEntityStorageBase::__get()

(cherry picked from commit 2c0aa979)
parent ea0226fd
Loading
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -1482,14 +1482,21 @@ public function resetCache(?array $ids = NULL) {

  /**
   * Warns about deprecated/removed properties.
   *
   * @param string $name
   *   The property to get the value of.
   *
   * @return mixed
   *   The value of the deprecated/removed $name property.
   */
  public function __get(string $name): mixed {
  public function __get(string $name) {
    if ($name === 'latestRevisionIds') {
      @trigger_error('Getting the static cache of latest revision IDs is deprecated in drupal:11.3.0 and is removed from drupal:12.0.0. You can retrieve it from the \'entity.memory_cache\' service instead. See https://www.drupal.org/node/3535160', E_USER_DEPRECATED);
      return [];
    }

    return $this->$name ?? NULL;
    trigger_error('Undefined property ' . __CLASS__ . "::\${$name}", E_USER_WARNING);
    return NULL;
  }

  /**