Skip to content

Commit c2437ce

Browse files
authored
Merge pull request #796 from Codeinwp/bugfix/795
Fix PHP warning
2 parents e254897 + 625e6af commit c2437ce

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

classes/Visualizer/Render/Sidebar/Google.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ protected function _renderGeneralSettings() {
208208
self::_renderSelectItem(
209209
esc_html__( 'Position', 'visualizer' ),
210210
'legend[position]',
211-
$this->legend['position'],
211+
isset( $this->legend['position'] ) ? $this->legend['position'] : '',
212212
$this->_legendPositions,
213213
esc_html__( 'Determines where to place the legend, compared to the chart area.', 'visualizer' )
214214
);
215215

216216
self::_renderSelectItem(
217217
esc_html__( 'Alignment', 'visualizer' ),
218218
'legend[alignment]',
219-
$this->legend['alignment'],
219+
isset( $this->legend['alignment'] ) ? $this->legend['alignment'] : '',
220220
$this->_alignments,
221221
esc_html__( 'Determines the alignment of the legend.', 'visualizer' )
222222
);
@@ -393,10 +393,12 @@ protected function _renderViewSettings() {
393393
echo '<table class="viz-section-table" cellspacing="0" cellpadding="0" border="0">';
394394
echo '<tr>';
395395
echo '<td class="viz-section-table-column">';
396-
echo '<input type="text" name="chartArea[left]" class="control-text" value="', $this->chartArea['left'] || $this->chartArea['left'] === '0' ? esc_attr( $this->chartArea['left'] ) : '', '" placeholder="20%">';
396+
$chartarea_left = isset( $this->chartArea['left'] ) ? $this->chartArea['left'] : '';
397+
echo '<input type="text" name="chartArea[left]" class="control-text" value="', $chartarea_left || '0' === $chartarea_left ? esc_attr( $chartarea_left ) : '', '" placeholder="20%">';
397398
echo '</td>';
398399
echo '<td class="viz-section-table-column">';
399-
echo '<input type="text" name="chartArea[top]" class="control-text" value="', $this->chartArea['top'] || $this->chartArea['top'] === '0' ? esc_attr( $this->chartArea['top'] ) : '', '" placeholder="20%">';
400+
$chartarea_top = isset( $this->chartArea['top'] ) ? $this->chartArea['top'] : '';
401+
echo '<input type="text" name="chartArea[top]" class="control-text" value="', $chartarea_top || '0' === $chartarea_top ? esc_attr( $chartarea_top ) : '', '" placeholder="20%">';
400402
echo '</td>';
401403
echo '</tr>';
402404
echo '</table>';

classes/Visualizer/Source.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ public static final function get_date_formats_if_exists( $series, $data ) {
335335
*
336336
* @return string|null
337337
*/
338-
private static final function determine_date_format( $value, $type ) {
338+
private static function determine_date_format( $value, $type ) {
339339
if ( version_compare( phpversion(), '5.3.0', '<' ) ) {
340340
do_action( 'themeisle_log_event', Visualizer_Plugin::NAME, sprintf( 'PHP version %s not supported', phpversion() ), 'error', __FILE__, __LINE__ );
341341
return null;

0 commit comments

Comments
 (0)