moving to 2.0 kills my udt on preg_replace
Posted: Tue Dec 12, 2017 5:45 pm
Upgrading a site from 1.x to 2.x has thrown up an issue with a UDT.
This issue is that on submit (in admin) the UDT fails to save and instead goes to a page not found error.
I have narrowed the issue down to a single line..
$today = date("Y-m-d G:i:s");
$title = $course_name." ".$firstname." ".$surname;
$title_clean = preg_replace("![^a-z0-9]+!i", "-", $title);
$title_nospace = str_replace(" ","_",$title_clean);
$alias = strtolower($title_nospace);
So for some reason preg_replace causes the udt to die. I need to find a workaround to give me the same results from that line. Can anyone advise an route to take?
This issue is that on submit (in admin) the UDT fails to save and instead goes to a page not found error.
I have narrowed the issue down to a single line..
$today = date("Y-m-d G:i:s");
$title = $course_name." ".$firstname." ".$surname;
$title_clean = preg_replace("![^a-z0-9]+!i", "-", $title);
$title_nospace = str_replace(" ","_",$title_clean);
$alias = strtolower($title_nospace);
So for some reason preg_replace causes the udt to die. I need to find a workaround to give me the same results from that line. Can anyone advise an route to take?