[Solved]undefined offset causes server crash, emergengy help

More
13 years 2 months ago #18381 by ViveLeFlexicontent
PHP Notice: Undefined offset: 2 in plugins/flexicontent_fields/checkboximage.php on line 201
Code:
$i = 1; $display = array(); foreach ($listarrays as $listarray) { // get the image src $prefix = $mainframe->isAdmin() ? '../':''; $imgsrc = $prefix . $imagedir . $listarray[2] ; for($n=0, $c=count($values); $n<$c; $n++) { if ($values[$n] == $listarray[0]) { $display[] = '<img src="'.$imgsrc.'" class="hasTip" title="'.$field->label.'::'.$listarray[1].'" alt="'.$listarray[1].'" />'; } } $img = '<img src="'.$imgsrc.'" alt="'.$listarray[1].'" />'; $i++; } $field->{$prop} = implode($separatorf, $display); }
So the problem is the listarray[2]
I saw in another topic the problem could be the format it was saved in, so I saved in as unix code, and I replaced this code with the original just to be sure.
Server has been crashing daily because of this. Would like to check if this solved it, but can't access it cause it crashed again. Error log of 200+ mb :O
Please help

edit: server support restarted server, so I could check the error log and its still there, the error.
if I let it show me the last 20 errors they all happen in 1 second..
Really need a quick fix even if it means disabling lines with //

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #18397 by ggppdk
Please put @ in front of $listarray[2]
like this:
Code:
$imgsrc = $prefix . $imagedir . @$listarray[2] ;

What version you are using?

I had put error_reporting(E_ALL) in SVN to track down errors, now in latest revisions i removed it.

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #18406 by ggppdk
This error can only occur if you miss-configured the checkboximage. Please set you checkboximage elements like this (please put only one space after %%):
Code:
1::GPS::gps.jpg%% 2::Mini Fridge::minifidge.jpg%% 3::Child Seat::childseat.jpg

For some reason your text is not parsed properly and for some of the elements, the third option which is the image name, is not set properly.

Please check the checkboximage configuration

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #18413 by ViveLeFlexicontent
I think I have them configured properly, I always do value1::test::test.jpg%% value2 etc and no %% for the last one.
Maybe, well for sure, a problem is I have the mootools upgrade enabled. But I have to if I don't allot of modules stop functioning.
I haven't updated either, although I have the latest download version, I think. This because I changed a lot of code. When the new version is finished I will migrate to the new joomla and flexi all together.

Will add the @ now and see if it helps. Thanks!

edit: added the @, checked the error log and it looked like it was already gone beforehand. Maybe the changes I made earlier did the trick, the save in unix format or replacing the code segment with the original code.
I also set the mootools tooltip to yes, which I had set to no.
Because I have the mootools upgrade enabled I dont have the hover over alt texts. I miss em but I rather have those modules working.

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #18419 by ggppdk
if it is possible to make javascript compatible with both mootools v1.1 and v1.2, maybe i will do, will check if this requires a lot of time or not

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
13 years 2 months ago #18457 by ViveLeFlexicontent
that would be awesome.. :)
ok now how to add solved to the topic.. first timer :?

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.861 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline