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

#337 Fix uploads with nested resources and multiple panels #407

Merged

Conversation

tobias-grasse
Copy link
Contributor

When a media upload is submitted from a parent resource form (e.g. media is associated on a user’s profile, but you want to edit the whole user from the user resource form), this ensures that the media upload is properly associated.

This PR implements the change suggested by @aqjw in #337.

I also tested that the upload still works when submitted directly from the resource form where the media collection is defined (i.e. from the user's profile resource edit form).

When a media upload is submitted from a parent resource form (e.g. media is associated on a user’s profile, but you want to edit the whole user from the user resource form), this ensures that the media upload is properly associated.

Signed-off-by: Tobias Grasse <tg@glancr.de>
Signed-off-by: Tobias Grasse <tg@glancr.de>
Same prefix key logic as in c57633b

Signed-off-by: Tobias Grasse <tg@glancr.de>
@tobias-grasse
Copy link
Contributor Author

I updated my fork to also handle custom properties for nested forms / panels.

@bkintanar bkintanar merged commit a589cc3 into ebess:master Aug 21, 2023
bkintanar pushed a commit that referenced this pull request Aug 24, 2023
* #337 Add TODO for deprecated interface

Illuminate\Contracts\Validation\Rule was deprecated in laravel/framework v10, should be replaced with ValidationRule once the minimum required version is 10.

Signed-off-by: Tobias Grasse <tg@glancr.de>

* #337 Pass requestAttribute down to media handling functions

Both `addNewMedia` and `addExistingMedia` also call `HandlesExistingMediaTrait::fillMediaCustomPropertiesFromRequest` which requires `$requestAttribute` for nested forms since 079b866

Signed-off-by: Tobias Grasse <tg@glancr.de>

* #337 Formatting, reorder imports, add @throws tag

Signed-off-by: Tobias Grasse <tg@glancr.de>

---------

Signed-off-by: Tobias Grasse <tg@glancr.de>
Gompje pushed a commit to DaktaDeo/advanced-nova-media-library that referenced this pull request Mar 29, 2024
…s#407)

* ebess#337 Fix uploads with nested resources and multiple panels

When a media upload is submitted from a parent resource form (e.g. media is associated on a user’s profile, but you want to edit the whole user from the user resource form), this ensures that the media upload is properly associated.

Signed-off-by: Tobias Grasse <tg@glancr.de>

* ebess#337 Update import order

Signed-off-by: Tobias Grasse <tg@glancr.de>

* ebess#337 Handle nested forms and multiple panels

Same prefix key logic as in c57633b

Signed-off-by: Tobias Grasse <tg@glancr.de>

---------

Signed-off-by: Tobias Grasse <tg@glancr.de>
Gompje pushed a commit to DaktaDeo/advanced-nova-media-library that referenced this pull request Mar 29, 2024
* ebess#337 Add TODO for deprecated interface

Illuminate\Contracts\Validation\Rule was deprecated in laravel/framework v10, should be replaced with ValidationRule once the minimum required version is 10.

Signed-off-by: Tobias Grasse <tg@glancr.de>

* ebess#337 Pass requestAttribute down to media handling functions

Both `addNewMedia` and `addExistingMedia` also call `HandlesExistingMediaTrait::fillMediaCustomPropertiesFromRequest` which requires `$requestAttribute` for nested forms since 079b866

Signed-off-by: Tobias Grasse <tg@glancr.de>

* ebess#337 Formatting, reorder imports, add @throws tag

Signed-off-by: Tobias Grasse <tg@glancr.de>

---------

Signed-off-by: Tobias Grasse <tg@glancr.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants