processwire-issues icon indicating copy to clipboard operation
processwire-issues copied to clipboard

Lister: title label on one template affects all filter rows

Open Toutouwai opened this issue 1 year ago • 0 comments

Short description of the issue

I have two templates, one where the title field has been relabelled and one where it has the default field label:

2024-10-31_132044 2024-10-31_132124

The page structure is that the child page has "my_template" and the parent page has "my_parent_template".

2024-10-31_132159

I have Lister configured as below (typically this would be done via a Lister Pro config but this is to demonstrate that the issue is with ProcessPageLister).

$wire->addHookBefore('ProcessPageLister::execute', function(HookEvent $event) {
    /** @var ProcessPageLister $lister */
    $lister = $event->object;
    $lister->useColumnLabels = true;
    $lister->initSelector = 'template=my_template';
    $lister->defaultSelector = 'title%=, parent.title%=';
});

Note how the title field label for my_template seems to be affecting all title fields that are used in the Lister filters. The problem doesn't occur in the column labels.

2024-10-31_132638

For a parent.title filter I don't expect that Lister could detect a relabelled title field (if that had been done) because the parent template could be anything, but it should just show the default label of "Title" because the custom title label for one template won't make sense for other templates.

Setup/Environment

  • ProcessWire version: 3.0.241

Toutouwai avatar Oct 31 '24 00:10 Toutouwai