Hi all,
I've come across a problem trying to upload files using the Files and Images page. It only seems to happen on this server which runs php 5.3.2.
Looking at the code in the snippet below it does appear to switch based on being above 5.1.3.
Is this a bug? I'm running git 2.4 branch.
[User Error] Uncaught ReflectionException: Class FileNameFilter does not have a constructor, so you cannot pass any constructor arguments
POST /admin/assets/UploadForm
Line 90 in /var/www/sapphire/core/Object.php
Source
81 * @param mixed $arguments,... arguments to pass to the constructor
82 * @return Object
83 */
84 public static function create() {
85 $args = func_get_args();
86 $class = self::getCustomClass(array_shift($args));
87
88 if(version_compare(PHP_VERSION, '5.1.3', '>=')) {
89 $reflector = new ReflectionClass($class);
90 return $reflector->newInstanceArgs($args);
91 } else {
92 // we're using a PHP install that doesn't support ReflectionClass->newInstanceArgs()
93
94 $args = $args + array_fill(0, 9, null);
95 return new $class($args[0], $args[1], $args[2], $args[3], $args[4], $args[5], $args[6], $args[7], $args[8]);
96 }
Trace
ReflectionClass->newInstanceArgs(Array)
Line 90 of Object.php
Object::create(FileNameFilter)
Line 211 of Folder.php
Folder->addUploadToFolder(Array)
Line 258 of AssetAdmin.php
AssetAdmin->doUpload(Array,Form,SS_HTTPRequest)
Line 329 of Form.php
Form->httpSubmission(SS_HTTPRequest)
Line 143 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 161 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest)
Line 282 of Director.php
Director::handleRequest(SS_HTTPRequest,Session)
Line 125 of Director.php
Director::direct(/admin/assets/UploadForm)
Line 128 of main.php