Make getEntity available in FlagConfirmFormBase.php

Created on 9 February 2021, about 4 years ago
Updated 19 February 2025, 2 months ago

Problem/Motivation

Using Flag module on the d8 site, which has a custom save function that requires access to the flaggable entity for some functionality

As currently implemented the flag confirm form doesn't provide any method to access the flaggable entity from the $form or $form_state objects

Steps to reproduce

create a hook_form_FORM_ID_alter() function in a custom module, customising the flag confirm form.
attempt to access the related entity object from the data made available by the hook

Proposed resolution

Add a public getEntity method to the FlagConfirmFormBase.php class

Remaining tasks

User interface changes

API changes

adds a public method getEntity which returns $this->entity

Data model changes

Feature request
Status

Active

Version

4.0

Component

Miscellaneous

Created by

Live updates comments and jobs are added and updated live.
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