Announcement

Collapse
No announcement yet.

cgi:error AH01215: defined(%hash) is deprecated

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    cgi:error AH01215: defined(%hash) is deprecated

    Checking my Cpanel for errors on my domain, I have found hundreds of errors like this.
    It seems like this error is thrown up every time someone visits the shop.

    Is there some code in al000001.pm that is now out of date and needs to be updated?

    Anyone else seen this in their error logs?


    Code:
    [Wed Mar 22 14:35:03.117236 2017] [cgi:error] [pid 3164] [client XX.XX.XX.XX:43761] AH01215: \t(Maybe you should just omit the defined()?): /home/XXXXXX/public_html/cgi-bin/dx000001.pl, referer: http://www.arka-shop.co.uk/acatalog/ear-stretching-expanders-steel-p1.html
    [Wed Mar 22 14:35:03.117219 2017] [cgi:error] [pid 3164] [client XX.XX.XX.XX:43761] AH01215: defined(%hash) is deprecated at al000001.pm line 911.: /home/XXXXXX/public_html/cgi-bin/dx000001.pl, referer: http://www.arka-shop.co.uk/acatalog/ear-stretching-expanders-steel-p1.html
    Arka Tribal Jewellery

    #2
    In the Perl language that deals with the Cart, Search and Checkout the defined statement is considered to be deprecated if used on hashes. This means that it may be removed from the language in future releases so should not be trusted to be always available or to run error free. Your system isn't failing but simply issuing a warning of a potential future problem.

    SellerDeck uses some ancient code (circa 1998) in ACTINIC.pm (which is the source of file al000001.pm) and the line:
    Code:
    	if ((defined %::g_InputHash) &&
    is causing the error.

    If you're feeling brave you could try editing ACTINIC.pm (in your Site folder) and replacing the above with:
    Code:
    	if (%::g_InputHash &&
    I think there are 2 occurrences of the above.

    P.S. Said code is still there in SD 2016.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Once again.... Norman to the rescue!

      Thanks Norman, I don't know where Sellerdeck would be exactly without your (unpaid) support!!!
      Arka Tribal Jewellery

      Comment


        #4
        I've posted in Bug Reports as it's easily fixed.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          The original error has stopped but it's been replaced by a new one now!

          Using a hash as a reference is deprecated at sl000001.pm line 615.

          Code:
          [Mon Mar 27 18:51:03.907285 2017] [cgi:error] [pid 23478] [client 81.97.228.96:47022] AH01215: Using a hash as a reference is deprecated at sl000001.pm line 615.: /home/######/public_html/cgi-bin/ss000001.pl, referer: http://www.#####.co.uk/acatalog/index.html
          [Mon Mar 27 18:50:07.744572 2017] [cgi:error] [pid 23343] [client 81.97.228.96:46997] AH01215: Using a hash as a reference is deprecated at sl000001.pm line 615.: /home/######/public_html/cgi-bin/ss000001.pl, referer: http://www.######.co.uk/cgi-bin/cm000001.pl
          [Mon Mar 27 18:48:18.398021 2017] [cgi:error] [pid 23303] [client 81.97.228.96:46951] AH01215: Using a hash as a reference is deprecated at sl000001.pm line 615.: /home/######/public_html/cgi-bin/ss000001.pl, referer: http://www.######.co.uk/cgi-bin/ca000001.pl?ACTION=SHOWCART
          Arka Tribal Jewellery

          Comment


            #6
            do you know where else it might have been used?
            Arka Tribal Jewellery

            Comment


              #7
              That's more dodgy code - this time in Search.pm. Look near the bottom for:
              Code:
              				$phashOutput->{$sProductReference} = $phash1->{$sProductReference} + $phash2->{$sProductReference};	# add this product to the output list, adding up relevance values
              and change to:
              Code:
              				$$phashOutput{$sProductReference} = $phash1->{$sProductReference} + $phash2->{$sProductReference};	# add this product to the output list, adding up relevance values
              And then also change:
              Code:
              			$phashOutput->{$sProductReference} = $phashOutput->{$sProductReference} + %$phash2->{$sProductReference};
              to:
              Code:
              			$$phashOutput{$sProductReference} = $phashOutput->{$sProductReference} + %$phash2->{$sProductReference};
              N.B. Only lightly tested.
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


                #8
                Thanks again Norman.

                So everyone using Sellerdeck will have these errors in their error logs... but most people aren't bothered by them?
                Arka Tribal Jewellery

                Comment


                  #9
                  Hi Norman,

                  I made the changes you suggested in post number 7, (edited search.pm and refreshed website) but the error is still occurring if anyone uses the search.
                  Arka Tribal Jewellery

                  Comment


                    #10
                    I did a 'refresh' maybe I need to do a purge and refresh?
                    Arka Tribal Jewellery

                    Comment


                      #11
                      There may be other ocurrences of deprecated code.

                      Your error logs will tell you the script and line to look at. You then need to match that line cgi-bin file with the appropriate line in the source file in your Site folder that creates it. There's a post somewhere in the KB showing the relationship between these file-names. Perl help-sites will tell you how to fix the code.

                      Or just ignore it as it's only a warning, not an actual hard error!
                      Norman - www.drillpine.biz
                      Edinburgh, U K / Bitez, Turkey

                      Comment


                        #12
                        ok thanks anyway Norman!

                        Maybe I'll have a go. It's not nice seeing hundreds of errors in the logs, and it makes it difficult to spot if there are any important ones...
                        ...and I suppose at some point these will stop being warnings and become issues.
                        Arka Tribal Jewellery

                        Comment


                          #13
                          This post has been a godsend, even four years on, so a big thank you to Norman.

                          Heart Internet have just upgraded Perl, thus putting my website out of action. Having changed the four pieces of code as suggested in this post, customers can now purchase again.

                          However, search no longer works, and nor can customers login to their accounts. I was wondering if anybody else had experience with this. I’m using v. 16.

                          Comment

                          Working...
                          X