I'm getting this error on using the duration field in a CCK node with max hours and min seconds:
warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?< at offset 4 in /var/www/vhosts/fitmusic.com/httpdocs/sites/all/modules/duration/duration.inc on line 113.
warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?< at offset 4 in /var/www/vhosts/fitmusic.com/httpdocs/sites/all/modules/duration/duration.inc on line 114.
warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (?< at offset 4 in /var/www/vhosts/fitmusic.com/httpdocs/sites/all/modules/duration/duration.inc on line 115.
It works fine on the preview but fails on final submission.
Any thoughts?
Thanks
Comments
Comment #1
jpetso commentedCould you insert the following lines just after the assignments and before the preg_match() calls? (Minus the php tags, that is.)
I think that should be line 111. Drupal should then show the regular expressions as messages, maybe I can make some sense out of those if you copy them in here. Also... are you using PHP 5 or 4? (Maybe that makes a difference too? although I think it shouldn't.)
Comment #2
jpetso commentedOops, wrong variable names initially. I edited the above comment, please ignore the code that a possible notification email might have sent you.
Comment #3
amccann commentedSorry for the delay - I didn't get a notification. I've fixed that so I should get updates now.
Here is the result
I am on a platform with the following...
MySQL database 5.0.45
PHP 5.2.6
Thanks for your help - I will be more responsive.
Alan
Comment #4
jpetso commentedOk, sorry for the delay (kinda busy with little time for Duration, and other modules :P ). Seeing your output, I'm noticing that it doesn't really help - not only is the regular expression (aka strange output) constructed correctly but also the tag-like pattern names (<year>, etc.) are swallowed by your browser and only visible in the HTML source.
Anyways, after a bit of googling and a short trip into the PHP documentation, I think the problem might be with those pattern names. Don't know where I've got my format from (probably from standard Perl regexp documentation, or from the Qt docs, it seems), but PHP might not interpret the pattern names as standard regexp interpreters do, or at least not on all systems (it works on mine). So please try to do the following and tell me if that fixes the error or not.
(?<sign>\\-)into(?P<sign>\\-)(so the "P" goes between the question mark and the less-than sign). Do this only for expressions that are actually named, e.g. for(?:(?<years>${number})Y)you would insert the "P" between the second "?" and associated "<", but the "<?:" at the start would remain unchanged. The lines that need to be changed are 73, 78-84, and 93-99.Hope that works out, I'm curious if it does. Cannot test by myself unfortunately, so I need to ask you again to do that for me.
Comment #5
amccann commentedThat was the magic trick!
Thanks.
The site we are using it on is a soon to be launched update to http://fitmusic.com
Comment #6
jpetso commentedCool. I applied the fix to CVS, so the next release (the one after 6.x-1.0-rc2) won't cause that error anymore.
Comment #7
jpetso commentedI thought I changed the title with the previous comment already?
Comment #8
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.