bobmulder on master
Use 'fields' from CreatedBy or … (compare)
martonmiklos on master
Fix null pointer exception in W… (compare)
true
in your Entity
Isn't the DS constant set differently on different systems? So on my Debian server it's "/" and on Windows it would be "\"?
It sounds like you're saving the path as a string and therefore the / or \ is being saved also, but possibly incorrectly. You need to save the path without the slashes and build the path with the DS constant instead.
protected function _setUploadColumns($entity, $field, $options = [])
{
$fieldConfig = $this->config($field);
$_upload = $this->_uploads[$field];
// set all columns with values
foreach ($fieldConfig['fields'] as $key => $column) {
if ($column) {
if ($key == "directory") {
$entity->set($column, $this->_getPath($entity, $field, ['root' => false, 'file' => false]));
}
if ($key == "type") {
$entity->set($column, $_upload['type']);
}
if ($key == "size") {
$entity->set($column, $_upload['size']);
}
if ($key == "fileName") {
$entity->set($column, $this->_getFileName($entity, $field, $options = []));
}
if ($key == "filePath") {
$entity->set($column, $this->_getPath($entity, $field, ['root' => false, 'file' => true]));
}
}
}
return $entity;
}