I have the ghost formatting of the field to be correct, but if the file upload field is left blank it doesn't select the ghost value just the empty field on data save.
I am using J3.8.2 and CF6 latest release.
debug if I upload an image in edit form:
Array
(
[validate_fields2] => Array
(
[log] => Automatic validation enabled.
[var] => 1
)
[upload12] => Array
(
[path] => /home/domains/vol3/797/1404797/user/htdocs/webapp/uploads/agents/
[agent_image] => Array
(
[extensions] => Array
(
[0] => jpg
[1] => jpeg
[2] => png
[3] => gif
)
[saved] => 1
)
[var] => Array
(
[agent_image] => Array
(
[path] => /home/domains/vol3/797/1404797/user/htdocs/webapp/uploads/agents/20171124194920_et-finger-jack.jpg
[filename] => 20171124194920_et-finger-jack.jpg
[name] => et-finger_jack.jpg
[size] => 122720
)
)
)
[save_data4] => Array
(
[data] => Array
(
[aid] => 1
[chronoform] => edit_agent
[event] => submit
[agent_image] => 20171124194920_et-finger-jack.jpg
[name] => xxxxx
[email] => xxxxxx
[phone] => xxxxxx
[bio] => Big guy. Small smile bbbb
[button6] =>
[a2e59797cfd7e007061e0cdfe2dddcbc] => 658joab2vchn2dofbknldpvm85
[b9ef1604eaada687139b7d361fdfc189] => 49i7qj45rf8vosjv6tp3qkkm31
[joomla_user_state] => logged_in
[slider-mybgcarousel] => 0
[_ga] => GA1.2.92911649.1490033135
[_gid] => GA1.2.2126637492.1510587806
[Itemid] => 287
[option] => com_chronoforms6
[view] => form
[modified] => 2017-11-24 19:49:20
)
[_success] => Data saved successfully
[log] => Array
(
[0] => UPDATE `jos_chronoengine_chronoforms_data_add_agent` AS `Agent` SET `agent_image` = '20171124194920_et-finger-jack.jpg', `name` = 'xxxxxxxx', `email` = 'xxxx@xxxx.com', `phone` = 'xxxxx', `bio` = 'Big guy. Small smile bbbb', `modified` = '2017-11-24 19:49:20' WHERE `aid` = '1' AND `aid` = '1';
)
[var] => Array
(
[agent_image] => 20171124194920_et-finger-jack.jpg
[name] => xxxxx
[email] => xxxx@xxxx.com
[phone] => xxxxxx
[bio] => Big guy. Small smile bbbb
[modified] => 2017-11-24 19:49:20
)
)
[read_data5] => Array
(
[log] => Array
(
[0] => SELECT `Agent`.`aid` AS `Agent.aid`, `Agent`.`user_id` AS `Agent.user_id`, `Agent`.`created` AS `Agent.created`, `Agent`.`modified` AS `Agent.modified`, `Agent`.`name` AS `Agent.name`, `Agent`.`email` AS `Agent.email`, `Agent`.`phone` AS `Agent.phone`, `Agent`.`agent_image` AS `Agent.agent_image`, `Agent`.`bio` AS `Agent.bio` FROM `jos_chronoengine_chronoforms_data_add_agent` AS `Agent` WHERE `Agent`.`aid` = '1' LIMIT 100;
)
[var] => Array
(
[Agent] => Array
(
[aid] => 1
[user_id] => 0
[created] => 2017-11-09 11:46:31
[modified] => 2017-11-24 19:49:20
[name] => xxxxxx
[email] => xxxxxx@xxx.com
[phone] => xxxxxx
[agent_image] => 20171124194920_et-finger-jack.jpg
[bio] => Big guy. Small smile bbbb
)
)
)
)
debug output on submit if i leave the agent_image field blank:
Array
(
[validate_fields2] => Array
(
[log] => Automatic validation enabled.
[var] => 1
)
[upload12] => Array
(
[path] => /home/domains/vol3/797/1404797/user/htdocs/webapp/uploads/agents/
[agent_image] => Array
(
[extensions] => Array
(
[0] => jpg
[1] => jpeg
[2] => png
[3] => gif
)
[info] => File is not present.
)
[var] => Array
(
)
)
[save_data4] => Array
(
[data] => Array
(
[aid] => 1
[chronoform] => edit_agent
[event] => submit
[agent_image] =>
[name] => xxxxxxx
[email] => xxxxx@xxxxx.com
[phone] => xxxxxxx
[bio] => Big guy. Small smile bbbb
[button6] =>
[a2e59797cfd7e007061e0cdfe2dddcbc] => 658joab2vchn2dofbknldpvm85
[b9ef1604eaada687139b7d361fdfc189] => 49i7qj45rf8vosjv6tp3qkkm31
[joomla_user_state] => logged_in
[slider-mybgcarousel] => 0
[_ga] => GA1.2.92911649.1490033135
[_gid] => GA1.2.2126637492.1510587806
[Itemid] => 287
[option] => com_chronoforms6
[view] => form
[modified] => 2017-11-24 19:52:46
)
[_success] => Data saved successfully
[log] => Array
(
[0] => UPDATE `jos_chronoengine_chronoforms_data_add_agent` AS `Agent` SET `agent_image` = '', `name` = 'xxxxxx', `email` = 'xxx@xxxxx.com', `phone` = 'xxxxxx', `bio` = 'Big guy. Small smile bbbb', `modified` = '2017-11-24 19:52:46' WHERE `aid` = '1' AND `aid` = '1';
)
[var] => Array
(
[agent_image] =>
[name] => xxxxxxx
[email] => xxxxx@xxxxx.com
[phone] => xxxxxx
[bio] => Big guy. Small smile bbbb
[modified] => 2017-11-24 19:52:46
)
)
[read_data5] => Array
(
[log] => Array
(
[0] => SELECT `Agent`.`aid` AS `Agent.aid`, `Agent`.`user_id` AS `Agent.user_id`, `Agent`.`created` AS `Agent.created`, `Agent`.`modified` AS `Agent.modified`, `Agent`.`name` AS `Agent.name`, `Agent`.`email` AS `Agent.email`, `Agent`.`phone` AS `Agent.phone`, `Agent`.`agent_image` AS `Agent.agent_image`, `Agent`.`bio` AS `Agent.bio` FROM `jos_chronoengine_chronoforms_data_add_agent` AS `Agent` WHERE `Agent`.`aid` = '1' LIMIT 100;
)
[var] => Array
(
[Agent] => Array
(
[aid] => 1
[user_id] => 0
[created] => 2017-11-09 11:46:31
[modified] => 2017-11-24 19:52:46
[name] => xxxxxxx
[email] => xxxx@xxxxx.com
[phone] => xxxxxx
[agent_image] =>
[bio] => Big guy. Small smile bbbb
)
)
)
)