Skip to content

Commit 3b3a61b

Browse files
committed
Merge branch 'fix/163-date-range-returning-error' into fix/pagination-on-connection-fields
# Conflicts: # src/FieldType/User.php
2 parents b11461c + b2c2fe5 commit 3b3a61b

File tree

10 files changed

+20
-9
lines changed

10 files changed

+20
-9
lines changed

.github/workflows/code-quality.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
access_token: ${{ github.token }}
2727

2828
- name: Checkout
29-
uses: actions/checkout@v3
29+
uses: actions/checkout@v4
3030

3131
- name: Setup PHP
3232
uses: shivammathur/setup-php@v2

.github/workflows/deploy-to-github.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout
10-
uses: actions/checkout@v3
10+
uses: actions/checkout@v4
1111

1212
- name: Setup PHP
1313
uses: shivammathur/setup-php@v2

.github/workflows/deploy-to-wordpress.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- name: Checkout
11-
uses: actions/checkout@v3
11+
uses: actions/checkout@v4
1212

1313
- name: Setup PHP
1414
uses: shivammathur/setup-php@v2

.github/workflows/schema-linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v3
27+
uses: actions/checkout@v4
2828

2929
- name: Setup PHP w/ Composer & WP-CLI
3030
uses: shivammathur/setup-php@v2

.github/workflows/sync-develop-with-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
timeout-minutes: 2
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414
with:
1515
token: ${{ secrets.SYNC_TOKEN }}
1616
- name: Set Git config

.github/workflows/testing-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
name: WordPress ${{ matrix.wordpress }}, PHP ${{ matrix.php }}, ACF ${{matrix.acf_version}}, ACF & ACF EXTENDED PRO ${{matrix.acf_pro}}, WPGRAPHQL Content Blocks ${{matrix.wpgraphql_content_blocks}}
4040
steps:
4141
- name: Checkout
42-
uses: actions/checkout@v3
42+
uses: actions/checkout@v4
4343

4444
# This is used in case the IP gets blocked by one of the services used to download the pro plugins
4545
- name: 🔎 Check IP

.github/workflows/upload-schema-artifact.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
2323

2424
- name: Setup PHP w/ Composer & WP-CLI
2525
uses: shivammathur/setup-php@v2

.github/workflows/wordpress-coding-standards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
access_token: ${{ github.token }}
2727

2828
- name: Checkout
29-
uses: actions/checkout@v3
29+
uses: actions/checkout@v4
3030

3131
- name: Setup PHP
3232
uses: shivammathur/setup-php@v2

src/FieldType/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static function register_field_type(): void {
3939
return null;
4040
}
4141

42-
$values = [];
42+
$values = is_array( $value ) ? $value : [];
4343
if ( ! is_array( $value ) ) {
4444
$values[] = $value;
4545
} else {

src/ThirdParty/AcfExtended/FieldType/AcfeDateRangePicker.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ public static function register_field_type(): void {
1818
$value = $field_config->resolve_field( $root, $args, $context, $info );
1919
$start_date = $value['start'] ?? null;
2020
$end_date = $value['end'] ?? null;
21+
$acf_field = $field_config->get_acf_field();
22+
23+
// handle resolving from a block
24+
if ( empty( $start_date ) ) {
25+
$start_date = $field_config->resolve_field( $root, $args, $context, $info, [ 'name' => $acf_field['name'] . '_start' ] );
26+
}
27+
28+
// handle resolving from a block
29+
if ( empty( $end_date ) ) {
30+
$end_date = $field_config->resolve_field( $root, $args, $context, $info, [ 'name' => $acf_field['name'] . '_end' ] );
31+
}
2132

2233
if ( ! empty( $start_date ) ) {
2334
$_start_date = \DateTime::createFromFormat( 'Ymd|', $start_date );

0 commit comments

Comments
 (0)