Skip to content

Unable to save configuration: PHP Fatal error: Uncaught TypeError: filter_var(): Option must be a valid callback #45

@torvista

Description

@torvista

ZC 2.2.0 alpha, php 8.4.15

When saving the admin page, get a whitescreen:
PHP Fatal error: Uncaught TypeError: filter_var(): Option must be a valid callback in ADMIN\includes\functions\configuration_checks.php:58

It is choking on the namespace in the callback: \\Zencart\\Plugins\\Admin\\InstantSearch\\InstantSearchConfigurationValidation

At this point:
https://github.com/zencart/zencart/blob/2fd3df8d8aff3364e6107513b5e67ae170d472e0/admin/includes/functions/configuration_checks.php#L23

$check_string=
{"error":"TEXT_INSTANT_SEARCH_CONFIGURATION_FIELDS_LIST_VALIDATE","id":"FILTER_CALLBACK","options":{"options":["\\Zencart\\Plugins\\Admin\\InstantSearch\\InstantSearchConfigurationValidation","validateFieldsList"]}}

and

 $data=
Array
(
    [error] => TEXT_INSTANT_SEARCH_CONFIGURATION_FIELDS_LIST_VALIDATE
    [id] => FILTER_CALLBACK
    [options] => Array
        (
            [options] => Array
                (
                    [0] => Zencart/Plugins/Admin/InstantSearch/InstantSearchConfigurationValidation
                    [1] => validateFieldsList
                )
        )
)

and it fails here
https://github.com/zencart/zencart/blob/2fd3df8d8aff3364e6107513b5e67ae170d472e0/admin/includes/functions/configuration_checks.php#L58

I've done multiple fiddling with that string, to no avail.

I would note that if I remove the leading slashes from \Zencart, json_decode returns null.

Also, I find no other plugin that uses a namespace with FILTER_CALLBACK, so maybe this is a ZC issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions