davidyell / CakePHP-Proffer

An upload plugin for CakePHP 3
MIT License
117 stars 63 forks source link

Seed is untentionnaly removed ;) #262

Closed Kitcat711 closed 6 years ago

Kitcat711 commented 6 years ago

Bonjour,

Using CakePHP 3.5 I have a table AccountingRecordsTable with this initialize section $this->addBehavior('Proffer.Proffer', [ 'scan_file' => [ // The name of your upload field 'root' => WWW_ROOT . 'files', // Customise the root upload folder here, or omit to use the default 'dir' => 'doc_dir', // The name of the field to store the folder ] ]);

the seed is then the id from another table to which AccountingRecords belongs. If I just change: 'dir' => 'folder',

the seed in the path is the uuid.

How can I have the uuid with my original configuration? I hope I made myself understandable.

Thank you for reading and helping. Kitcat711

davidyell commented 6 years ago

Sounds like you have that field set in the entity already, so that value is being used.

https://github.com/davidyell/CakePHP3-Proffer/blob/master/src/Lib/ProfferPath.php#L199

As it will only generate a UUID if a seed is not used. All I could suggest here would be ensuring that your entities configured dir field is empty.

$accountRecordEntity->set('dir', null)