Hi James,
In fact, my problem is solved. It was a too long fieldname because of the field and subfield. It’s working very nicely with field key. What I wanted to say it’s why associate a field name if I can’t use it. As I said, I used the input name in $_POST and $_FILES as field name. I created a loop foreach and I used the key ($key => $value) as the field name because it’s natural more than field key. I needed to go in table and look the field key in table associated with the field name. After, created a conditional to associate the right field key with field name. So, for me, it’s a wrong use.
It’s my opinion.
Hi James,
Ok. I had 2 problems. Too long field name and the use of field key instead of field name. But, for me, it’s a bug. I use always field name but not working with repeater… seem buggy. In my form, I use the field name for the input name. So, I use the $_POST key and $_FILES key to update field.
It’s important to solve this situation…
Thank you !
Hi James,
I reduce the length of sub field. I created a log file to see the field name and data before update. Look at this :
cc_loanrequest_last30daysbankstatement
Array
(
[0] => Array
(
[file] => http://www.domainname.dev/loanrequest/?file=213/cc_loanrequest_last30daysbankstatement_1.
)
[1] => Array
(
[file] => http://www.domainname.dev/loanrequest/?file=213/cc_loanrequest_last30daysbankstatement_2.txt
)
)
The information in table look like this :
meta_key = _cc_loanrequest_last30daysbankstatement
meta_value =
meta_key = cc_loanrequest_last30daysbankstatement
meta_value = a:2:{i:0;a:1:{s:4:”file”;s:96:”http://www.domainname.dev/loanrequest/?file=212/cc_loanrequest_last30daysbankstatement_1.txt”;}i:1;a:1:{s:4:”file”;s:93:”http://www.domainname.dev/loanrequest/?file=212/cc_loanrequest_last30daysbankstatement_2.”;}}
I will try a fresh install…
Hi James,
I just tried. I explain the information.
The repeater field name is cc_loanrequest_last30daysbankstatement.
The url field inside repeater is cc_loanrequest_last30daysbankstatement_file.
cc_loanrequest_last30daysbankstatement is field_571fb7b99ffd3.
I created a array like this :
$arrayvalues = array(array(“cc_loanrequest_last30daysbankstatement_file” => “http://www.google.ca”));
update_field(“field_571fb7b99ffd3”, $arrayvalues, $postid);
update_field(“cc_loanrequest_last30daysbankstatement”, $arrayvalues, $postid);
I used the field key and field name. Look what is in the table.
meta_key is cc_loanrequest_last30daysbankstatement_file
meta_value is a:2:{i:0;a:1:{s:43:”cc_loanrequest_last30daysbankstatement_file”;s:96:”http://www.google.ca”;}}
Thank you for your help.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.