Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin Url Fix for linking from Edit/Detail to Index pages. #6252

Conversation

bytes-commerce
Copy link
Contributor

Scenario:

  • have two entity CRUD forms
  • have some entities in Entity 1
  • have a few, or none in Entity 2
  • have a association or relation to Entity 2 from Entity 1, but allow it to be null and let it be null (no links existing)
  • have a link to the Crud Index for Entity 2 in the Form of Entity 1 (when updating / FK existing)
  • click the link

Expected result:

  • you get redirected to the Index Page of the desired CRUD

Result:

  • Exception, as the FK of Entity 1 does not exist in Entity 2
  • and if it would, it would be the wrong one, but thats not a bug / exception

The main point is that the current setup assumes that there will always be existing links. Since non-referring pages like the Index do not need the entityId parameter, we can unset it when the scenario is matched (URL goes to Index, EntityId is set).

@javiereguiluz javiereguiluz added this to the 4.x milestone Oct 17, 2024
@javiereguiluz
Copy link
Collaborator

Thank you Max and sorry it took us so long to merge this.

@javiereguiluz javiereguiluz force-pushed the adminUrl-generation-from-edit-detail-to-index-fix branch from 990cd64 to 54e8c80 Compare October 17, 2024 18:04
@javiereguiluz javiereguiluz merged commit 304ebb1 into EasyCorp:4.x Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants