EasyCorp / EasyCorp/EasyAdminBundle

Allow reading of processed form in CrudController

Open
#7,254 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
PHP
Stars
4.3k
Forks
1.1k
Avg merge
8d 2h
Merged PRs (30d)
11

Description

Currently it is impossible to read anything from the form, as the controller does not pass it to any events or protected functions. It's simply read, processed and discarded.

Short description of what this feature will allow to do:
Allow custom processing of forms in edit/new actions.

Example of how to use this feature

        if ($newForm->isSubmitted() && $newForm->isValid()) {
            $this->processUploadedFiles($newForm);
            $this->processNewForm($newForm);

We could use it in our application as it does things EA really doesn't allow by default (injecting entities dynamically in subforms, main forms, etc.) right now I need to override the new method and manually look for the submit button, then find the values I passed (without processing from form), you can see how it's annoying.

It wouldn't be a lot of work either, since it's just 2 methods, that return void and do nothing by default.
If accepted I could prepare the MR for it too.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading CrudController and tracing how the edit and new actions process forms before discarding them. Check the events and protected functions involved in those actions. Done means custom processing can access the processed form in both flows without overriding the actions; add coverage for the two methods if the existing test structure identifies a suitable location.

Written by the indexing model from the issue text.

Assessment

Tech stack
php, symfony
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.