1

I am trying to enumerate through a perfectly valid array using php 5.3.5 on Joomla 1.5. Whenever I try to access the array I get the white screen of death. If I add a die() statement right after then I get the array, (but of course, execution after that is halted). I purposely put no code after array call and die() for debugging purposes. Removing die doesn't echo the array. Has anyone else had this issue before?

Edit: yes, turned error checking on. WSOD is BLANK.

**in the View class:**

$seminarsRefDB =& JFactory::getDBO();
                $seminarsRefQuery = [MYSQL STUFF]
                $seminarsRefDB->setQuery($seminarsRefQuery);
                $seminarsRefList = $seminarsRefDB->loadAssocList();


for($i=0; $i<count($seminarsRefList); $i++) {

$classAppendix = $i;
                $seminarselects[] = JHTML::_('select.genericList', $seminar_options, 'seminar_title[]', 'class="seminardropdown" style="width:200px;"', 'value', 'text', $seminarsRefList[$i]['value'], 'seminar'.$classAppendix);
            };



$this->assignRef('seminarsArray', $seminarselects);


**In the Default Template**

print_r($this->seminarsArray[0]);
die;

END

I have another array called speakersArray which is echoed perfectly. I copied this code verbatim from the backend of my site where both arrays show no problems.

Used get_included_files and the default template is the last file included, so execution stops there.

danronmoon
  • 3,814
  • 5
  • 34
  • 56
  • What's the PHP Fatal error? `die()` is equivalent to `exit()` and executes no following code. – Paul DelRe Jul 12 '11 at 20:02
  • Could it be so that the problematic code is called with `@` operator? That could be the reason why errors are blocked. `@` essentially sets `error_reporting` to `0`, so no errors are displayed or logged. – binaryLV Jul 13 '11 at 13:11

2 Answers2

4

You should turn on display_errors and error_reporting to E_ALL so you don't get a white screen of death and have your server tell you what errors it is getting.

It sounds to me that if its a big array and your passing it around, you could be running out of memory at some point in the code. By placing a die right after the array, you may have not hit that threshold yet.

iLLin
  • 759
  • 3
  • 7
  • the JHTML class can't handle all the data I'm passing to it. If I limit it to the first 1000 options it shows, the second 1000 options shows, etc. I'm just requesting too much data to be put into option tags and Joomla! breaks as a result. So definitely something memory related, as I couldn't imagine Joomla! being programmed to give up after the first 1000 or so iterations. – danronmoon Jul 14 '11 at 12:38
  • how did you solve this issue then?? i'm having same problem with select boxes. If i echo 10 select boxes (each select has around 25 or 30 items) it works, but when trying to display more than around 15 or 20 select boxes on the same page i get the WSOD – FidoBoy Sep 16 '12 at 15:15
0

Though iLLin's approach is fine for development testing, this is bad practice for a live site. Assuming you have access to your server, view the error log file to find out what is going on here.

tail -f error_log

JM4
  • 6,740
  • 18
  • 77
  • 125