Skip to content

Commit

Permalink
WPCIVIUX-187 Fix fatal error if from CiviCRM is an array
Browse files Browse the repository at this point in the history
  • Loading branch information
agileware-iris committed Nov 13, 2024
1 parent b060776 commit c62fa68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion civicrm-ux.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Plugin Name: WP CiviCRM UX
* Plugin URI: https://github.com/agileware/wp-civicrm-ux
* Description: A better user experience for integrating WordPress and CiviCRM
* Version: 1.20.5
* Version: 1.20.6
* Requires at least: 5.8
* Requires PHP: 7.4
* Requires Plugins: civicrm
Expand Down
6 changes: 3 additions & 3 deletions shortcodes/contact/value.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ public function shortcode_callback( $atts = [], $content = null, $tag = '' ) {
if ( $labels['is_error'] ) {
return $this->no_value( $result ) ? $mod_atts['default'] : $this->get_display_values( $result );
}
if ( $labels['values'][ $result ] ) {
if ( $labels['values'] ) {
if ( is_array( $result ) ) {
foreach ( $result as $key => $item ) {
$result[ $key ] = $labels['values'][ $result[ $item ] ];
$result[ $key ] = $labels['values'][ $item ] ?? $item;
}
} else {
$result = $labels['values'][ $result ];
$result = $labels['values'][ $result ] ?? $result;
}
}

Expand Down

0 comments on commit c62fa68

Please sign in to comment.