WordPress.org

Ready to get started?Download WordPress

Forums

Advanced Custom Fields
[resolved] Warning: Missing argument 2 for acf_Select::acf_save_field() (3 posts)

  1. Ov3rfly
    Member
    Posted 1 year ago #

    When saving a field-group which contains a select or a radio, I get an annoying error message on customers production server (PHP 5.3.8, SunOS) which does not occur on customers development server (PHP 5.4.8, Win XP):

    Warning: Missing argument 2 for acf_Select::acf_save_field() in /var/../htdocs/wp-content/plugins/advanced-custom-fields/core/fields/select.php on line 267
    
    Warning: Cannot modify header information - headers already sent by (output started at /var/../htdocs/wp-content/plugins/advanced-custom-fields/core/fields/select.php:267) in /var/../htdocs/wp-includes/pluggable.php on line 881

    The field-group is saved ok, but the "save-result" page in admin is above message on a plain white page.

    The production server db/php is an exact clone of the development server, the only difference is PHP version and OS.

    Tried to track down the problem in ACF 3.5.3 and found a workaround.

    Old code, line 24, file advanced-custom-fields/core/fields/select.php:

    // filters (for all fields with choices)
    add_filter('acf_save_field-select', array($this, 'acf_save_field'));
    add_filter('acf_save_field-checkbox', array($this, 'acf_save_field'));
    add_filter('acf_save_field-radio', array($this, 'acf_save_field'));

    Changed code, line 24, file advanced-custom-fields/core/fields/select.php:

    // filters (for all fields with choices)
    add_filter('acf_save_field-select', array($this, 'acf_save_field'), 10, 2);
    add_filter('acf_save_field-checkbox', array($this, 'acf_save_field'), 10, 2);
    add_filter('acf_save_field-radio', array($this, 'acf_save_field'), 10, 2);

    Not really sure why this is required to get past the error on the production server, maybe somebody can confirm if this really is a PHP version problem or something else.

    http://wordpress.org/extend/plugins/advanced-custom-fields/

  2. elliotcondon
    Member
    Plugin Author

    Posted 1 year ago #

    Hi @Ov3rfly

    Thanks. This has been fixed in 3.5.3.1

    I don't know why my local server didn't display these errors to me, otherwise I would not have released the plugin

    Thanks
    Elliot

  3. Ov3rfly
    Member
    Posted 1 year ago #

    So it's obviously not a WordPress problem but maybe a PHP bug similar to this report?

    Would be interested in an explaination, why the above mentioned 5.4.8 development server did not show that error but the production server with older 5.3.8 did.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.