I've experienced some problems with parsing date with unicode characters (Russian)

Quick solution:

date_api_elements.inc

line 598:

preg_match('`^'. $regex2 .'$`', $date, $values);

change to

preg_match('/'.$regex2.'/u', $date, $values);

CommentFileSizeAuthor
#7 date-revert_unicode-802046-7.patch919 bytesarlinsandbulte

Comments

t3hk0d3’s picture

bump

t3hk0d3’s picture

Status: Active » Needs review

bump

karens’s picture

Status: Needs review » Fixed

I wish someone had tested this. I assume it fixes unicode but need to make sure nothing else breaks. I went ahead and committed it with a doc note to watch the changes.

dboulet’s picture

Status: Fixed » Needs work

Getting these errors on fresh install of Drupal, using date CCK field:

# Warning: preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Unknown modifier '(' in date_convert_from_custom() (line 606 of /www/drupal-6/sites/all/modules/date/date_api_elements.inc).
# Warning: array_shift() [<a href='function.array-shift'>function.array-shift</a>]: The argument should be an array in date_convert_from_custom() (line 607 of /www/drupal-6/sites/all/modules/date/date_api_elements.inc).
# Warning: preg_match() [<a href='function.preg-match'>function.preg-match</a>]: Unknown modifier '(' in date_convert_from_custom() (line 606 of /www/drupal-6/sites/all/modules/date/date_api_elements.inc).
# Warning: array_shift() [<a href='function.array-shift'>function.array-shift</a>]: The argument should be an array in date_convert_from_custom() (line 607 of /www/drupal-6/sites/all/modules/date/date_api_elements.inc).
# Field Date From date is invalid.

Reversing the change proposed here fixes the issue.

Ardshael’s picture

I also ran into this error today. Drupal and all modules are updated.

I wasn't using the jQuery before and just installed it today. Before that was installed it was working. I haven't started testing to see if disabling it will make it work again yet.

arlinsandbulte’s picture

Version: 6.x-2.4 » 6.x-2.5
Priority: Normal » Critical

I confirm #4. Reverting back eliminates the errors.

arlinsandbulte’s picture

StatusFileSize
new919 bytes

Patch to revert above changes attached.

arlinsandbulte’s picture

Steps to reproduce the error:
Drupal 6.19 clean install, CCK 6.x-2.8, Date 6.x-2.5, jQuery UI 6.x-1.3

  1. Enable Content, Date, Date API, Date Popup, Date Timezone, jQuery UI. Note: At first I did not enable/use Date Popup and was unable to reproduce the error in #4. With Date Popup enabled, the error was reproduced.
  2. Set Default site time zone (I used America/Chicago)
  3. Add a date field to Story content type. I used a data type of Date. Use Text Field with Date pop-up calendar widget (I think this is important to reproduce the error). Leave all other date field settings at their default.
  4. Create a new story node & fill out the date field. After clicking Save, the error as reported is displayed & node is not saved.

Applying the patch in #7 makes the errors go away & node is saved.

arlinsandbulte’s picture

Priority: Critical » Normal

I reverted this change back and committed the fix:
http://drupal.org/cvs?commit=407136

Once the -dev tarball is updated, that should include this fix. Or you can grab it straight from CVS now.

Warning! This is my first ever Drupal CVS commit. I hope I did not mess things up even worse!
Thanks for trusting in me, Karen

karens’s picture

This looks like a serious problem, I may need to do a new release.

Arlin, the patch is perfect, please go ahead and make the same change to the D7 version.

karens’s picture

Priority: Normal » Critical
Status: Needs work » Fixed

Changing status.

karens’s picture

I rolled a new release, 6.x-2.6. This looks potentially serious enough that I want to get a new release out before other people make the upgrade. We hit a quiet time on Friday night with the first release, so hopefully not too many people will have already done this and everyone else will see the later release.

dboulet’s picture

Are we sure that this should be marked as fixed? Has the original issue been addressed?

karens’s picture

Status: Fixed » Closed (won't fix)

Only one person reported any problem in the beginning and no one else ever confirmed either the problem or the fix. And then the proposed fix broke everything. If someone can confirm the problem and there are at least a couple people willing to figure out a fix that does not break other things we can work on a fix. Otherwise it appears to be something so little used that only one person cared about it.

I certainly don't have time to try to figure out how to fix something I don't use.

So I guess I will say won't fix unless there is more interest.