Skip to content
This repository was archived by the owner on Mar 17, 2020. It is now read-only.
This repository was archived by the owner on Mar 17, 2020. It is now read-only.

wps_filter_all leads to failures #63

@dgmstuart

Description

@dgmstuart

When running scripts against a whippet-server instance, lots of warnings are raised:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in /Users/dxwduncan/.cache/whippet/wordpresses/latest/wp-includes/plugin.php on line 872

Although this is a warning and not an error, It looks like they are actually failures and the scripts don't work as a result.

The call causing all the issues is here: https://github.com/dxw/whippet-server/blame/master/lib/load_whippet.php#L24

It's failing because the first argument passed to call_user_func_array() is:

Array
(
   [function] => Array
       (
           [0] =>
           [1] => wps_filter_all
       )

   [accepted_args] => 1
)

....so it's presumably failing because of that null first element. In the code that comes from a $whippet variable, which doesn't seem to be set.

My guess is that this is because whippet-server is making some assumption about the context that it's being used in, and that context is missing in a script is run.

Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in /Users/dxwduncan/.cache/whippet/wordpresses/latest/wp-includes/plugin.php on line 872

Call Stack:
    0.0002     234648   1. {main}() /Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/themes/exporting-is-great/app/bin/opportunities-sync.php:0
    0.1921   17945776   2. require('/Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/plugins/advanced-custom-fields-pro/acf.php') /Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/themes/exporting-is-great/app/bin/opportunities-sync.php:19
    0.1922   17945984   3. acf() /Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/plugins/advanced-custom-fields-pro/acf.php:541
    0.1922   17946776   4. acf->initialize() /Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/plugins/advanced-custom-fields-pro/acf.php:532
    0.6495   20819240   5. acf_include() /Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/plugins/advanced-custom-fields-pro/acf.php:165
    0.6649   20866144   6. include_once('/Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/plugins/advanced-custom-fields-pro/pro/acf-pro.php') /Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/plugins/advanced-custom-fields-pro/api/api-helpers.php:165
    0.6649   20866416   7. acf_pro->__construct() /Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/plugins/advanced-custom-fields-pro/pro/acf-pro.php:456
    0.7830   21215496   8. acf_include() /Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/plugins/advanced-custom-fields-pro/pro/acf-pro.php:51
    0.7968   21322968   9. include_once('/Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/plugins/advanced-custom-fields-pro/pro/fields/gallery.php') /Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/plugins/advanced-custom-fields-pro/api/api-helpers.php:165
    0.7968   21326128  10. acf_field_gallery->__construct() /Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/plugins/advanced-custom-fields-pro/pro/fields/gallery.php:822
    0.8848   21330016  11. __() /Users/dxwduncan/dev/WordPress/ukti-eig-app/wp-content/plugins/advanced-custom-fields-pro/pro/fields/gallery.php:56
    0.8849   21330016  12. translate() /Users/dxwduncan/.cache/whippet/wordpresses/latest/wp-includes/l10n.php:173
    0.8849   21330064  13. apply_filters() /Users/dxwduncan/.cache/whippet/wordpresses/latest/wp-includes/l10n.php:105
    0.8849   21330720  14. _wp_call_all_hook() /Users/dxwduncan/.cache/whippet/wordpresses/latest/wp-includes/plugin.php:208
    0.8849   21331080  15. call_user_func_array:{/Users/dxwduncan/.cache/whippet/wordpresses/latest/wp-includes/plugin.php:872}() /Users/dxwduncan/.cache/whippet/wordpresses/latest/wp-includes/plugin.php:872

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions