I was running Date 2.x-dev from May 24 (I think...) and had some issues with it which were supposed to be fixed in the May 27 version, so I upgraded. Now any dates entered in my fields are erased upon submission. Dates submitted before the upgrade still have their dates in the database, but they're not showing up when using a table View (that part is probably a different issue).

My system and CCK exports are in this issue.

Have these issues been addressed in other issues? It's hard to tell--this queue is so full. If so, can someone point me to the relevant ones?

Comments

icecreamyou’s picture

I forgot to add--I have these errors when I'm looking at a table view for each entry in the view in my log:

preg_replace() [<a href='function.preg-replace'>function.preg-replace</a>]: Delimiter must not be alphanumeric or backslash in /home/[root]/domains/[domain]/public_html/[subdomain]/modules/date/date_api.module on line 1241.
Missing argument 2 for date_formatter_process(), called in /home/[root]/domains/[domain]/public_html/[subdomain]/modules/date/date/date.theme on line 41 and defined in /home/[root]/domains/[domain]/public_html/[subdomain]/modules/date/date/date.module on line 115.
Missing argument 3 for date_formatter_process(), called in /home/[root]/domains/[domain]/public_html/[subdomain]/modules/date/date/date.theme on line 41 and defined in /home/[root]/domains/[domain]/public_html/[subdomain]/modules/date/date/date.module on line 115.
johnalbin’s picture

Title: On update, dates stop working » Missing argument 2 for date_formatter_process

See #264208: Delimiter must not be alphanumeric or backslash for that error.

Changing title so we can focus on the date_formatter_process error messages.

bcn’s picture

Status: Active » Needs review
StatusFileSize
new700 bytes

I'm also getting the errors for Missing argument 3 for date_formatter_process() and Missing argument 3 for date_formatter_process()

On line 41 of date.theme we find $dates = date_formatter_process($element);

The problem is that the function defining date_formatter_process() found on line 115 of date.module looks like this:
function date_formatter_process($field, $item, $node, $formatter = 'default')

This function needs 3 arguments, and is only getting the one $element. I don't know where $element is coming from...

I didn't look at this very long, so I could way off, but the attached patch simply takes the arguments being given to function theme_date_display_combination($field, $item, $dates, $node = NULL)

and passes them to the the date_formatter_process(), like this:

-  $dates = date_formatter_process($element);
+  $dates = date_formatter_process($field, $item, $node);
johnalbin’s picture

StatusFileSize
new715 bytes

Actually, the only place theme('date_display_combination', …) is called is from date_field_formatter():

  // Call the right theme for this formatter.
  $dates = date_formatter_process($field, $item, $node, $formatter);
  if ($formatter != 'format_interval') {
    $output = theme('date_display_combination', $field, $item, $dates, $node);
  }

So actually date_formatter_process() is already run before theme_date_display_combination() is called. And since $formatter is not passed to the theme function, we can’t call pass $formatter to date_formatter_process() from within the theme function. So not only is the date_formatter_process() not needed in the theme function, you can't even call it correctly from within the theme function.

This patch simply removes that line from theme_date_display_combination() since its both redundant and broken.

bcn’s picture

Status: Needs review » Reviewed & tested by the community

Patch #4 applies cleanly, and the errors are gone!
Thanks John.

karens’s picture

Status: Reviewed & tested by the community » Fixed

Thanks! This is committed.

bcn’s picture

Status: Fixed » Needs review
StatusFileSize
new706 bytes

This sneaked back in there with this commit http://drupal.org/cvs?commit=119505.

Attached is a reroll of JohnAlbin's patch against the latest dev.

johnalbin’s picture

Status: Needs review » Reviewed & tested by the community

Good catch, Noah!

karens’s picture

Status: Reviewed & tested by the community » Fixed

Thanks -- trying to work on several versions at once is a recipe for disaster :)

Fix re-committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.