Warning: Undefined variable $zone_text in /var/www/html/docroot/modules/contrib/cloudflare/src/Form/SettingsForm.php on line 258

Created on 13 June 2022, over 2 years ago
Updated 15 July 2024, 4 months ago

Problem/Motivation

PHP 8.0 shows Warning: Undefined variable $zone_text in /modules/contrib/cloudflare/src/Form/SettingsForm.php on line 258

When CloudFlareTimeoutException happens there is no $zone_text set

Steps to reproduce

On localhost visit settings page

Proposed resolution

Supply a default?

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States NicholasS

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom jrsouth

    We hit this as an edge case related to loading in config values via environment variables.

    The attached patch just ensures variables are created before they're used, and also skips processing if $zones cannot be populated from the Cloudflare API.

    There are still some deeper issues involving a mismatch between invalid credentials but $config['cloudflare.settings']['valid_credentials'] = TRUE that can trigger WSODs, but that seems to be contained within the cloudflare/sdk rather than this module directly ― and to be fair it's probably just a result of bad config.

    Error is:
    Cloudflare\API\Adapter\ResponseException: Invalid request headers in Cloudflare\API\Adapter\ResponseException::fromRequestException() (line 38 of /app/vendor/cloudflare/sdk/src/Adapter/ResponseException.php).

  • πŸ‡¦πŸ‡ΉAustria guedressel

    This also affects us in 2.0.0-beta1.
    And I agree with @jrsouth that the underlying problem ist some authentication / authorization issue with the Cloudflare API which brings up this error. On one hand this actual error shall be fixed but on the other hand some information about invalid Cloudflare API communication may be helpful to a user.

Production build 0.71.5 2024