I'm getting the following warning on a 4.7.6 install with the latest dev (13 March 07) of date and also latest version of pathauto. Whenever I try to change the pathauto settings. It also comes up when using the pageroute module.
warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /var/www/modules/contrib/date/date_pathauto.inc on line 22.
The same error is found on other lines, as well.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | date_pathauto_2.patch | 4.04 KB | webchick |
| #9 | date_pathauto_1.patch | 4.04 KB | webchick |
Comments
Comment #1
techczech commentedI just discovered that his happens also on node submit.
Comment #2
techczech commentedOK, I got around this temporarily by commenting out the include of date_pathauto.inc (line 27) in date.module. Which shouldn't matter because I don't use date elements anywhere in my paths -- I think.
Comment #3
karens commentedI am not familiar enough with pathauto to fix this, so I need a patch from someone who is.
Comment #4
robomalo commentedThis also happens in Drupal 5.
Comment #5
techczech commentedI can confirm this happening in both 5.1 and 4.7.6. with the latest releases of Date and Pathauto.
Comment #6
karens commentedI committed something that should make the error go away. It is saying that granularity is not an array, which it should be, but it may be choking on new fields where that hasn't yet been added to the info returned by content_fields(). I'm not completely sure this is the right fix but it should keep any error from appearing. If more work is needed, you can reopen.
Comment #7
robomalo commentedDid the fix make it to head and not 5.x-1.4? I tried downloading 5.x-1.4 again and it still has the same bug. Thanks.
Comment #8
robomalo commentedIn regards to my previous post, it looks like the change you made in head on line 21 also needs to be made on line 70:
if ($field['type'] == 'date' || $field['type'] == 'datestamp') {should become
if (($field['type'] == 'date' || $field['type'] == 'datestamp') && is_array($field['granularity'])) {Comment #9
webchickNice sleuthing! Here's a patch!
I also had to wrap stuff around line 90 in an "if is_array($field['granularity'])"
I'm not sure if this is the right fix, though. But at least I don't have nasty errors anymore. :)
Comment #10
webchickNice sleuthing! Here's a patch!
I also had to wrap stuff around line 90 in an "if is_array($field['granularity'])"
I'm not sure if this is the right fix, though. But at least I don't have nasty errors anymore. :)
Comment #11
karens commentedFixed. Thanks!
Comment #12
(not verified) commented