Skip to content

Commit

Permalink
EZP-29449: Cannot read property 'innerHTML' of null on upload in ezim…
Browse files Browse the repository at this point in the history
…age, ezmedia & ezbinaryfile
  • Loading branch information
mikadamczyk committed Jul 24, 2018
1 parent 5052cb5 commit 3bad5a2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function (global) {
const eZ = global.eZ = global.eZ || {};
const SELECTOR_FIELD_LABEL = '.ez-field-edit__label-wrapper .form-control-label';
const SELECTOR_FIELD_LABEL = '.ez-field-edit__label-wrapper .ez-field-edit__label';

class BaseFileFieldValidator extends global.eZ.BaseFieldValidator {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
const isEmpty = isNaN(value);
const isInteger = Number.isInteger(value);
const isError = (isEmpty && isRequired) || (!isEmpty && !isInteger);
const label = input.closest(SELECTOR_INFO_WRAPPER).querySelector('.form-control-label').innerHTML;
const label = input.closest(SELECTOR_INFO_WRAPPER).querySelector('.ez-field-edit-preview__label').innerHTML;
const result = { isError };

if (isEmpty) {
Expand Down
4 changes: 2 additions & 2 deletions src/bundle/Resources/public/scss/_forms.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
form:not(.form-inline) {
.form-control-label {
.ez-field-edit__label {
font-weight: 700;
font-size: 14px;
color: $ez-color-base-dark;
Expand Down Expand Up @@ -46,7 +46,7 @@ form:not(.form-inline) {

.col-form-label,
.form-control,
.form-control-label {
.ez-field-edit__label {
margin-right: .5rem;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
.ez-data-source__field--alternativeText {
&.is-invalid {
.ez-data-source__label-wrapper,
.ez-data-source__label-wrapper .form-control-label {
.ez-data-source__label-wrapper .ez-field-edit__label {
color: $ez-color-danger;
}

Expand Down
4 changes: 2 additions & 2 deletions src/bundle/Resources/views/fieldtypes/edit/ezmedia.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
{{ form_row(form.loop, {'label_attr': {'class': 'checkbox-inline'}}) }}
</div>
<div class="ez-field-edit-preview__dimensions">
{{ form_row(form.width) }}
{{ form_row(form.height) }}
{{ form_row(form.width, {'label_attr': {'class': 'ez-field-edit-preview__label'}}) }}
{{ form_row(form.height, {'label_attr': {'class': 'ez-field-edit-preview__label'}}) }}
</div>
</div>
</div>
Expand Down

0 comments on commit 3bad5a2

Please sign in to comment.