Breaking this out from http://drupal.org/node/1955318#comment-7230916. The custom date formatting introduced in Commons 3.1 uses preg_filter(), which requires PHP 5.3+.

Fatal error: Call to undefined function preg_filter() in C:\Users\...\Sites\commons-7.x-3.1\profiles\commons\modules\contrib\commons_events\commons_events.module on line 477

Let's consider remediations, including revising the design to provide a simpler date format that's presentable but requires less processing.

Comments

japerry’s picture

The amount of date improvements in 5.3 I think is warranted requiring 5.3. Other modules are starting to require it, I don't think its unreasonable to require 5.3 in this case.

However, we do need to put a version requirement in the info file, so it'll block 5.2 installers from running.

ezra-g’s picture

We currently support PHP 5.2 as part of the stated system requirements for Commons 3, so it doesn't seem viable to change that without a compelling reason after the product release

However, we do need to put a version requirement in the info file, so it'll block 5.2 installers from running.

At the very least, we should have fallback behavior that avoids having a fatal PHP error here.

japerry’s picture

Status: Active » Needs review

This should be no longer needed in 3.2 when the date formatter patch is put in: #1950204: Date format for events should match the designs

japerry’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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

UB’s picture

The current download (a/o May 5, 2013) still causes this fatal PHP error on a basic, fresh install when one's server is running PHP 5.2.

I think you'll find that a vast majority of hosts are still using something pre-5.3.

Having to manually alter the database to disable some of the package's functionality, with no suggestion here in the Issue thread about how to then regain that functionality (commons_events) should still be addressed in some way.

I hope the final word isn't that this was "automatically fixed"...

Thanks for your time!

Kamal.M’s picture

Status: Postponed (maintainer needs more info) » Needs work

I agree with UB, this is a major issue with my webhosting provider as well. I downloaded the latest avaialble stable distribution of Commons today, installed it and created a new event to get the following;

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

The error log shows this entry;

PHP Fatal error: Call to undefined function preg_filter() in /***/profiles/commons/modules/contrib/commons_events/commons_events.module on line 477

I'm able to go back in the browser window which allows me to un-publish the event and the site works again!

My WAMP server works well with PHP 5.4.3, Apache 2.4.2 and MySQL 5.5.24.

I had the same issue with Commons version 7.x-3.1.

Another issue out of the box (could be a separate issue) is the following;

Notice: Undefined index: radioactivity_timestamp in radioactivity_field_widget_form() (line 378 of /***/profiles/commons/modules/contrib/radioactivity/radioactivity.field.inc).

Please HELP!

ezra-g’s picture

Version: » 7.x-3.2
Component: Code » Events
Status: Closed (fixed) » Postponed (maintainer needs more info)

Do you get this error with the April 9th version of the Commons Events module?

http://drupal.org/node/1882512

Kamal.M’s picture

Status: Needs work » Postponed (maintainer needs more info)

I will get this tested ASAP.

Kamal.M’s picture

Hey ezra-g,

I got "Commons Events is already installed." when I tried to install the package you recommended. Uninstalling the existing version (7.x-3.2) appears to be tricky due to dependancies...

bsorgdrager’s picture

http://stackoverflow.com/questions/3611107/php-preg-filter-substitute-in...

Maybe this could help developers make this events module backwards compatible with 5.2 release? I'm not an expert in PHP, and not sure of all of the implications of this approach, but figured it'd be worth a share here.

toma’s picture

I get this error

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'Default Footer' for key 2

Fatal error: Call to undefined function preg_filter() in C:\Users\...\Sites\commons-7.x-3.2\profiles\commons\modules\contrib\commons_events\commons_events.module on line 477

I rename commons_events.module and get the website up !

I delete all event module folder and replace it with

https://drupal.org/node/1882512

Run drupal update ! install a module
addressfield_tokens

Re run update.

And everything work just perfect :)

csc4’s picture

Still happening - just lost my site to this

According to https://drupal.org/node/1955434#comment-7252682 this is 'fixed' - how is it fixed please?

csc4’s picture

Please can you advise what can do to resolve this

[11-Aug-2013 00:43:23] PHP Fatal error:  Call to undefined function preg_filter() in ....\wwwroot\profiles\commons\modules\contrib\commons_events\commons_events.module on line 477

My site still down....

There's no suggestion this module is 5.3 only so perhaps suggestion at #11
https://drupal.org/node/1955434#comment-7460692 would help?

csc4’s picture

Status: Postponed (maintainer needs more info) » Active

#12 helped a lot - I have a site again! thank you! - but now getting
Undefined index: commons_events_attend_event_form_5

ezra-g’s picture

Status: Active » Closed (fixed)

Please re-open this issue if you continue to experience this problem with Commons 3.3.