Problem/Motivation

I'm currently upgrading OpenCulturas in KultinO to 2.6.0 and am experiencing a weird behavior on the dates map: instead of showing only the first 60 items, each iteration in the background adds another 60 items to the list. Due to the fact that we have thousands of events, the list gets longer and longer, filling up the browser's memory until it is completely unusable.

Steps to reproduce

Proposed resolution

I spent some time in the debugger and was able to track down the issue to this line in Drupal\openculturas_map\Plugin\Form\OpenCulturasMapFilterForm:117:

    if ($this->viewExecutable->pager !== NULL) {
      $form['#pager'] = $this->viewExecutable->pager;
    }

This checks for the existence of a pager, without taking care whether initPager() has already been called. In some circumstances, this can return NULL even if the view does have a pager configured.

Instead we should do this:

    if (($pager = $this->viewExecutable->getPager()) !== NULL) {
      $form['#pager'] = $pager;
    }

I have to admit that the mentioned code block hasn't changed between OC 2.5 and 2.6, so I have no idea why this issue occurs to me starting with 2.6. Might have something to do with the update from Drupal 10.5 to 10.6.

Nevertheless, the above change fixes the issue for me.

Remaining tasks

User interface changes

API changes

Data model changes

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:

Comments

mrshowerman created an issue. See original summary.

mrshowerman’s picture

Assigned: mrshowerman » Unassigned
Status: Active » Needs review

tobiasb’s picture

Status: Needs review » Fixed

I change the patch a little bit. ;-)

Commited to 3.0.x and 2.6.x.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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