21288 Posts in 5733 Topics by 2602 members
| Go to End | ||
| Author | Topic: | 2041 Views |
-
Re: Files & images problem

23 January 2010 at 5:15am
the site is braked also the security gives error:
ERROR [Warning]: sprintf() [<a href='function.sprintf'>function.sprintf</a>]: Too few arguments
IN POST /admin/security/getitem?ID=1&ajax=1
Line 1312 in /home/np29484/domains/rannamajad.ee/public_html/cms/code/CMSMain.phpSource
======
1303:
1304: foreach($classes as $i => $class) {
1305: $title = _t("{$class}.MENUTITLE", LeftAndMain::menu_title_for_class($class));
1306: $perms["CMS_ACCESS_" . $class] = array(
1307: 'name' => sprintf(_t(
1308: 'CMSMain.ACCESS',
1309: "Access to %s",
1310: PR_MEDIUM,
1311: "Item in permission selection identifying the admin section, with title and classname. Example:
Access to Files & Images"
* 1312: ), $title),
1313: 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access')
1314: );
1315: }
1316: $perms["CMS_ACCESS_LeftAndMain"] = array(
1317: 'name' => _t('CMSMain.ACCESSALLINTERFACES', 'Access to all CMS sections'),
1318: 'category' => _t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access'),<ul>sprintf(Ligipääs '%s' (%s) juurde,LeftAndMain)
line 1312 of CMSMain.phpCMSMain->providePermissions()
line 499 of Permission.phpPermission::get_codes(1)
line 8 of PermissionCheckboxSetField.phpPermissionCheckboxSetField->__construct(Permissions,Permissions,Permission,GroupID,Group)
line 88 of Group.phpGroup->getCMSFields()
line 61 of SecurityAdmin.phpSecurityAdmin->getEditForm(1)
line 997 of LeftAndMain.phpLeftAndMain->EditForm()
line 345 of LeftAndMain.phpLeftAndMain->getitem(SS_HTTPRequest)
line 196 of Controller.phpController->handleAction(SS_HTTPRequest)
line 135 of RequestHandler.phpRequestHandler->handleRequest(SS_HTTPRequest)
line 150 of Controller.phpController->handleRequest(SS_HTTPRequest)
line 282 of Director.phpDirector::handleRequest(SS_HTTPRequest,Session)
line 127 of Director.phpDirector::direct(/admin/security/getitem)
line 122 of main.php</ul>
-
Re: Files & images problem

28 January 2010 at 11:53am
Hi Webdoc,
I have been offline for a little bit.
Did you manage to get a solution for your problems?
Cheers
Owen -
Re: Files & images problem

3 February 2010 at 10:32am Last edited: 3 February 2010 10:39am
I came across a weird and similar error today, I have the site running on a development server for testing which works fine and a live server which couldn't upload files, but it used to(I think it stopped working properly when upgrading to php5.2.12), although looking in my silverstripe-cache folder, the uploaded files are still sitting in there when they should have been moved rather than just copied to assets.
I made the following changes to sapphire/filesystem/Folder.php starting from line 199(function addUploadToFolder)
if (rename($tmpFile['tmp_name'], "$base/$file")) {
// Update with the new image
return $this->constructChild(basename($file));
} else {
if(!file_exists($tmpFile['tmp_name'])) user_error("Folder::addUploadToFolder: '$tmpFile[tmp_name]' doesn't exist", E_USER_ERROR);
else if (!is_writable(dirname("$base/$file"))) user_error("Folder::addUploadToFolder: '".dirname("$base/$file")."' is not writable by the server user", E_USER_ERROR);
else user_error("Folder::addUploadToFolder: Couldn't copy '$tmpFile[tmp_name]' to '$base/$file'", E_USER_ERROR);
return false;
}basically 2 things:
1. changed move_uploaded_file to rename
2. added else if to check whether folder is writeableworks great now, and uploaded files are moved rather than just copied.
The site is running 2.4alpha
| 2041 Views | ||
| Go to Top |



