Permalink
Browse files

MINOR Only set folder field state in AssetAdmin if a folder is shown

  • Loading branch information...
chillu committed Jun 14, 2012
1 parent a64cf8c commit 3c81958345dfa7f444bea9ccdce98ba5bb0214e3
Showing with 1 addition and 1 deletion.
  1. +1 −1 code/controllers/AssetAdmin.php
@@ -135,7 +135,7 @@ public function getEditForm($id = null, $fields = null) {
$folder = ($id && is_numeric($id)) ? DataObject::get_by_id('Folder', $id, false) : $this->currentPage();
$fields = $form->Fields();
$title = ($folder && $folder->exists()) ? $folder->Title : _t('AssetAdmin.FILES', 'Files');
- $fields->push(new HiddenField('ID', false, $folder->ID));
+ $fields->push(new HiddenField('ID', false, $folder ? $folder->ID : null));
// File listing
$gridFieldConfig = GridFieldConfig::create()->addComponents(

0 comments on commit 3c81958

Please sign in to comment.