News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Help with an error

Started by fox0r, November 11, 2010, 03:28:26 PM

Previous topic - Next topic

fox0r

This one keeps popping up in my log.. 2.0 RC4

2: Invalid argument supplied for foreach()File: E:/Webserver/websites/forums.hellestar.com/Sources/Subs-Editor.php
Line: 2074

Any idea how I can fix it?
// Pick some random IDs
$questionIDs = array();
if ($thisVerification['number_questions'] == 1)
$questionIDs[] = $modSettings['question_id_cache'][array_rand($modSettings['question_id_cache'], $thisVerification['number_questions'])];
else
[b]foreach (array_rand($modSettings['question_id_cache'], $thisVerification['number_questions']) as $index)[/b]
$questionIDs[] = $modSettings['question_id_cache'][$index];
}
}



fox0r

1.   Dice Roller BBcode    1.3     [ List Files ] [ Delete ]
2.   nCode Image Resizer    1.3.1     [ Uninstall ] [ List Files ] [ Delete ]
3.   Post Ratings    1.4     [ List Files ] [ Delete ] (Still working on getting this one to work properly, it's giving me issues.)
4.   Post History    0.3     [ List Files ] [ Delete ]
5.   SideSparks Chat Integration    1.2.1     [ Uninstall ] [ List Files ] [ Delete ]
6.   Spoiler BBCode    1.1.3     [ Uninstall ] [ List Files ] [ Delete ]
7.   TinyPortal    1.101 

kat

This line:

[b]foreach (array_rand($modSettings['question_id_cache'], $thisVerification['number_questions']) as $index)[/b]


What's with the "Bold" tags, at either end?

fox0r

I expected it to bold it inside of the code tag, but I guess it doesn't.  That's the line that is erroring.

kat

Best remove the tags, then. ;)

In PHP, I guess you can use the HTML <b></b> tags.

Not sure how it's affect that line, though, to be honest.

kat

Quote from: fox0r on November 12, 2010, 12:02:53 PM
I expected it to bold it inside of the code tag, but I guess it doesn't.  That's the line that is erroring.

Sorry, fox0r, I may have misunderstood you.

Those tags aren't in the actual code...

Or are they?

xenovanis

Can you post back the complete errormessage (including the url with action where it failed)? Also, please attach the file Subs-Editor.php, found in the /Sources directory of your forum.
"Insanity: doing the same thing over and over again and expecting different results."

kat

#8
I had a look at the corresponding file on my site and I noticed that the

}
}


bit isn't there, on mine.

Looks like a mod's gone squiffy.

xenovanis

It is on mine. However, that code is on line 2060 of a fresh install, so it is probably a mod that's interfering.
"Insanity: doing the same thing over and over again and expecting different results."

kat

I'm trying to go through the mods, to see which one edits that file...

Bloody hard work... ;)

kat


NanoSector

My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

kat

Ta, Yoshi!

Just got to wait for the attachment, now, so we can make it worse put it right!

fox0r

I'm getting ready to go out, but I'll do it by tomorrow, for sure!

I'm also having something weird going on... On any settings in admin panel where there are on/off check boxes, I have also text fields for 1's or 0's.. Is this normal with RC 4?  I'll put up a screenie tomorrow too when I put up my subs-editor file. <3

Thanks for the help!

fox0r

Here is the requested file.

fox0r

And here is the screen shot.

kat

#17
Can you try something, for me?

Can you rename Subs-Editor.php to something like Subs-Editor0.php and replace it with the attached one?

One thing I know it'll do, is stop the Dice Roller mod working.

Apart from that, if everything else works, OK, we'll know it's the Dice Roller that's causing the errors.

That "Invalid argument supplied for foreach()" can happen if you try to do a foreach on a variable that isn't an array.

So, we'll need to find where that array is supposed to be set.

When you installed that mod, were there any errors?

Illori

K@ where is the attachment?

kat


Advertisement: