21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 504 Views |
-
There was an error looking for new files

8 August 2011 at 8:15pm
Hi
I just re-organised some document sub-directories beneath the \assets\ directory, then added a few more documents manually to those sub-directories.When I hit the "Look for new files" button in order to re-synch the directories with the database I get a "There was an error looking for new files" error.
How do I figure out what's wrong?
jf/
-
Re: There was an error looking for new files

8 August 2011 at 8:21pm
If you have firebug installed (in Firefox) I think it's an ajax request so whatever went wrong shows up in the console. Otherwise it's probably really hard to track.
-
Re: There was an error looking for new files

8 August 2011 at 8:29pm
Thanks Smurkas!
Firebug says there's an "Uncaught ValidationException". The full output is below.
I think it's saying it has encountered a file extension it doesn't like, but why would it then abort the entire mission? Is this a SS bug? Or do I simply need to track down the offending file?
jf/
ERROR [User Error]: Uncaught ValidationException: Validation error writing a File object: Extension is not allowed (valid: , ace, arc, arj, asf, au, avi, bmp, bz2, cab, cda, css, csv, dmg, doc, docx, flv, gif, gz, hqx, htm, html, ico, jar, jpeg, jpg, js, m4a, m4v, mid, midi, mkv, mov, mp3, mp4, mpa, mpeg, mpg, ogg, pages, pcx, pdf, pkg, png, pps, ppt, pptx, ra, ram, rm, rtf, sit, sitx, swf, tar, tgz, tif, tiff, txt, wav, wma, wmv, xhtml, xls, xlsx, xml, zip, zipx). Object not written.
IN POST /admin/assets/sync
Line 931 in C:\wamp\www\OlafIntranet\SilverStripe\sapphire\core\model\DataObject.phpSource
======
922: $firstWrite = false;923: $this->brokenOnWrite = true;
924: $isNewRecord = false;
925:
926: if(self::get_validation_enabled()) {
927: $valid = $this->validate();
928: if(!$valid->valid()) {
929: // Used by DODs to clean up after themselves, eg, Versioned
930: $this->extend('onAfterSkippedWrite');
* 931: throw new ValidationException($valid, "Validation error writing a $this->class object: " .
$valid->message() . ". Object not written.", E_USER_WARNING);932: return false;
933: }
934: }
935:
936: $this->onBeforeWrite();
937: if($this->brokenOnWrite) {
Trace
=====
<ul>DataObject->write()
line 348 of Folder.phpFolder->resetFilename()
line 347 of Folder.phpFolder->resetFilename()
line 331 of File.phpFile->setName(External Committees)
line 97 of ImageGalleryPage.phpImageGalleryPage->checkFolder()
line 70 of ImageGalleryPage.phpImageGalleryPage->onAfterWrite()
line 1056 of DataObject.phpDataObject->write()
line 136 of Filesystem.phpFilesystem::sync()
line 498 of AssetAdmin.phpAssetAdmin->sync(SS_HTTPRequest)
line 193 of Controller.phpController->handleAction(SS_HTTPRequest)
line 134 of RequestHandler.phpRequestHandler->handleRequest(SS_HTTPRequest)
line 147 of Controller.phpController->handleRequest(SS_HTTPRequest)
line 283 of Director.phpDirector::handleRequest(SS_HTTPRequest,Session)
line 127 of Director.phpDirector::direct(/admin/assets/sync)
line 127 of main.php</ul>
-
Re: There was an error looking for new files

8 August 2011 at 8:36pm
Yes one would hope that it would simply skip the offending file instead of throwing an exception.
What you can do is add the file type to the list of allowed files.Just add for example:
File::$allowed_extensions[] = "eps"; // This would allow eps-files
in your _config.php and hopefully you shouldn't be getting exceptions anymore. -
Re: There was an error looking for new files

8 August 2011 at 8:57pm
Hmm...
So I go looking for the offending file(s). I remove all the sub-directories completely then add them back one-by-one, hitting the "Look for new files" button each time. And guess what? No more errors! I managed to put all the sub-directories back, hit "Look for new files" one more time just to be sure, and the error is no longer there.
So, good news, I no longer have a problem!
But I am still left wondering what caused the initial problem. Some sort of database corruption maybe?
jf/
-
Re: There was an error looking for new files

8 August 2011 at 9:04pm
I'm not sure. The error seems to be that you have a file somewhere with the wrong extension but since you're not getting that error anymore that can't be the case unless you didn't put all your files back or something. I never use that section of the CMS myself since it always causes me trouble. It's deleted files for me when pressing that button etc so for me it's never been worth the hassle. Also several times when I've gotten an error just pressing the button again has somehow "fixed" it.
Anyways if you get that error again then look through your files and see if you find one that's not on the list and in that casse add it like I showed you. If it's something else then we might have to go digging.
-
Re: There was an error looking for new files

15 April 2013 at 10:43pm
2.4.7
I only seem to get the "extension not allowed" error when trying to rename the extension of a file while keeping the same file name.
If I try to rename a file from "AAABBBCCC.JPG" to "AAABBBCCC.jpg", then I am told that the extension is invalid. Even if "JPG|jpg" are mentioned in the .htaccess file.
If, however, I rename the file from "AAABBBCCC.JPG" to "sports.jpg" then that's all good.
Posting this in case it helps anyone.
| 504 Views | ||
|
Page:
1
|
Go to Top |



