diem-project / diem

Diem CMF CMS for symfony 1.4
http://diem-project.org/
MIT License
184 stars 85 forks source link

Can not move media? #337

Closed TheCelavi closed 13 years ago

TheCelavi commented 13 years ago

When i try to reorganize media library, i.e. move file into other directory i get:

500 | Internal Server Error | Doctrine_Record_UnknownPropertyException Unknown record property / related component "name" on "DmMedia" stack trace

* at ()
  in SF_ROOT_DIR/diem/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Record/Filter/Standard.php line 55 ...
          52.      */
          53.     public function filterGet(Doctrine_Record $record, $name)
          54.     {
          55.         throw new Doctrine_Record_UnknownPropertyException(sprintf('Unknown record property / related component "%s" on "%s"', $name, get_class($record)));
          56.     }
          57. } 
* at Doctrine_Record_Filter_Standard->filterGet(object('DmMedia'), 'name')
  in SF_ROOT_DIR/diem/dmCorePlugin/lib/doctrine/record/dmDoctrineRecord.php line 700 ...
         697.       $success = false;
         698.       foreach ($this->_table->getFilters() as $filter) {
         699.         try {
         700.           $value = $filter->filterGet($this, $fieldName);
         701.           $success = true;
         702.         } catch (Doctrine_Exception $e) {}
         703.       }
