Skip to content

Commit

Permalink
Fix error when generating pagepart
Browse files Browse the repository at this point in the history
  • Loading branch information
KUNSTMAAN committed Apr 21, 2015
1 parent fdabc09 commit edd710b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ function ($name) use ($fields, $self, $bundle, $generator, $container) {
'mimeTypes' => $mimeTypes,
);

if ($typeStrings [$typeId] == 'image') {
if ($extra == 'image') {

// Ask the minimum height allowed for the image
$lengthValidation = function ($length) {
Expand All @@ -526,7 +526,7 @@ function ($name) use ($fields, $self, $bundle, $generator, $container) {
//Ask the maximum width allowed for the image
$maxWidth = $this->assistant->askAndValidate('What is the maximum width for the media object? (in pixels)', $lengthValidation);

$data = array('name' => $fieldName, 'type' => $typeStrings[$typeId], 'extra' => $extra,
$data = array('name' => $fieldName, 'type' => 'image', 'extra' => $extra,
'minHeight' => $minHeight, 'maxHeight' => $maxHeight, 'minWidth' => $minWidth, 'maxWidth' => $maxWidth, 'mimeTypes' => $mimeTypes);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public function buildForm(FormBuilderInterface $builder, array $options)
'mimeTypes' => array({% for type in field.mimeTypes %}'{{ type }}',{% endfor %}),
{% endif %}
{% if field.mediaType is defined and field.mediaType == 'image' %}
'minHeight' => '{{ field.minHeight }}',
'maxHeight' => '{{ field.maxHeight }}',
'minWidth' => '{{ field.minWidth }}',
'minHeight' => '{{ field.minHeight }}',
'maxHeight' => '{{ field.maxHeight }}',
'minWidth' => '{{ field.minWidth }}',
'maxWidth' => '{{ field.maxWidth }}',
{% endif %}
{% if field.mediaType is defined and field.mediaType != 'none' %}
Expand Down

0 comments on commit edd710b

Please sign in to comment.