Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: Fehlermeldung Warning: array_key_exists ... nach Suche

    dernix

    • Fördermitglied
    • Beiträge: 129
    Hallo,

    ich bekomme folgende Fehlermeldung im Frontend bei einer Suche nach Produkten angezeigt:

    Code: PHP  [Auswählen]
    Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /shop/includes/modules/product_listing.php on line 92

    der Code ab Zeile 92 besagt:
    Code: PHP  [Auswählen]
      if (!array_key_exists('listing_template', $category) || $category['listing_template'] == '' || $category['listing_template'] == 'default') {
        $files = array ();
        if ($dir = opendir(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/product_listing/')) {
          while (($file = readdir($dir)) !== false) {
            if (is_file(DIR_FS_CATALOG.'templates/'.CURRENT_TEMPLATE.'/module/product_listing/'.$file) and (substr($file, -5) == ".html") and ($file != "index.html") and (substr($file, 0, 1) !=".")) {
              $files[] = $file;
            }
          }
          closedir($dir);
        }
        sort($files);
        $category['listing_template'] = $files[0];
      }

    Was haut denn da nicht hin :?:

    Danke für einen Tipp!

    Linkback: https://www.modified-shop.org/forum/index.php?topic=31408.0

    web0null

    • Experte
    • Beiträge: 1.998
    Re: Fehlermeldung
    Antwort #1 am: 05. November 2014, 13:43:33
    In der /includes/modules/product_listing.php

    statt:
    Code: PHP  [Auswählen]
    if (!array_key_exists('listing_template', $category) || $category['listing_template'] == '' || $category['listing_template'] == 'default') {

    das hier einfügen:
    Code: PHP  [Auswählen]
    if(empty($category['listing_template']) || $category['listing_template'] == 'default') {

    Quelle: modified eCommerce Shopsoftware 1.06 rev 4642 veröffentlicht

    dernix

    • Fördermitglied
    • Beiträge: 129
    Re: Fehlermeldung
    Antwort #2 am: 05. November 2014, 13:55:30
    wow, das ging ja schnell ... und hat funktioniert!  :thx:

    ... und ich hätt wohl intensiver danach suchen können  :whistle:

    Bonsai

    • Viel Schreiber
    • Beiträge: 4.127
    • Geschlecht:
    Re: Fehlermeldung Warning: array_key_exists ... nach Suche
    Antwort #3 am: 05. November 2014, 14:17:43
    :-) Wollte gerade DOPPELPOST schimpfen, weil ich die Lösung gestern schon gepostet hatte, war aber jemand anders der das Problem hatte :-)
               
    anything