Skip to content

Commit

Permalink
Fix row values handling for tableless fields with single select
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0ttkclark committed Sep 19, 2023
1 parent 857e331 commit 107adf3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion classes/PodsUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -3725,6 +3725,9 @@ public function table( $reorder = false ) {
<?php
return false;
}

$tableless_field_types = PodsForm::tableless_field_types();

if ( true === $reorder && ! in_array( 'reorder', $this->actions_disabled ) && false !== $this->reorder['on'] ) {

?>
Expand Down Expand Up @@ -3999,6 +4002,16 @@ public function table( $reorder = false ) {
$row_value_is_array = is_array( $row_value );
$row_values = (array) $row_value;

if (
$row_values
&& ! isset( $row_values[0] )
&& in_array( $attributes['type'], $tableless_field_types, true )
) {
$row_values = [
$row_values,
];
}

foreach ( $row_values as $row_value_key => $row_value_item ) {
ob_start();

Expand All @@ -4020,7 +4033,7 @@ public function table( $reorder = false ) {
if ( ! $row_value_is_array ) {
$row_value = $row_value ? current( $row_value ) : null;
}
}//end if
}

if ( false !== $attributes['custom_relate'] ) {
global $wpdb;
Expand Down

0 comments on commit 107adf3

Please sign in to comment.