After upgrading a copy our site from v1.3 to last nights build of 7.x-1.x-dev there's 3 new warnings (php messages) showing up in the log (watchdog) that occur when visiting a date facet enabled page

BEFORE the upgrade , no warnings, no notices
AFTER the upgrade:

Warning: Invalid argument supplied for foreach() in date_facets_get_ranges() (line 88 of profiles/wetkit/modules/contrib/date_facets/date_facets.module).

Warning: uasort() expects parameter 1 to be array, null given in date_facets_get_ranges() (line 87 of profiles/wetkit/modules/contrib/date_facets/date_facets.module).

Warning: Missing argument 1 for date_facets_get_ranges(), called in profiles/wetkit/modules/contrib/date_facets/date_facets.module on line 65 and defined in date_facets_get_ranges() (line 84 of profiles/wetkit/modules/contrib/date_facets/date_facets.module).

These three warnings repeat once for each date_facet we have enabled on the page, in our case, three date_facets are enabled so the 3 messages repeat 3 times.

Here's some info:

v1.3 uses date_facets

version = "7.x-1.0-beta1+6-dev"
core = "7.x"
project = "date_facets"
datestamp = "1393184028"

The following patche has been applied to this project:
- http://drupal.org/files/date_facets-date-facets-displayed-as-keys-201660...
Additionally we also applied this patch to the above build

last nights build of 7.x-1.x-dev (or v1.4) uses

version = "7.x-1.0-beta2"
core = "7.x"
project = "date_facets"
datestamp = "1376030725"

The following patches have been applied to this project:
- http://drupal.org/files/date_facets-date-facets-displayed-as-keys-201660...
- http://drupal.org/files/issues/date_facets-undefined-index-2220227-2.patch

Background notes: (not sure if this makes a difference to date facets) we're not using search api, we're still using the apache solr module in our local contrib
version = "7.x-1.2+4-dev"
core = "7.x"
project = "apachesolr"
datestamp = "1367541153"

no patches

Unsuccessful workaround test was performed:
Tried latest dev build of date_facets and it threw a page full of undefined index notices (in watchdog) so I reverted back this change as it didn't help.

For our site, the date_facets from the distro build v1.3 patched with this additonal patch is clean and doesn't throw any warnings or notices.

Any thoughts? in v1.3 we applied this patch to avoid unnecessary messages in the watchdog. But now the date_facets version is totally new and has introduced completely new warnings and the dev build of date_facets throws a whole page full of undifined index notices in the watchdog.

Comments

joseph.olstad’s picture

Title: date facets warnings and undefined index notices » date facets warnings Invalid argument supplied, uasort() null given, Missing argument 1 for date_facets_get_ranges

Change issue title:

warnings Invalid argument supplied for foreach,
uasort() expects parameter 1 to be array, null given,
Missing argument 1 for date_facets_get_ranges

joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

Perhaps we should revert date_facets back to

version = "7.x-1.0-beta1+6-dev"
core = "7.x"
project = "date_facets"
datestamp = "1393184028"

The following patche has been applied to this project:
http://drupal.org/files/date_facets-date-facets-displayed-as-keys-201660...
https://drupal.org/files/issues/date_facets-undefined-index-2219547-9.patch

?
Was there a use-case for the change to beta-2?

joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

For v1.5 we should probably put back beta1+6-dev with the two patches 2219547-9 and 2016601-1

for v1.6 look into getting the issues fixed upstream
? sound good?

sylus’s picture

Date Facets were using a dev release and now we have a stable release so I favor using that version. If you can please highlight patches on top of 1.0-beta2 that fix any issues you have. Take a look at: http://cgit.drupalcode.org/date_facets/log/ and see if any commits past 1.0-beta2 solve your problem.

I am releasing by EOD so if you can take a look at this before then. Perhaps there is custom code in date_facets you have.

joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

Ok, a patch is on the way, give me 5 minutes

joseph.olstad’s picture

Ok, this is patched against the latest dev branch, will adjust wetkit_search. patch to follow on wetkit_search

Here's the upstream issue 2280631

https://drupal.org/files/issues/date_facets_beta2_dev_Missing_argument_2...

sylus’s picture

Make sure you only patch on 1.0-beta2 so commit whatever patches are needed to that. thx.

joseph.olstad’s picture

Too late, I patched the dev, seems to work in my tests.

sylus’s picture

I said we are using a stable release 6 comments up and I favor using that release. We are making a consistent effort to prefer stables as this is simpler for end users and much easier for me.

I don't understand why you ignored this request. As it stands then I will only push 1.0-beta2 and figure out these patches tonight.

sylus’s picture

Status: Active » Fixed

Alright I looked at the patch I will take dev this time because it has been about 8 months since release but this is not a practice I want to encourage going forward as we are trying to bring out modules that aren't stable down to official release cycle.

Closing this issue and will push patch tonight.

Status: Fixed » Closed (fixed)

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