getgrav / getgrav/grav-plugin-admin
Cannot upluad a image in a module blueprint
- Dominant language
- PHP
- Stars
- 377
- Forks
- 225
- Avg merge
- 11h 51m
- Merged PRs (30d)
- 4
Description
When I tried upload image in a module blueprint, this show me the following error:
```
vendor.min.js?0a482fb02a:16 POST http://www.nexumport.cl/admin/pages/home/_features.json 404 (Not Found)
value @ vendor.min.js?0a482fb02a:16
value @ vendor.min.js?0a482fb02a:16
(anonymous) @ vendor.min.js?0a482fb02a:16
(anonymous) @ vendor.min.js?0a482fb02a:16
transformFile @ vendor.min.js?0a482fb02a:15
s @ vendor.min.js?0a482fb02a:16
value @ vendor.min.js?0a482fb02a:16
value @ vendor.min.js?0a482fb02a:16
value @ vendor.min.js?0a482fb02a:16
value @ vendor.min.js?0a482fb02a:16
value @ vendor.min.js?0a482fb02a:16
(anonymous) @ vendor.min.js?0a482fb02a:16
setTimeout (async)
value @ vendor.min.js?0a482fb02a:16
(anonymous) @ vendor.min.js?0a482fb02a:16
y @ admin.min.js?0a482fb02a:6
accept @ admin.min.js?0a482fb02a:6
value @ vendor.min.js?0a482fb02a:16
value @ vendor.min.js?0a482fb02a:16
(anonymous) @ vendor.min.js?0a482fb02a:15
admin.min.js?0a482fb02a:6 Uncaught TypeError: Cannot read property 'message' of undefined
at t.value (admin.min.js?0a482fb02a:6)
at l.value (vendor.min.js?0a482fb02a:15)
at l.value (vendor.min.js?0a482fb02a:16)
at l.value (vendor.min.js?0a482fb02a:16)
at l.value (vendor.min.js?0a482fb02a:16)
at XMLHttpRequest.i.onload (vendor.min.js?0a482fb02a:16)
```
The yaml file is:
```
title: Providers
'@extends':
type: default
context: blueprints://pages
form:
fields:
tabs:
fields:
advanced:
fields:
columns:
fields:
column1:
fields:
name:
default: modular/features
@data-options: '\Grav\Common\Page\Pages::modularTypes'
overrides:
fields:
header.template:
default: modular/features
@data-options: '\Grav\Common\Page\Pages::modularTypes'
features:
type: tab
title: Features
fields:
header.features:
name: features
type: list
label: Features
fields:
.name:
type: text
label: Name
.logo:
type: file
label: Image
destination: 'theme@:/img/providers'
multiple: false
preview_images: true
accept:
- .png
- .jpg
.text:
type: text
label: Text
```
I tried to changed files of th Admin plugin to the files of develop branch and the problem still continues.
Contributor guide
Research direction
Reproduce the upload with the provided blueprint and inspect the POST request to /admin/pages/home/_features.json alongside vendor.min.js and admin.min.js. Trace the 404 and the subsequent undefined-message error; done means the image upload succeeds and failures no longer produce an uncaught client error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- api, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100