getHandler() != getHandler()

Created on 21 February 2019, almost 6 years ago
Updated 2 September 2024, 3 months ago

One would expect that the getHandler() method returns the handler object in both cases.
However while:

$executable->setDisplay($display_id);
$executable->getDisplay()->getHandler('field', $field['id']);

does return the actual handler,

$executable->getHandler($display_id, 'field', $field['id']);

just returns the configuration of the handler instance on a given display.

Can't we rename the latter to getHandlerConfiguration() or something?

This holds even more as ViewExecutable::getHandlers(string $type, string $display_id=NULL) returns an array of the actual handler instances.

We should also bring the arguments in line. getHandlers() takes the arguments the other way around, because it defaults to the current display, which is a good thing.

So I'd propose something like: ViewExecutable::getHandlerConfiguration(string $type, string $id, string $display_id=NULL) : array|null, defaulting to the current display, while deprecating the old ViewExecutable::getHandler(string $display_id, string $type, string $id) : array|null

๐Ÿ“Œ Task
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Viewsย  โ†’

Last updated about 4 hours ago

Created by

Pancho UTC+2 ๐Ÿ‡ช๐Ÿ‡บ EU

Live updates comments and jobs are added and updated live.
  • Novice

    It would make a good project for someone who is new to the Drupal contribution process. It's preferred over Newbie.

Sign in to follow issues

Merge Requests

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