Bug after PR 7600
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Start at createEntity in the provided CrossSellCrudController example and inspect the behavior introduced by PR #7600. Reproduce the issue with the provided CrossSell entity and edit form; done means opening an edit form no longer adds a new Campaign element or calls createEntity unexpectedly.
Written by the indexing model from the issue text.
Description
Hello
Related #7600
Describe the bug
After #7600 on my project I got a bug - createEntity called unexpectly while editing entries.
To Reproduce
class CrossSell
{
__construct(
#[ORM\ManyToOne(targetEntity: CrossSellCampaign::class, inversedBy: 'crossSells')]
#[ORM\JoinColumn(name: 'campaign_id', nullable: false)]
private CrossSellCampaign $campaign,
)
{
$this->campaign->addCrossSell($this); // this needed to consistent two-way relations (Symfony way)
}
}
class CrossSellCrudController extends AbstractCrudController
{
public function createEntity(string $entityFqcn): CrossSell
{
$campaign = $this->em->getRepository(CrossSellCampaign::class)->findOneBy([]);
assert($campaign instanceof CrossSellCampaign);
$po = $this->em->getRepository(PriceOption::class)->findOneBy([]);
assert($po instanceof PriceOption);
$entity = new CrossSell(
$campaign,
$po,
position: 0,
placement: PlacementEnum::PROMO_BLOCK,
actionType: ActionTypeEnum::ADD,
);
return $entity;
}
}
After edit form opened a new random element is added to Campaign since createEntity is called unexpectedly.
- Dominant language
- PHP
- Stars
- 4.3k
- Forks
- 1.1k
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 52
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from EasyCorp/EasyAdminBundle
-
bug design
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
EasyCorp/EasyAdminBundle#7958 ·
Maintainers usually reply within 2 days
-
design feature
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
EasyCorp/EasyAdminBundle#7930 ·
Maintainers usually reply within 2 days
-
design
Difficulty 2/5 Under an hour Newbie friendliness 88/100
EasyCorp/EasyAdminBundle#7879 ·
Maintainers usually reply within 2 days
-
design
Difficulty 1/5 Under an hour Newbie friendliness 90/100
EasyCorp/EasyAdminBundle#7875 ·
Maintainers usually reply within 2 days
-
#[AdminRoute]: the requirements of an action silently replace the ones of the classPossibly taken @anthonyhacart claimed this 1 day ago. Openfeature
Difficulty 3/5 Half a day Newbie friendliness 30/100
EasyCorp/EasyAdminBundle#7956 ·
Maintainers usually reply within 2 days
All issues in EasyCorp/EasyAdminBundle
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
taskforcesh/bullmq#5238 ·
Maintainers usually reply within 1 day
-
[Bug] v-change-database-password reports success but doesn't change the password when MySQL validate_password rejects itPossibly taken @bfs2021 claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Automattic/jetpack#55517 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
area/import type/enhancement when/later
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day