* at dmDoctrineRecord->_get('name', 1)
  in SF_ROOT_DIR/diem/dmCorePlugin/lib/doctrine/record/dmDoctrineRecord.php line 616 ...
         613.       }
         614.     }
         615.
         616.     return $this->_get($fieldName, $load);
         617.   }
         618.
         619.   /**
* at dmDoctrineRecord->get('name')
  in SF_ROOT_DIR/diem/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Access.php line 72 ...
          69.      */
          70.     public function __get($name)
          71.     {
          72.         return $this->get($name);
          73.     }
          74.
          75.     /**
* at Doctrine_Access->__get('name')
  in SF_ROOT_DIR/diem/dmCorePlugin/lib/model/doctrine/PluginDmMedia.class.php line 273 ...
         270.
         271.     if($folder->hasFile($this->file))
         272.     {
         273.       throw new dmException(sprintf('The selected folder already contains a file named "%s".', $this->name));
         274.     }
         275.
         276.     rename($this->fullPath, $folder->fullPath.'/'.$this->file);
* at PluginDmMedia->move(object('DmMediaFolder'))
  in SF_ROOT_DIR/diem/dmCorePlugin/lib/form/doctrine/PluginDmMediaForm.class.php line 68 ...
          65.
          66.     if(isset($moveToFolderId))
          67.     {
          68.       $this->object->move(dmDb::table('DmMediaFolder')->find($moveToFolderId));
          69.     }
          70.   }

71. * at PluginDmMediaForm->doUpdateObject(array('file' => 'sir-i-vino.jpg', 'legend' => 'sir-i-vino', 'author' => 'Dukat', 'license' => '', 'dm_media_folder_id' => '37', 'id' => '134')) in SF_ROOT_DIR/diem/symfony/lib/form/addon/sfFormObject.class.php line 183 ... 180.

  1. $values = $this->processValues($values);
  2. $this->doUpdateObject($values);
  3. // embedded forms
  4. $this->updateObjectEmbeddedForms($values); * at sfFormObject->updateObject() in SF_ROOT_DIR/diem/symfony/lib/form/addon/sfFormObject.class.php line 159 ...
  5. $con = $this->getConnection();
  6. }
  7. $this->updateObject();
  8. $this->getObject()->save($con); 162. * at sfFormObject->doSave(object('Doctrine_Connection_Mysql')) in SF_ROOT_DIR/diem/symfony/lib/form/addon/sfFormObject.class.php line 130 ...
  9. {
  10. $con->beginTransaction();
  11. $this->doSave($con);
  12. $con->commit();
  13. } * at sfFormObject->save() in SF_ROOT_DIR/diem/dmAdminPlugin/modules/dmMediaLibrary/lib/BasedmMediaLibraryActions.class.php line 106 ...
  14. {
  15. $redirect = $form->getValue('file') || $media->dm_media_folder_id != $form->getValue('dm_media_folder_id');
  16. $media = $form->save();
  17. if($redirect)
  18. { * at BasedmMediaLibraryActions->executeSaveFile(object('dmWebRequest')) in SF_ROOT_DIR/diem/symfony/lib/action/sfActions.class.php line 60 ...
    1. }
    2. // run action
    3. return $this->$actionToRun($request);
    4. }
    5. } 63. * at sfActions->execute(object('dmWebRequest')) in SF_ROOT_DIR/diem/symfony/lib/filter/sfExecutionFilter.class.php line 92 ...
    6. {
    7. // execute the action
    8. $actionInstance->preExecute();
    9. $viewName = $actionInstance->execute($this->context->getRequest());
    10. $actionInstance->postExecute();
    11. return null === $viewName ? sfView::SUCCESS : $viewName; * at sfExecutionFilter->executeAction(object('dmMediaLibraryActions')) in SF_ROOT_DIR/diem/symfony/lib/filter/sfExecutionFilter.class.php line 78 ...
    12. }
    13. }
    14. return $this->executeAction($actionInstance);
    15. }
    16. /* \ at sfExecutionFilter->handleAction(object('sfFilterChain'), object('dmMediaLibraryActions')) in SF_ROOT_DIR/diem/symfony/lib/filter/sfExecutionFilter.class.php line 42 ...
    17. {
    18. $timer = sfTimerManager::getTimer(sprintf('Action "%s/%s"', $actionInstance->getModuleName(), $actionInstance->getActionName()));
    19. $viewName = $this->handleAction($filterChain, $actionInstance);
    20. $timer->addTime();
    21. $timer = sfTimerManager::getTimer(sprintf('View "%s" for "%s/%s"', $viewName, $actionInstance->getModuleName(), $actionInstance->getActionName())); * at sfExecutionFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/diem/symfony/lib/filter/sfFilterChain.class.php line 53 ...
    22. }
    23. // execute the next filter
    24. $this->chain[$this->index]->execute($this);
    25. }
    26. } 56. * at sfFilterChain->execute() in SF_ROOT_DIR/diem/dmAdminPlugin/lib/filter/dmAdminInitFilter.php line 32 ...
    27. $this->updateLock();
    28. $filterChain->execute();
    29. if(sfConfig::get('dm_admin_embedded'))
    30. { * at dmAdminInitFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/diem/symfony/lib/filter/sfFilterChain.class.php line 53 ...
    31. }
    32. // execute the next filter
    33. $this->chain[$this->index]->execute($this);
    34. }
    35. } 56. * at sfFilterChain->execute() in SF_ROOT_DIR/diem/symfony/lib/filter/sfBasicSecurityFilter.class.php line 72 ...
    36. }
    37. // the user has access, continue
    38. $filterChain->execute();
    39. }
    40. /* \ at sfBasicSecurityFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/diem/symfony/lib/filter/sfFilterChain.class.php line 53 ...
    41. }
    42. // execute the next filter
    43. $this->chain[$this->index]->execute($this);
    44. }
    45. } 56. * at sfFilterChain->execute() in SF_ROOT_DIR/diem/dmCorePlugin/plugins/dmUserPlugin/lib/dmRememberMeFilter.class.php line 56 ...
    46. }
    47. }
    48. $filterChain->execute();
    49. }
    50. } 59. * at dmRememberMeFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/diem/symfony/lib/filter/sfFilterChain.class.php line 53 ...
    51. }
    52. // execute the next filter
    53. $this->chain[$this->index]->execute($this);
    54. }
    55. } 56. * at sfFilterChain->execute() in SF_ROOT_DIR/diem/symfony/lib/filter/sfRenderingFilter.class.php line 33 ...
    56. public function execute($filterChain)
    57. {
    58. // execute next filter
    59. $filterChain->execute();
    60. // get response object
    61. $response = $this->context->getResponse(); * at sfRenderingFilter->execute(object('sfFilterChain')) in SF_ROOT_DIR/diem/symfony/lib/filter/sfFilterChain.class.php line 53 ...
    62. }
    63. // execute the next filter
    64. $this->chain[$this->index]->execute($this);
    65. }
    66. } 56. * at sfFilterChain->execute() in SF_ROOT_DIR/diem/symfony/lib/controller/sfController.class.php line 233 ...
  19. }
  20. // process the filter chain
  21. $filterChain->execute();
  22. }
  23. else
  24. { * at sfController->forward('dmMediaLibrary', 'saveFile') in SF_ROOT_DIR/diem/symfony/lib/controller/sfFrontWebController.class.php line 48 ...
    1. }
    2. // make the first request
    3. $this->forward($moduleName, $actionName);
    4. }
    5. catch (sfException $e)
    6. { * at sfFrontWebController->dispatch() in SF_ROOT_DIR/diem/dmCorePlugin/lib/context/dmContext.php line 280 ...
  25. */
  26. public function dispatch()
  27. {
  28. $this->getController()->dispatch();
  29. $this->dispatcher->notify(new sfEvent($this, 'dm.context.end'));
  30. } * at dmContext->dispatch() in /var/www/admin_dev.php line 7 ... 4.
    1. $configuration = ProjectConfiguration::getApplicationConfiguration('admin', 'dev', true);
    2. dm::createContext($configuration)->dispatch();

