2

Have you ever tried to store a number like this 113044638720122 and then use views to filter it?

I was trying to use these large numbers, I used CCK decimal precision to 32 and Views. In a simple test, I passed 113044638720122 as fixed argument, then I looked to the query and the argument was changed to 2147483647 (which is like 2^32/2-1, signed integer max).

Do you know a human way to use these big numbers as arguments? Views is converting my decimal (ckk field) to some numeric type with less precision... and that corrupts my arguments and results.

I also tried store these numbers in strings, but if I do that I can't set "Allow multiple terms per argument", and that's a big limit.

Any clue? Thanks a lot.

Beto Aveiga
  • 3,466
  • 4
  • 27
  • 39

1 Answers1

1

Currently I'm solving this using hook_views_query_alter, first I change the big numbers to strings and then modify the arguments in the view. It's not the best solution I think, but it's working.

function mymodule_views_query_alter (&$view, &$query) {

  if ($view->name=='viewname' && $view->current_display=='displayname') {
    $query->where[0]['args']= somefunction();
  }

}
Beto Aveiga
  • 3,466
  • 4
  • 27
  • 39