Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This great module show me an error with php 5.3 and Pressflow when I upload a file.
Any fix?
Thanks
Comment | File | Size | Author |
---|---|---|---|
#9 | filefield-ereg-replace-deprecated-1155996-9.patch | 538 bytes | petew |
#7 | php5.3-remove-deprecated-filefield.patch | 602 bytes | petew |
#3 | filefield-ereg_replace-deprecated-1155996-3.patch | 537 bytes | TravisCarden |
#1 | filefield.module.patch | 500 bytes | kingandy |
Comments
Comment #1
kingandy CreditAttribution: kingandy commentedWhen 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 CreditAttribution: superfedya commentedThanks for the fix.
Comment #3
TravisCarden CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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.