Hello,
When a user tries to create a content type that has FileField CCK field, the following error is generated:
warning: preg_match() expects parameter 2 to be string, array given in /usr/webserver/content/drupal/docs/includes/bootstrap.inc on line 723.
The node creation page still displays, but if the user tries to upload a file the following errors are generated:
The selected file sample_file.txt could not be uploaded. Only files with the following extensions are allowed: .
warning: preg_match() expects parameter 2 to be string, array given in /usr/webserver/content/drupal/docs/includes/bootstrap.inc on line 723.
It also appears that the node is trying to be saved at the same time. The first error also seems incorrect, as when adding the file upload field to this particular content type, I left the "allowed extensions" field blank, so all extensions should be allowed.
Previously, I was using version 6.x-1.0-beta2 of FileField, and none of these errors occured.
Any assistance would be greatly appreciated. Thanks!
Comments
Comment #1
decipheredI can confirm this.
If you define file types allowed to be uploaded it will eliminate the second error, but it's still the wrong behavior.
Comment #2
upupax commentedSame for me..
Comment #3
william_frane commented(Just changing the title to be more descriptive, since I noticed that someone else made a duplicate thread regarding this error.)
Comment #4
Stoke commentedSame here.
It seems that v3.x does not work at all :/
Comment #5
deciphered@Stoke - I beg to differ, it has some issues, but it's far from not working at all. As I mentioned, you can still upload, you just have to define allowed extensions first.
Comment #6
mistresskim commentedDeclaring the allowable extensions still results in the bootstrap error, which is obviously not a good thing. I think I will go back to 6.1 in the meantime, if that's possible.
Comment #7
decipheredI believe the bootstrap error was fixed in the last nightly build, I'm not entirely positive as I wasn't looking for it until a fair while after I updated.
As for the extensions issue, I submitted a patch that fixes the issue: #286972: Fix $extensions validation to enable any file if extensions left blank
Comment #8
dopry commentedthis should be fixed in HEAD.
Comment #9
korayal commentedI'm still having this problem, when I try to upload an image (using imagefield) the edit page refreshes, all the other fields remove their content, and I can see the image preview on that page.
Here is a screenshot in the attachment.
Comment #10
wuf31 commentedI'm not sure if this has anything to do with imagefield or filefield, but i'm also experiencing this.
Take a look at #285391: Recoverable fatal error in bootstrap.inc.
I post a debug_backtrace there.
Thanks for any help
Comment #11
drewish commentedon the issue wuf31 referenced he'd indicated the problem was custom code.
Comment #12
ruralrooster commentedAny fix for this. I am getting this with the newest versions of 6.x and cck and filefield....
Comment #13
WhiplashInfo commentedThis is a problem for me to:
"warning: preg_match() expects parameter 2 to be string, array given in /home/web25518/domains/fmedk.se/public_html/d/includes/bootstrap.inc on line 777."
Comment #14
RaRi commentedsubscribe
Comment #15
savinsur commentedsubscribe