• Resolved nicmare

    (@nicmare)


    i wanted to give the plugin a try on a blank wp instance with acf pro installed. when i want to create a new custom field a get the message

    Warning: Trying to access array offset on value of type bool in /Volumes/eSSD/_htdocs/…/wp-content/plugins/acf-to-custom-database-tables/includes/class-acfct-utils.php on line 38

    UPDATE 10 Minutes lates: the plugin is full of bugs ??

    I created acf-json folder and the custom table. Then i saved acf field group and it produces bunch of warnings after that:

    Warning: Array to string conversion in?/Volumes/eSSD/_htdocs/…/wp-content/plugins/acf-to-custom-database-tables/includes/class-acfct-database-manager.php?on line?247

    Warning: Array to string conversion in?/Volumes/eSSD/_htdocs/…/wp-content/plugins/acf-to-custom-database-tables/includes/class-acfct-database-manager.php?on line?247

    Warning: Array to string conversion in?/Volumes/eSSD/_htdocs/…/wp-content/plugins/acf-to-custom-database-tables/includes/class-acfct-database-manager.php?on line?247

    Warning: Array to string conversion in?/Volumes/eSSD/_htdocs/…/wp-content/plugins/acf-to-custom-database-tables/includes/class-acfct-database-manager.php?on line?247

    Warning: Array to string conversion in?/Volumes/eSSD/_htdocs/…/wp-content/plugins/acf-to-custom-database-tables/includes/class-acfct-database-manager.php?on line?247

    Warning: Array to string conversion in?/Volumes/eSSD/_htdocs/…/wp-content/plugins/acf-to-custom-database-tables/includes/class-acfct-database-manager.php?on line?247

    Warning: Array to string conversion in?/Volumes/eSSD/_htdocs/…/wp-content/plugins/acf-to-custom-database-tables/includes/class-acfct-database-manager.php?on line?247

    probably for each field existing…

    Next i created a number field with step-size 0,1 to insert prices like 499.99. ACF saves it right but your plugin saves this as mediumint field with value of 500. Why?!

    • This topic was modified 1 year, 9 months ago by nicmare.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter nicmare

    (@nicmare)

    found a way to change data type with this code in case someone else needs it:

    function change_sql_data_type($type, $field, $table_name){
    	
    	if(!str_contains($table_name,'metadata_sets')) return $type;
    		
    	if(str_contains($field['name'],'price'))
    		return 'DECIMAL(10,2)';
    	
    	return $type;
    }
    add_filter('acf_ct/set_sql_data_type', 'change_sql_data_type', 10, 3);
    Plugin Author Abhishek

    (@abhisheksatre)

    Hi @nicmare,

    Thank you reporting the php warning issue. We will fix the warnings soon.

    Yes, you are using correct filter to change mysql column data type.

    https://acf-custom-tables.abhisheksatre.com/docs/filters/change-data-type/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Warnings’ is closed to new replies.