Fails if called twice

Created on 7 May 2024, 7 months ago

Problem/Motivation

When I using this plugin I see the query() method is called twice, once from ViewExecutable and then again from ExposedFormPluginBase.

The first time the $placeholder_suffix is built correctly as the placeholder function has the correct state.
However the second time this fails as the placeholder function state was modified the first time round.

Steps to reproduce

Looks like it's having an exposed form the triggers this method to be called twice.

Proposed resolution

Cache the placeholder suffix in the local class the first time it's generated to can be used again.

Of course consideration may need to be given to what happens if there are multiple views using this feature on the same page.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇬🇧United Kingdom dahousecat

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

Comments & Activities

  • Issue created by @dahousecat
  • 🇬🇧United Kingdom dahousecat

    This is the patch I'm using as I know I will only 1 have instance per page.
    This patch won't work if you have multiple views on the same page all using this sorting plugin.

Production build 0.71.5 2024