# Undefined array key "page\_number"

**URL:** <https://community.gravityforms.com/t/undefined-array-key-page-number/20335>\
**Category:** Get Help\
**Tags:** conflict, php-warning\
**Created:** [July 6, 2026, 4:42pm UTC](https://community.gravityforms.com/t/undefined-array-key-page-number/20335 "2026-07-06T16:42:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brent\_Thomas](https://avatars.discourse-cdn.com/v4/letter/b/9e8a1a/32.png) [@Brent\_Thomas](https://community.gravityforms.com/u/Brent_Thomas)\
**Post date:** [July 6, 2026, 4:42pm UTC](https://community.gravityforms.com/t/undefined-array-key-page-number/20335/1 "2026-07-06T16:42:55Z")

</div>

**Getting following after form submission:**

**Warning** : Undefined array key “page\_number” in\*\*/home/customer/www/bluegreyfootball.com/public\_html/wp-content/plugins/gravityforms/form\_display.php **on line** 787\*\*

---

<div class="post-metadata">

**Author:** ![faisalahammad](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/faisalahammad/32/13948_2.png) [@faisalahammad](https://community.gravityforms.com/u/faisalahammad)\
**Post date:** [July 8, 2026, 12:30pm UTC](https://community.gravityforms.com/t/undefined-array-key-page-number/20335/2 "2026-07-08T12:30:22Z")

</div>

Hi Brent,  
I’ve identified the cause of the following warning appearing after form submission:

```auto
Warning: Undefined array key "page_number" in .../gravityforms/form_display.php on line 787

```

This is a **PHP 8.x** compatibility issue in Gravity Forms where the code doesn’t fully check whether a value exists before accessing it. It does not affect form functionality, but the warning is noisy and may clutter your error logs.

Apply a hotfix via a must-use plugin (stops the warning immediately)

Create the file `/wp-content/mu-plugins/gf-hotfix-page-number.php` with the following content:

```php
<?php
/**
 * Plugin Name: GF Hotfix – Undefined array key page_number
 * Description: Prevents PHP 8.x warning in GFFormDisplay::get_current_page()
 * Version: 1.0
 * Author: Faisal Ahammad
 */

add_filter( 'gform_pre_render', function( $form ) {
    $form_id = absint( rgar( $form, 'id' ) );

    if ( class_exists( 'GFFormDisplay' ) ) {
        try {
            $ref = new ReflectionProperty( 'GFFormDisplay', 'submission' );
            $ref->setAccessible( true );
            $submission = $ref->getValue();
            if ( isset( $submission[$form_id] ) && ! isset( $submission[$form_id]['page_number'] ) ) {
                $submission[$form_id]['page_number'] = 1;
                $ref->setValue( null, $submission );
            }
        } catch ( Exception $e ) {
            // Gracefully ignore if Reflection is unavailable.
        }
    }

    return $form;
}, PHP_INT_MAX );

```

This hotfix ensures that `self::$submission[$form_id]` always has the `page_number` key set before it is accessed, preventing the warning. It works at runtime without modifying any Gravity Forms core files, so it won’t be overwritten when the plugin is updated.

Regarding the mu-plugins, they can be found here:

> **[Must Use Plugins – Advanced Administration Handbook | Developer.WordPress.org](https://developer.wordpress.org/advanced-administration/plugins/mu-plugins/)**
>
> Must-use plugins (a.k.a. mu-plugins) are plugins installed in a special directory inside the content folder and which are automatically…

Give it a try, and let me know how that goes!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [August 7, 2026, 12:30pm UTC](https://community.gravityforms.com/t/undefined-array-key-page-number/20335/3 "2026-08-07T12:30:58Z")

</div>

Closed on August 7, 2026, 12:30pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
