Custom pagerer style plugin has no tag mapping

Created on 10 May 2024, 7 months ago

Problem/Motivation

I am trying to create a custom PagererStyle plugin.
The config form triggers this warning:

Warning: Undefined array key "mapping"

  at modules/contrib/pagerer/src/Plugin/pagerer/PagererStyleBase.php:328

I think this happens because my custom style does not exist in pagerer.data_types.schema.yml.

Steps to reproduce

Create a custom style like this:


namespace Drupal\foo\Plugin\pagerer;

use Drupal\pagerer\Plugin\pagerer\Standard;

/**
 * @PagererStyle(
 *    id = "foo",
 *    title = @Translation("Foo"),
 *    short_title = @Translation("Foo"),
 *    style_type = "base"
 *  )
 */
class Concertina extends Standard {

}

Try to use it on a pager and configure it.

(Note that I also had to manually create the config/sync/pagerer.style.foo config

Proposed resolution

Creating a custom style plugin could be made easier, but it should at least avoid this warning by checking if $display_tags['mapping'] exists before trying to use it.

🐛 Bug report
Status

Active

Version

3.1

Component

Code

Created by

🇫🇷France prudloff Lille

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024