Skip to content

Commit 719de0a

Browse files
committed
Remove strict typehints
1 parent 4168315 commit 719de0a

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

includes/class-gravityview-change-entry-creator.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,13 +456,17 @@ public function register_gform_noconflict( $assets ) {
456456
*
457457
* @since 2.30.0
458458
*
459-
* @param GF_Field[] $fields The registered fields.
460-
* @param array $form The form object.
461-
* @param string $zone The fields zone.
459+
* @param GF_Field[] $fields The registered fields.
460+
* @param string|array $form The form object.
461+
* @param string $zone The fields zone.
462462
*
463463
* @return array The updated fields array.
464464
*/
465-
public function register_edit_field( array $fields, array $form, string $zone ): array {
465+
public function register_edit_field( $fields, $form, $zone ): array {
466+
if ( ! is_array( $fields ) ) {
467+
$fields = (array) $fields;
468+
}
469+
466470
if ( 'edit' !== $zone ) {
467471
return $fields;
468472
}
@@ -488,9 +492,13 @@ public function register_edit_field( array $fields, array $form, string $zone ):
488492
*
489493
* @return array The updated fields array.
490494
*/
491-
public function register_created_by_input( array $fields, ?array $editable_fields, array $form ): array {
495+
public function register_created_by_input( $fields, $editable_fields, $form ): array {
492496
require_once GFCommon::get_base_path() . '/export.php';
493497

498+
if ( ! is_array( $fields ) ) {
499+
$fields = (array) $fields;
500+
}
501+
494502
// Don't add the `created_by` field if the user can't change it.
495503
$editable_field_ids = array_flip(
496504
array_map(
@@ -541,7 +549,11 @@ static function ( GF_Field $a, GF_Field $b ) use ( $sort_order_lookup ): int {
541549
*
542550
* @return array The new capabilities.
543551
*/
544-
public function created_by_visibility_caps( array $caps, string $template, string $field ): array {
552+
public function created_by_visibility_caps( $caps, $template, $field ): array {
553+
if ( ! is_array( $caps ) ) {
554+
$caps = (array) $caps;
555+
}
556+
545557
if ( 'created_by' !== $field || false === strpos( $template, 'edit' ) ) {
546558
return $caps;
547559
}

readme.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ Beautifully display your Gravity Forms entries. Learn more on [gravitykit.com](h
2121

2222
== Changelog ==
2323

24+
= develop =
25+
26+
Fixed: A fatal error could happen in combination with the Multiple Forms add-on.
27+
2428
= 2.30 on October 14, 2024 =
2529

2630
This release adds the ability to change the entry creator from the Edit Entry screen, improves upload handling, fixes various bugs, and updates internal components.

0 commit comments

Comments
 (0)