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

Gaufrette issue after editing object #98

Open
rpostolov opened this issue Jul 30, 2014 · 2 comments
Open

Gaufrette issue after editing object #98

rpostolov opened this issue Jul 30, 2014 · 2 comments
Assignees

Comments

@rpostolov
Copy link

Hi,

I'm on Symfony 2.3, i use knp_gaufrette bundle with vich_uploader bundle with admingenerator bundle. When i create a new object and i upload an image all works perfectly, my image is uploaded, my data base is updated with the name of image but when i want to edit (not update) this object i have this issue insteade of the form :

The specified path (gaufrette://drapeau_image_fs\53d8d34ee6d0e.jpg) is invalid.

Someone for help i search everywhere nad i found no solutions...

Here is my config :

PaysAdmin-generator.yml
...
drapeauFile:
label: Flag
formType: afe_single_upload
dbType: string
addFormOptions:
nameable: drapeau
data_class: Symfony\Component\HttpFoundation\File\File
previewImages: true
previewAsCanvas: true
previewFilter: drapeau200w200h
...

app/config.yml

knp_gaufrette:
stream_wrapper: ~
adapters:
drapeau_adapter:
local:
directory: %kernel.root_dir%/../web/images/drapeau

filesystems:       
    drapeau_image_fs:
        adapter:    drapeau_adapter

vich_uploader:
db_driver: orm
gaufrette: true
twig: true
storage: vich_uploader.storage.gaufrette

mappings:  
    drapeau_image:
        uri_prefix: /images/drapeau
        upload_destination: drapeau_image_fs
        namer: vich_uploader.namer_uniqid
        delete_on_remove: true # determines whether to delete file upon removal of entity
        delete_on_update: true #
        inject_on_load: true # determines whether to inject a File instance upon load
@python33
Copy link

python33 commented Nov 6, 2014

Hi,
I working on windows now and have the same issue.
Because of path separators "" after using "parse_url" array parameter $parts['host'] takes both host an path parts.
As a result $key variable becomes empty and you getting this error.

f.e.:

$path = "gaufrette://ckeditor_fs\545b52d0f2300_Hydrangeas.jpg";
$parts = parse_url($path);

# On windows $parts variable takes following result.
# array(5) {
#     ["scheme"] => string(9) "gaufrette"
#     ["host"] => string(40) "ckeditor_fs\545b52d0f2300_Hydrangeas.jpg"
#     ["path"] => NULL
#     ["query"] => NULL
#     ["fragment"] => NULL
# }

image

@python33
Copy link

python33 commented Nov 6, 2014

I think this issue should be referenced to Gaufrette library.

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

No branches or pull requests

4 participants