Skip to content

Commit

Permalink
[4.x] Fix asset selection request query length (statamic#8209)
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmcclean committed May 29, 2023
1 parent 8f89e49 commit 0606326
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion resources/js/components/fieldtypes/MarkdownFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ export default {
// We don't want to maintain the asset selections
this.selectedAssets = [];
this.$axios.get(cp_url('assets-fieldtype'), { params: { assets } }).then(response => {
this.$axios.post(cp_url('assets-fieldtype'), { assets }).then(response => {
_(response.data).each((asset) => {
var alt = asset.values.alt || '';
var url = encodeURI('statamic:https://'+asset.reference);
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/fieldtypes/assets/AssetsFieldtype.vue
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,8 @@ export default {
this.loading = true;
this.$axios.get(cp_url('assets-fieldtype'), {
params: { assets }
this.$axios.post(cp_url('assets-fieldtype'), {
assets
}).then(response => {
this.assets = response.data;
this.loading = false;
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/fieldtypes/bard/Image.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ export default {
// return;
}
this.$axios.get(cp_url('assets-fieldtype'), {
params: { assets: [id] }
this.$axios.post(cp_url('assets-fieldtype'), {
assets: [id],
}).then(response => {
this.setAsset(response.data[0]);
});
Expand Down
4 changes: 2 additions & 2 deletions resources/js/components/fieldtypes/bard/LinkToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,8 @@ export default {
},
loadAssetData(url) {
this.$axios.get(cp_url('assets-fieldtype'), {
params: { assets: [url] }
this.$axios.post(cp_url('assets-fieldtype'), {
assets: [url],
}).then(response => {
this.selectItem('asset', response.data[0])
this.isLoading = false;
Expand Down
2 changes: 1 addition & 1 deletion routes/cp.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@
Route::get('assets/browse/folders/{asset_container}/{path?}', [BrowserController::class, 'folder'])->where('path', '.*');
Route::get('assets/browse/{asset_container}/{path?}/edit', [BrowserController::class, 'edit'])->where('path', '.*')->name('assets.browse.edit');
Route::get('assets/browse/{asset_container}/{path?}', [BrowserController::class, 'show'])->where('path', '.*')->name('assets.browse.show');
Route::get('assets-fieldtype', [FieldtypeController::class, 'index']);
Route::post('assets-fieldtype', [FieldtypeController::class, 'index']);
Route::resource('assets', AssetsController::class)->parameters(['assets' => 'encoded_asset']);
Route::get('assets/{encoded_asset}/download', [AssetsController::class, 'download'])->name('assets.download');
Route::get('thumbnails/{encoded_asset}/{size?}/{orientation?}', [ThumbnailController::class, 'show'])->name('assets.thumbnails.show');
Expand Down

0 comments on commit 0606326

Please sign in to comment.