FriendsOfCake / cakephp-upload

CakePHP: Handle file uploading sans ridiculous automagic
https://cakephp-upload.readthedocs.io/
MIT License
551 stars 255 forks source link

Data not being inserted to database #471

Closed lucasreta closed 7 years ago

lucasreta commented 7 years ago

Following the docs, I added the plugin to my project, loaded it up on the bootstrap file, added the behavior to my model, modified form create & input to be of type file. I additionally tried using requirePrescence on create and notEmpty validation rules.

The request sent from the form seems to be in order, the file array shows valid data. There's no error thrown, validation works OK.

The problem is that files aren't moved into the proper directory and that the generated query doesn't save the fields related to the plugin. The generated query shows:

INSERT INTO events (
  name, link, description, created, modified
) 
VALUES 
(
    '', '', '', '2017-10-09 10:13:47', 
    '2017-10-09 10:13:47'
)

The only other fields on the database are the "photo" and "dir" fields.

CLOSED:

Sorry for opening this, I then realized I was working with the auto-generated entities and the photo and dir fields weren't in the database when I baked them, so they were inaccessible.