Skip to content

Commit

Permalink
Remove strict typehints
Browse files Browse the repository at this point in the history
  • Loading branch information
doekenorg committed Oct 15, 2024
1 parent 4168315 commit 719de0a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
24 changes: 18 additions & 6 deletions includes/class-gravityview-change-entry-creator.php
Original file line number Diff line number Diff line change
Expand Up @@ -456,13 +456,17 @@ public function register_gform_noconflict( $assets ) {
*
* @since 2.30.0
*
* @param GF_Field[] $fields The registered fields.
* @param array $form The form object.
* @param string $zone The fields zone.
* @param GF_Field[] $fields The registered fields.
* @param string|array $form The form object.
* @param string $zone The fields zone.
*
* @return array The updated fields array.
*/
public function register_edit_field( array $fields, array $form, string $zone ): array {
public function register_edit_field( $fields, $form, $zone ): array {
if ( ! is_array( $fields ) ) {
$fields = (array) $fields;
}

if ( 'edit' !== $zone ) {
return $fields;
}
Expand All @@ -488,9 +492,13 @@ public function register_edit_field( array $fields, array $form, string $zone ):
*
* @return array The updated fields array.
*/
public function register_created_by_input( array $fields, ?array $editable_fields, array $form ): array {
public function register_created_by_input( $fields, $editable_fields, $form ): array {
require_once GFCommon::get_base_path() . '/export.php';

if ( ! is_array( $fields ) ) {
$fields = (array) $fields;
}

// Don't add the `created_by` field if the user can't change it.
$editable_field_ids = array_flip(
array_map(
Expand Down Expand Up @@ -541,7 +549,11 @@ static function ( GF_Field $a, GF_Field $b ) use ( $sort_order_lookup ): int {
*
* @return array The new capabilities.
*/
public function created_by_visibility_caps( array $caps, string $template, string $field ): array {
public function created_by_visibility_caps( $caps, $template, $field ): array {
if ( ! is_array( $caps ) ) {
$caps = (array) $caps;
}

if ( 'created_by' !== $field || false === strpos( $template, 'edit' ) ) {
return $caps;
}
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Beautifully display your Gravity Forms entries. Learn more on [gravitykit.com](h

== Changelog ==

= develop =

Fixed: A fatal error could happen in combination with the Multiple Forms add-on.

= 2.30 on October 14, 2024 =

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.
Expand Down

0 comments on commit 719de0a

Please sign in to comment.