Closed (fixed)
Project:
FileField
Version:
6.x-3.10
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 May 2011 at 23:16 UTC
Updated:
23 Apr 2013 at 21:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
kingandyWhen this cropped up in Drupal Core (#360605: PHP 5.3 Compatibility), the core team came to the conclusion that since 6.x is no longer the "active" Drupal version, and support for it will likely be dropped long before PHP actually removes this function, the best resolution is simply to suppress the error message.
This is easy enough - just go to line 734 of filefield.module and add a '@' immediately before the ereg_replace function.
Attached is a patch that will do this for you.
Comment #2
superfedya commentedThanks for the fix.
Comment #3
traviscarden commentedI agree with the approach, and the fix works of course, but the patch doesn't apply. Here's one that does.
Comment #4
gateway69 commentedwas this patch commited, I found myself in the same situation today when clearing errors in db log..
Comment #5
quicksketchNo it hasn't been committed. Drupal 6 itself doesn't run real great on PHP 5.3+, but this should be applied in any case. FileField isn't receiving regular updates but I'll include this one in the next version when I go through the queue.
Comment #6
quicksketchNo it hasn't been committed. Drupal 6 itself doesn't run real great on PHP 5.3+, but this should be applied in any case. FileField isn't receiving regular updates but I'll include this one in the next version when I go through the queue.
Comment #7
petew commentedI would prefer we update the function call to something which isn't deprecated, rather than just hiding the error.
Patch attached which contains a switch to using preg_replace().
It's a simple change, but let me know if it needs work.
Comment #8
petew commentedApologies, that patch probably won't apply in it's current state purely due to the file location.
I'll try and create an appropriate one using the normal Drupal git method.
Comment #9
petew commentedOk, so, more hast less speed.
Attached is a normal Drupal project patch file.
Comment #10
quicksketchWe can't change the API on developers at this point in the release and there's not signifant reason to make a 4.x release just for this purpose.
Comment #11
quicksketchOops sorry. The patch in #3 really should still be committed.
Comment #12
petew commentedAgreed. I only submitted the patch as I finally felt compelled to fix it after having the message continually appear, and thought i'd provide a patch back.
Patch #3 looks good, but as it's nearly a year and hasn't been committed I wonder whether it hadn't been accepted/committed due to it continuing with the deprecated function instead of updating to the PHP recommended replacement. Hence the alternate patch.
Whilst I don't agree with the approach of hiding the deprecated functions rather than updating to the supported language alternative functions, this does sadly appear to be Drupal way, and as such patch #3 would be good. I overlooked that there are still occurrences of ereg_replace hidden away in D6 core. (and maybe other deprecated functions, I haven't looked in detail)
Anyway, thanks, if #3 could be committed that would be great.
Sorry to bump this issue thread after all this time.
Comment #13
quicksketchNo worries, it's my bad for not having committed this already. I've largely stopped doing any D6-only development work; which has in turn let FileField languish because I no longer have any D6 sites. I'll go through the queue and get all these RTBC patches at some point. RTBC for #3.
Comment #14
quicksketchCommitted #3. Sorry for the delay on this guys. I'll try to get a new release out this week.