Closed GoogleCodeExporter closed 8 years ago
Update on the Issue:
Seems like wordpress saves the value in the database (wp_postmeta->meta_value)
as it should. The bug is with displaying the field value in /wp-admin/post.php
after submission.
Original comment by vr.ome...@gmail.com
on 23 Jul 2014 at 11:44
Original comment by ever...@fireproofsocks.com
on 23 Jul 2014 at 2:46
I took a permanent solution by adding:
if(preg_match('/((?:(?:[1]{1}\\d{1}\\d{1}\\d{1})|(?:[2]{1}\\d{3}))[-:\\/.](?:[0]
?[1-9]|[1][012])[-:\\/.](?:(?:[0-2]?\\d{1})|(?:[3][01]{1})))(?![\\d])/', $str))
{
$out = (array) $str;
}
into CCTM_FormElement.php (line 672)
the problem seems to be with:
$out = (array) json_decode($str, true); in function get_value();
Original comment by vr.ome...@gmail.com
on 24 Jul 2014 at 9:24
I too have this problem with dates that look like 1901-2014. The display in the
EDIT shows 1901 but the database is correct after the edit with 1901-2014.
My plugin is at 0.9.7.13 and WordPress is 4.0
I added this code to line CCTM_FormElement.php (line 672) as instructed:
if(preg_match('/((?:(?:[1]{1}\\d{1}\\d{1}\\d{1})|(?:[2]{1}\\d{3}))[-:\\/.](?:[0]
?[1-9]|[1][012])[-:\\/.](?:(?:[0-2]?\\d{1})|(?:[3][01]{1})))(?![\\d])/', $str))
{
$out = (array) $str;
}
I added the line directly above:
if (!is_array($str)) {
$out = (array) json_decode($str, true);
}
however, it made no change. The problem still exists.
I also found that there is no problem if I enter 1901 - 2014. Then it displays
correctly in the Edit screen and is also correct in the database.
But, I need this problem fixed because of the large amount of data that has
been entered into the database in the past.
Thanks
Original comment by denisone...@gmail.com
on 2 Oct 2014 at 2:57
Original comment by ever...@fireproofsocks.com
on 11 May 2015 at 5:31
Original issue reported on code.google.com by
vr.ome...@gmail.com
on 23 Jul 2014 at 11:20