Created on 23 March 2022, about 3 years ago
Updated 19 May 2025, about 18 hours ago

Problem/Motivation

I did exactly the same approach you did before I stumbled across your module. But while doing some refactoring I found a more simple solution. Currently your approach works because it comments out the 'expanded' part of the tree parameter. But what also works is using `null` as that value.

This is the approach I went about. It retains all other inherited functionality which is nice.

    /**
   * {@inheritDoc}
   */
  public function bookTreeAllData($bid, $link = NULL, $max_depth = NULL) {
    $this->loadAllData = TRUE;
    $data = parent::bookTreeAllData($bid, $link, $max_depth);
    $this->loadAllData = FALSE;
    return $data;
  }


  /**
   * {@inheritdoc}
   */
  public function getActiveTrailIds($bid, $link) {
    return $this->loadAllData ? NULL : parent::getActiveTrailIds($bid, $link);
  }

This way the getActiveTrailIds method isn't modified unless called from the bookTreeAllData method.

πŸ“Œ Task
Status

Postponed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pookmish

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024