ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Undefined index: /core/core.functions.php(634) : eval()'d code on line 1255

November 09, 2009 12:15pm

Subscribe [4]
  • #1 / Nov 09, 2009 12:15pm

    Hi all,

    I’ve been trying to get a page working for our client that allows for sorting of results based on 2 relational fields and 2 custom fields. I’ve got a system that seems to be working via our developer, who is pretty fantastic with PHP, but is relatively new to EE. As a result, the system that he has sometimes seems to work, but whenever I make any change to the database, I get the above error in the title. This repeats for every last bit of info the php is trying to grab.

    The URL is: http://pattersonsheridan.com/ee/index.php/attorneys (Note: The error doesn’t show up after about 20 minutes after the change. Could this be a clue as to what I need to tweak/adjust?)

    <?php
    
    {exp:weblog:entries weblog="attorney" orderby="last_name" sort="asc"}
      $name = "{title}";
      $roles["{job_title}"][] = $name;
      {related_entries id="office"}
        $offices["{city}"][] = $name;
      {/related_entries}
      {attorney_practice_area}
        $practice_areas["{exp:replace find="&" replace="&"}{title}{/exp:replace}"][] = $name;
      {/attorney_practice_area}
    {/exp:weblog:entries}
    
      foreach ($roles as $role => $rpeople) {
        $roles[$role] = array_unique($rpeople);
      }
      ksort($roles);
      ksort($practice_areas);
      ksort($offices);
    
    ?>
    
    <div id="attorneys" class="content">
    <h2 class="tg">Attorneys</h2>
    <form id="attorneySearch" method="post" action="?">
        <select name="office" id="officeSelect">
            <option value="">Office</option>
                    <?php
                       foreach ($offices as $office => $people) {
                         echo '<option value="'.$office.'"';
                         if ($office == $_REQUEST['office']) { echo ' selected="selected" '; }
                         echo '>'.$office.'</option>';
                       }
                    ?>
        </select>
    
        <select name="practice" id="practiceSelect">
            <option value="">Practice</option>
                    <?php
                       foreach ($practice_areas as $practice_area => $people) {
                         echo '<option value="'.$practice_area.'"';
                         if ($practice_area == $_REQUEST['practice']) { echo ' selected="selected" '; }
                         echo '>'.$practice_area.'</option>';
                       }
                    ?>
        </select>
    
        <select name="title" id="titleSelect">
            <option value="">Title</option>
                    <?php
                       foreach ($roles as $role => $people) {
                         echo '<option value="'.$role.'"';
                         if ($role == $_REQUEST['title']) { echo ' selected="selected" '; }
                         echo '>'.$role.'</option>';
                       }
                    ?>
        </select>
    
           <select name="letter">
             <option value="">Last Name</option>
             <?php 
               if ($_REQUEST['letter'] != '') {
                 echo "<option selected=\"selected\" value=\"".$_REQUEST['letter']."\">".$_REQUEST['letter']."</a>";
               } 
             ?>
             <option value="A">A</a>
             <option value="B">B</a>
             <option value="C">C</a>
             <option value="D">D</a>
             <option value="E">E</a>
             <option value="F">F</a>
             <option value="G">G</a>
             <option value="H">H</a>
             <option value="I">I</a>
             <option value="J">J</a>
             <option value="K">K</a>
             <option value="L">L</a>
             <option value="M">M</a>
             <option value="N">N</a>
             <option value="O">O</a>
             <option value="P">P</a>
             <option value="Q">Q</a>
             <option value="R">R</a>
             <option value="S">S</a>
             <option value="T">T</a>
             <option value="U">U</a>
             <option value="V">V</a>
             <option value="W">W</a>
             <option value="X">X</a>
             <option value="Y">Y</a>
             <option value="Z">Z</a>
           </select>
    
        <input type="submit" name="button" id="button" value="Submit" />
    <!--
        <div id="searchAlphaList"><a href="#a">a</a> <a href="#b">b</a> <a href="#c">c</a> <a href="#d">d</a> e f g h i j k l m n o p q r s t u v w x y z ALL | Reset</div>
    -->
    </form>
    
    <table id="attorneyList" border="0">
    {exp:weblog:entries weblog="attorney" orderby="last_name" sort="asc"}
      <?php
        if (
          ($_REQUEST['office'] == '' or in_array("{title}", $offices[$_REQUEST['office']])) and
          ($_REQUEST['practice'] == '' or in_array("{title}", $practice_areas[$_REQUEST['practice']])) and
          ($_REQUEST['title'] == '' or in_array("{title}", $roles[$_REQUEST['title']])) and
          ($_REQUEST['letter'] == "" or strtolower(substr("{last_name}", 1, 1))  == strtolower($_REQUEST['letter']))
        ) { 
      ?>
        <tr>
            <td>{if prefix != ""}{prefix} {/if}<a href="http://{site_url}index.php/attorneys/detail/{url_title}">{title}{if suffix != ""}, {suffix}{/if}</a></td>
            <td>{job_title}</td>
            {related_entries id="office"}<td>{if city != "Taipei 106"}{city}{if:else}Taipei{/if}</td>{/related_entries}
        </tr>
      <?php 
      }
      ?>
    {/exp:weblog:entries}
    </table>

    Also, for reference, I’ve attached a screenshot of the attorney page, which all content should be pulled from, in case I’ve got something wrong here, as well as a screenshot of the error page in question.

    Thanks in advance if anyone has suggestions/ideas on what I’m doing wrong!

  • #2 / Nov 09, 2009 12:34pm

    smartpill

    456 posts

    I don’t know if this is causing that particular error but your “option” tags are closed with an “a”:

    <option value="P">P</a>

    so at least all those should be fixed.

  • #3 / Nov 09, 2009 12:38pm

    Fred Boyle

    73 posts

    Looks like it’s outputting a warning when an array index doesn’t exist in the $_REQUEST variable.
    Try prefixing all $_REQUEST with the @, this will prevent notices from being output.

  • #4 / Nov 09, 2009 12:45pm

    Okay. This is weird. I only see the errors in the particular web client I’m using at the time, but if I check in another browser, I don’t seem to have that problem. Maybe this really is just a caching issue? Also, thanks for noticing that, smartpill!

  • #5 / Nov 09, 2009 12:55pm

    Definitely confirmed it. It only errors out on my computer, on the computer used to make the change. Same browser, different machine in the office on the same connection yields the proper page.

  • #6 / Nov 09, 2009 5:22pm

    Ingmar

    29245 posts

    Looks like a local issue then, possible caching. Let us know how you get on.

  • #7 / Nov 10, 2009 1:27pm

    The problem is that it happened once on my machine, and then while I was making changes to the template for the client, their machine kept displaying the old page. I’m utterly confused now. 😕

  • #8 / Nov 10, 2009 4:33pm

    Ingmar

    29245 posts

    Still a possible caching issue… Is everything working as intended now?

  • #9 / Nov 10, 2009 4:34pm

    It works as intended, but only after a cached amount of time. I’ve got the templates set to not cache, but it seems they still do. Next step is to do a new install on my local machine and test it.

  • #10 / Nov 10, 2009 4:36pm

    Ingmar

    29245 posts

    Are you using any other forms of caching? Query caching, tag caching? Does your db server do its own, perhaps?

  • #11 / Nov 10, 2009 4:38pm

    Not to my knowledge. I assume query caching has to be enabled, correct? I haven’t seen our server do any caching before, and we’ve deployed 3 other EE sites on it, even.

  • #12 / Nov 10, 2009 4:40pm

    Ingmar

    29245 posts

    Yes, it needs to be enabled. Still, if it works after a while (ie the cache expires), this probably is due to some caching.

  • #13 / Nov 10, 2009 5:12pm

    Gotcha. I’m in the process of weeding out issues. The previous site had some malarky run with it because it was a slipshod custom cms and so there may be an issue with that. If it runs properly on my machine, then I’ll be pulling down and wiping their site and dbs and starting anew. :D

  • #14 / Nov 10, 2009 5:13pm

    Ingmar

    29245 posts

    Sounds like a plan. Let us know if you need any further assistance there.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases