Skip to content

Commit

Permalink
Fix: PHP Error when fetching System Info report for Experiments that …
Browse files Browse the repository at this point in the history
…don't have a title [ED-6879] (elementor#18233)

* Fix: PHP Error when fetching System Info report for Experiments that don't have a title [ED-6879]

* Fix register_controls() Unit Test
  • Loading branch information
udidol authored Apr 27, 2022
1 parent b3a4069 commit 971564b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/experiments/experiments-reporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ public function get_html_experiments() {
// If the state is default, add the default state to the string.
$state = Plugin::$instance->experiments->get_feature_state_label( $experiment );

$output .= '<tr><td>' . esc_html( $experiment['title'] ) . ': </td>';
$title = isset( $experiment['title'] ) ? $experiment['title'] : $experiment['name'];

$output .= '<tr><td>' . esc_html( $title ) . ': </td>';
$output .= '<td>' . esc_html( $state ) . '</td>';
$output .= '</tr>';
}
Expand Down

0 comments on commit 971564b

Please sign in to comment.