Permalink
Browse files

Merge branch 'refs/heads/56-variations-admin-hotfix'

  • Loading branch information...
2 parents b1c15bb + 3184f66 commit 268bbe39d2494b22818a7e2313431bc57c7c1c84 @jedateach jedateach committed Jun 11, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 code/variations/ProductAttributeType.php
@@ -34,7 +34,13 @@ function getCMSFields(){
'Value' => 'TextField',
'Sort' => 'TextField'
);
- $fields->addFieldToTab("Root.Values", new TableField("Values", "ProductAttributeValue",$fieldList,$fieldTypes));
+ if($this->isInDB()){
+ $valuesTable = new TableField("Values", "ProductAttributeValue",$fieldList,$fieldTypes);
+ $valuesTable->setCustomSourceItems($this->Values());
+ }else{
+ $valuesTable = new LiteralField("Values", "<p class=\"message warning\">Save first, then you can add values.</p>");
+ }
+ $fields->addFieldToTab("Root.Values", $valuesTable);
return $fields;
}

0 comments on commit 268bbe3

Please sign in to comment.