symfony settings ...

app_dmTagPlugin_fcbkcomplete: newel: true filter_case: false filter_hide: false maxshownitems: 30 maxitems: null firstselected: false complete_text: 'Enter za unos reči...' app_newsletter-deactive-action: deactivate app_newsletter-from-email: newsletter@dukat.rs app_newsletter-landing-page-active: 'http://www.dukat.dev/dev.php/magazin/newsletter/active' app_newsletter-landing-page-deactive: 'http://www.dukat.dev/dev.php/magazin/newsletter/deactive' app_newsletter-page-error: 'http://www.dukat.dev/dev.php/magazin/newsletter/error' app_recaptcha_enabled: false app_recaptcha_private_key: 6Ld1hL4SAAAAAB1V96TQPlmEAk1jvC3dTVHhI9RR app_recaptcha_public_key: 6Ld1hL4SAAAAAP67HdIq8LnY8t6uYju0EBDG2xa4 app_sfImageTransformPlugin_default_adapter: GD app_sfImageTransformPlugin_default_image: mime_type: image/png filename: Untitled.png width: 100 height: 100 color: '#FFFFFF' app_sfImageTransformPlugin_font_dir: /usr/share/fonts/truetype/msttcorefonts app_sfImageTransformPlugin_mime_type: auto_detect: false library: gd_mime_type dm_admin_asset: dmAdminPlugin dm_admin_dir: /var/diem/diem/dmAdminPlugin dm_admin_list_truncate: 120 dm_admin_max_per_page:

request ...

options: path_info_key: PATH_INFO path_info_array: SERVER default_format: null logging: '1' relative_url_root: null formats: { txt: text/plain, js: [application/javascript, application/x-javascript, text/javascript], css: text/css, json: [application/json, application/x-json], xml: [text/xml, application/xml, application/x-xml], rdf: application/rdf+xml, atom: application/atom+xml } no_script_name: false parameterHolder: action: saveFile dm_admin_media_form: { file: '', legend: sir-i-vino, author: Dukat, license: '', dm_media_folder_id: '37', id: '134' } dm_cpi: '0' dm_xhr: '1' module: dmMediaLibrary attributeHolder: sf_route: 'sfRoute Object()'

response ...

status: code: 500 text: 'Internal Server Error' options: http_protocol: HTTP/1.1 logging: '1' charset: utf-8 send_http_headers: true content_type: 'text/html; charset=utf-8' cookies: { } httpHeaders: Content-Type: 'text/html; charset=utf-8' javascripts: { } stylesheets: { } metas: { } httpMetas: { }

