Hi!
I have a problem with 2 fields:
Could you tell me how I can fix this?
Thank you for the plugin! It’s easy to use and works exactly as advertised. However, I’ve noticed a bug, which is described below:
Issue:
The current implementation of the is_table_data_fetched
function checks only if the field group is fetched, but it does not verify whether the fetched data corresponds to the correct post ID. As a result, when looping through get_field
with different post_id
values, the function returns incorrect data, using cached data from a previous post instead of fetching new data for the current post.
Steps to Reproduce:
get_field
in a loop with different post_id
values.Expected Behavior:
The function should validate both the field group and the associated post_id
to ensure that the data retrieved is accurate for the given post_id.
Fix:
The updated code checks both the existence of the field group in the cache and whether the post ID matches the requested one. This ensures the correct data is retrieved for each post.
file: includes/class-acfct-register-hooks.php
protected function is_table_data_fetched( $acfFieldGroupKey, int $post_id ) {
$key = 'acf_ct_loaded_' . $acfFieldGroupKey;
$has_table_data = array_key_exists( $key, $GLOBALS ) && $GLOBALS[ $key ] instanceof Acfct_table_data;
return $has_table_data && $GLOBALS[ $key ]->get_post_id() === $post_id;
}
]]>
Hi, I’m looking for some instructions of how to import large data from csv file into custom table. Do I need also to upload it to other tables like wp_postmeta?
]]>None of my checkbox fields are being created in the database. As a result, none of these fields are actually saving. Any thoughts?
]]>Hi @Abhishek,
I’ve noticed that the WYSIWYG field isn’t saving the HTML with the <p>
tags. It seems to be a known issue with ACF plugin and they’ve mentioned a solution in this post: https://support.advancedcustomfields.com/forums/topic/no-p-tags-with-wysiwyg-field/
They suggest using the_field
to output the raw html. I need to do the same to get the <p>
tags. Could you let me know the best way to resolve this?
Hello, I am testing this product. It doesn’t seem to update both tables when there is a Relationship Bidirectional. Is there a setting I have to trigger to get the tables updated with a bidirectional relationship.
Thank you
Jenni
]]>Hi, first allow me to congratulate on your great plugin. This is a great idea that I had in the past as well and was about to develop it, but now that I see that someone did this, I will simply purchase your Pro version. ??
Just need to clarify one question: will this work fine with standard REST API calls to POST and/or GET using the “acf” fields?
Thank you very much and keep it up!
]]>This plugin hasn’t been tested with the latest 3 major releases of WordPress. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
]]>Hi @Abhishek,
I have configured an image field to return the Image URL. However, the field is saving the Image ID in the custom table instead. Could you please advise on how to resolve this issue?
https://i.imgur.com/CGQRJxJ.png
Hi.
I have a CPT created with ACF. It has a number of custom fields, and we use Elementor form with Dynamic.ooo addon to create custom posts. Which means they aren’t created in WP admin.
Custom fields are saved in the standard postmeta table, but not in the custom table. It only works when I update the CPT manually in WP admin. Is this the limitation of the free version of your plugin?
Thanks.
]]>Hey @Abhishek,
I’m trying to find out if there’s a hook or action that triggers after new data is inserted or updated in a custom table. I’ve tried using wp_after_insert_post and transition_post_status, but they don’t seem to work as expected.
When using wp_after_insert_post, the update doesn’t reflect the latest changes.
And with transition_post_status, I find issues when data is inserted for the first time; the hook triggers before the data is created in the custom table.
Do you have any suggestions? Appreciate your help!
]]>Good morning,
It is complicated to use get_field in ajax via admin_ajax.php
Indeed, in the “acf_ct_filter_pre_load_value” hook, a test is done
“if (is_admin() === true || $is_get_field_support_disabled === true) { return null;}”
which makes it complicated to use ajax because in admin_ajax.php there is this from the start:
if ( ! defined( ‘WP_ADMIN’ ) ) { define( ‘WP_ADMIN’, true ); }
and therefore is_admin() = true
One solution is to use “set_current_screen(‘front’);” at the start of the ajax php template.
The other solution is to use “get_custom_table_field” instead which poses a problem with the use of the acf / “twig-timber” couple
The simplest thing would be for the hook to take into account the use of ajax on the front end without having to add code for it to work.
Hello!
We are actively using ACF’s ability to register field groups directly in code with acf_add_local_field_group function, rather then with their GUI tool.
How can we enable using custom tables for fields created this way?
Thanks!
]]>Does the plugin support ACF option pages? I followed the entire procedure, the table was created in the DB, but the data is not saved. I therefore wondered whether the plugin does not support option pages.
]]>Please, can I use Wpallimport with custom database tables?
]]>Hi Abhishek, thanks for the plugin!
I’m having some issues saving checkbox fields. The first is related to value encoding, the second is about how your plugin saves checkbox values to the database.
For example, two checkbox values: “Hélix” and “Septum” are converted to [“H\u00e9lix”,”Septum”] in the database.
First question: Why is the character é converted to Unicode \u00e9?
Second question: ACF saves the checkbox values in post_meta table in an array like:
a:2:{i:0;s:5:”Hélix”;i:1;s:6:”Septum”;}
Why the checkbox values in custom table are saved in [“value 1″,”value 2”] format?
If the field is radio, I have no issues with the value enconding.
Thanks for your help!
]]>Hi,
I’m using your awesome plugin to store my data into a custom table only (not in postmeta) and I need to do custom search using wp_query;
here’s my code :
$args = array(
'post_type' => 'event',
'post_status' => array('publish'),
'meta_key'=>'location',
'meta_value'=>'de'
);
$posts = new WP_Query($args);
but the results seems to be empty, I assume it’s because I’m not storing data into the postmeta table.
is there a way (other than wpdb…) to overcome this case ?
thanks a lot for your help
]]>I have this plugin installed and current. I am using Gravity Forms Post Creation to add new posts to an ACF cpt on submission. This was creating entries in the custom table no problem. Today, it stopped working. I can still manually create posts from the backend and it shows up in the custom table. I’m not sure what changed or why it would have stopped adding posts to the custom table
]]>Hi,
If say, I had a 100 entries in a custom post type called “Movies”. Can I move these from a CPT to a new Custom table with the plugin or is the plugin only for creating a custom table?
Thank you.
]]>Hello @abhisheksatre,
Is there a way to connect 2 or more custom post types to a single database table? For example if I have a post type called “Order Type A” and “Order Type B”, is there a way to link both of those to a table called “xyz_orders”?
Many thanks in advance!
Hi,
I also emailed you about this issue.
We have created a field group that has an image field. We have set the Return Format output to “Image URL”
The output we are receiving in the custom table is not the URL but an image ID (I think). Regardless of what return format I request I never get the image URL.
If you come across my email you will see the reference to our website domain https://buildreview.org
Thanks for any help you can offer.
]]>Although the cause is unknown, data was not registered in the table, and when “wp_update_post” was executed, some items were not registered as “null”.
If you press “save” on the edit screen, it will be updated, but since there are many cases, I would like to do it all at once.
Is it not possible to do it collectively by post ID or custom post type?
do you support also wpml advance custom table, its an extension to advance custom tables plugin
]]>Hi there,
I just started playing with the plugin and was wondering if it is possible( and how) to add data from a form into an existing table (created by some other plugin) instead of creating a new table to store the form’s data.
]]>Hi,
I might use this plugins for a client’s website in a critical way (eg the plugin fails the whole site is unusable ) so my question is can I use this plugins without worrying about updates since the plugins did not received any update in 6 months.
thanks, have a nice day
]]>Let’s say I want to store an optional numerical value, but in the current implementation if I leave a numerical field blank it is saved as a blank value in post_meta by ACF (correct) but as a 0 (zero) in the custom table, which is a falsy value but doesn’t clearly indicate whether the field was left blank or someone manually entered 0. (e.g. 0 can be a valid value in some cases).
Also, when I save this new post for the first time the values are being read back from the custom table, which outputs “0” in the numerical field. Saving the post again changes the blanks in postmeta table to “0” for the saved post.
Furthermore, if the field validation is not-required then the SQL field can be marked as nullable?
]]>Hi Abhishek, I noticed that the custom field data is being saved in both the wp_postmeta table as well as the custom table. Is this expected? I was trying to use this plugin to prevent polluting the postmeta table.
]]>unfortunately, when i run get_fields (https://www.advancedcustomfields.com/resources/get_fields/) it only returns me all values saved in postmeta table but not from the new table. Any plans to modify get_fields like get_field ? Thanks
]]>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?!
]]>Hi Abhishek,
I got a problem with your plugin and I hope you can help me.
I have a custom post type “person” and a custom taxonomy “height”. Your plugin works, the custom fields for the people are written correctly in the custom table and are displayed in the output.
The URL looks like this: https://example.com/height/185-cm/
Now I would like to filter the output of the taxonomy into male and female persons. The URL then looks like this:
https://example.com/height/185-cm/?g=male
For this I use the WordPress hook ‘posts_where’. This is my code:
// associate the custom table "mytable" with the custom taxonomy
add_filter('posts_join','custom_join');
function custom_join($join){
global $wpdb;
$customTable = $wpdb->prefix."mytable";
if (is_tax('height')) {
$join .= "LEFT JOIN $customTable ON $wpdb->posts.ID = $customTable.post_id";
}
return $join;
}
// filter the male persons from the output list
add_filter('posts_where', 'male', 1, 2);
function male( $where )
{
if (isset($_GET['g'])) {
if ($_GET['g'] === 'male') {
global $wpdb;
$where .= " AND gender = 'He' ";
}
}
return $where;
}
The output is correctly filtered, only male persons are displayed. However, the custom fields from “mytable” are no longer loaded in the taxonomy output, although I haven’t changed anything in the template. Query Monitor shows me that the plugin is not loaded at all in the URL with the parameter.
What can the problem be related to?
Thank you for your help in advance!
Andreas