user ...

options: auto_shutdown: false culture: null default_culture: sr use_flash: true logging: '1' timeout: 1800 attributeHolder: dmSecurityUser: { user_id: '1' } culture: sr

global vars ...

cookie: utma: 184000800.1965382638.1292196275.1293478512.1293484343.10 utmz: 184000800.1292196275.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none) dm_remember_485accca: 7e496fe58dfd69b70590c81d8aff0664 symfony: 6231a032b9f6290468203110e96dd33b env: APACHE_PID_FILE: /var/run/apache2.pid APACHE_RUN_GROUP: www-data APACHE_RUNUSER: www-data LANG: C PATH: '/usr/local/bin:/usr/bin:/bin' PWD: /etc/apache2/sites-enabled SHLVL: '1' : /usr/sbin/apache2 files: { } get: { } post: dm_admin_media_form: { file: '', legend: sir-i-vino, author: Dukat, license: '', dm_media_folder_id: '37', id: '134' } dm_cpi: '0' dm_xhr: '1' server: CONTENT_LENGTH: '242' CONTENT_TYPE: 'application/x-www-form-urlencoded; charset=UTF-8' DOCUMENT_ROOT: /var/www/ GATEWAY_INTERFACE: CGI/1.1 HTTPACCEPT: '/_' HTTP_ACCEPT_CHARSET: 'ISO-8859-1,utf-8;q=0.7,*;q=0.7' HTTP_ACCEPT_ENCODING: 'gzip,deflate' HTTP_ACCEPT_LANGUAGE: 'en-us,en;q=0.5' HTTP_CACHE_CONTROL: no-cache HTTP_CONNECTION: keep-alive HTTP_COOKIE: 'utma=184000800.1965382638.1292196275.1293478512.1293484343.10; utmz=184000800.1292196275.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); symfony=6231a032b9f6290468203110e96dd33b; dm_remember_485accca=7e496fe58dfd69b70590c81d8aff0664' HTTP_HOST: 78.47.244.110 HTTP_KEEP_ALIVE: '115' HTTP_PRAGMA: no-cache HTTP_REFERER: 'http://78.47.244.110/admin_dev.php/tools/media/media/path/about_cheese' HTTP_USER_AGENT: 'Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13' HTTP_X_REQUESTED_WITH: XMLHttpRequest PATH: '/usr/local/bin:/usr/bin:/bin' PATH_INFO: /tools/media/media/saveFile PATH_TRANSLATED: 'redirect:/index.php/media/media/saveFile' PHP_SELF: /admin_dev.php/tools/media/media/saveFile QUERY_STRING: '' REMOTE_ADDR: 94.189.148.97 REMOTE_PORT: '35800' REQUEST_METHOD: POST REQUEST_TIME: 1293604974 REQUEST_URI: /admin_dev.php/tools/media/media/saveFile SCRIPT_FILENAME: /var/www/admin_dev.php SCRIPT_NAME: /admin_dev.php SERVER_ADDR: 78.47.244.110 SERVER_ADMIN: webmaster@localhost SERVER_NAME: 78.47.244.110 SERVER_PORT: '80' SERVER_PROTOCOL: HTTP/1.1 SERVER_SIGNATURE: "

Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch Server at 78.47.244.110 Port 80
\n" SERVER_SOFTWARE: 'Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch' argc: 0 argv: { } session: symfony/user/sfUser/attributes: { dmSecurityUser: { user_id: '1' } } symfony/user/sfUser/authenticated: true symfony/user/sfUser/credentials: [dukat_zaposleni] symfony/user/sfUser/culture: sr symfony/user/sfUser/lastRequest: 1293604947

symfony v.1.4.6 - php 5.2.6-1+lenny9 for help resolving this issue, please visit http://www.symfony-project.org/.

TheCelavi commented 13 years ago

Found it! -> same file name exists! No message there, this should have enchantment, to inform the user that he can not move file/folder because there is the same there.