Menu

#170 PHP Warnings and Notices in server error log

5.9.1
closed
None
5.8.2
Bug
2019-12-18
2019-08-25
Joachim
No

There are other PHP messages in my server error logs, which are repeated again and again (I list them in an arbitrary order). Some of them are related to the basket:

PHP Warning:  A non-numeric value encountered in /var/www/wikindx5/core/bibcitation/BIBFORMAT.php on line 736

Fixed - PHP Warning:  A non-numeric value encountered in /var/www/wikindx5/core/bibcitation/BIBFORMAT.php on line 511
Fixed - PHP Warning:  array_key_exists() expects parameter 2 to be array, bool given in /var/www/wikindx5/core/modules/resource/RESOURCEVIEW.php on line 1007
Fixed - PHP Warning:  sizeof(): Parameter must be an array or an object that implements Countable in /var/www/wikindx5/core/modules/basket/BASKET.php on line 98
Fixed - PHP Warning:  join(): Invalid arguments passed in /var/www/wikindx5/core/modules/browse/BROWSECOLLECTION.php on line 95
Fixed - PHP Notice:  Undefined index: resourceId in /var/www/wikindx5/core/modules/basket/BASKET.php on line 56
Fixed - PHP Notice:  Undefined index: id in /var/www/wikindx5/core/modules/resource/RESOURCEVIEW.php on line 88
Fixed - PHP message: PHP Warning:  join(): Invalid arguments passed in /var/www/wikindx5/core/modules/browse/BROWSECOLLECTION.php on line 95
Fixed - PHP Notice:  Undefined index: collectionType in /var/www/wikindx5/core/modules/browse/BROWSECOLLECTION.php on line 65

Joachim

Discussion

  • Mark Grimshaw

    Mark Grimshaw - 2019-08-26

    hi Joachim,

    Which version of PHP do you have?

    Mark

     
    • Joachim

      Joachim - 2019-08-26

      PHP 7.3

       
  • Joachim

    Joachim - 2019-08-26

    Hi Mark and Stéphane,

    with SVN trunk r2810 in place (on my test server, clicking on a publisher link in the details view, I get

    Fatal error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '3365,3635,4485,7198,10344,10345,10346,10347,10348,11456,12158,12412,12865,12899,' at line 1 in /var/www/wikindx5/core/sql/SQL.php on line 2839
    

    Weird is, that this happens only with a certain publisher, many others I tried don't have this problem …

    On my production server with SVN stable 2802, the same publisher is OK.

    Best
    Joachim

     
    • Mark Grimshaw

      Mark Grimshaw - 2019-08-27

      HI Joachim,
      SQL
      Is it possible to see the entire SQL statement by turning on print SQL statements in Configure?

      Mark

       
  • Stéphane Aulery

    PHP Fatal error: Uncaught Error: Call to undefined function mb_regex_encoding() in /var/www/wikindx5/core/startup/WEBSERVERCONFIG.php:61

    Phew, this message is unlikely. This would mean that the mbstring package or extension (depending on the system) is not installed. Very unlikely except if it is a new installation.

     
    • Joachim

      Joachim - 2019-08-27

      Hi Stéphane,

      you might be correct. php7.3-mbstring is installed. This message is an old one and occured only twice some weeks ago. Might be that was from a time when I switched from Debian 9 to 10 and had to fiddle with PHP packages. I think we can ignore that for now.

      Best
      Joachim

      --
      Dr. Joachim Trinkwitz
      Institut für Germanistik, Vergleichende Literatur- und Kulturwissenschaft der Universität Bonn
      53012 Bonn
      Tel.: 0228-737565
      www.germanistik.uni-bonn.de
      www.comicforschung.uni-bonn.de

       

      Last edit: Stéphane Aulery 2019-08-27
      • Stéphane Aulery

        Ok I remove it.

         
  • Stéphane Aulery

    I fixed this warning:

    PHP Warning: sizeof(): Parameter must be an array or an object that implements Countable in /var/www/wikindx5/core/modules/basket/BASKET.php on line 98

     
  • Stéphane Aulery

    Hi Joachim,

    I fixed all warnings except:

    PHP Warning: A non-numeric value encountered in /var/www/wikindx5/core/bibcitation/BIBFORMAT.php on line 736

    It seems impossible. This code is not reachable if the condition needed to trigger the error is fulfilled because a guard prevents this exact case.

    Either this error was found on a previous version of Wikindx or the application was in a particular state, during your PHP migration maybe. If this error does not appear again in the logs I think that it should not be taken into account.

    Regards,

     
  • Joachim

    Joachim - 2019-08-30

    Most error messages seems to have vanished with SVN trunk r2825 in place, but just now this one popped up again (I've caught the SQL statement):

    [query] SELECT `resourceId`, `creatorSurname`, `resourceType`, `resourceTitle`, `resourceSubtitle`, `resourceShortTitle`, `resourceTransTitle`, `resourceTransSubtitle`, `resourceTransShortTitle`, `resourceField1`, `resourceField2`, `resourceField3`, `resourceField4`, `resourceField5`, `resourceField6`, `resourceField7`, `resourceField8`, `resourceField9`, `resourceNoSort`, `resourceTransNoSort`, `resourceIsbn`, `resourceBibtexKey`, `resourceDoi`, `resourcetextId`, `resourcetextNote`, `resourcetextAbstract`, `resourcetextUrls`, `resourcetextUrlText`, `resourcetextEditUserIdNote`, `resourcetextAddUserIdNote`, `resourcetextEditUserIdAbstract`, `resourcetextAddUserIdAbstract`, `resourceyearId`, `resourceyearYear1`, `resourceyearYear2`, `resourceyearYear3`, `resourceyearYear4`, `resourcepageId`, `resourcepagePageStart`, `resourcepagePageEND`, `resourcesummaryId`, `resourcesummaryQuotes`, `resourcesummaryParaphrases`, `resourcesummaryMusings`, `resourcetimestampId`, `resourcetimestampTimestamp`, `resourcetimestampTimestampAdd`, `publisherId`, `publisherName`, `publisherLocation`, `publisherType`, `collectionId`, `collectionTitle`, `collectionTitleShort`, `collectionType`, `usersId`, `usersUsername`, `usersFullname`, `resourcemiscId`, `resourcemiscCollection`, `resourcemiscPublisher`, `resourcemiscField1`, `resourcemiscField2`, `resourcemiscField3`, `resourcemiscField4`, `resourcemiscField5`, `resourcemiscField6`, `resourcemiscTag`, `resourcemiscAddUserIdResource`, `resourcemiscEditUserIdResource`, `resourcemiscAccesses`, `resourcemiscMaturityIndex`, `resourcemiscPeerReviewed`, `resourcemiscQuarantine`, `resourcemiscAccessesPeriod`, `resourcecreatorCreatorSurname` FROM wkx_resource LEFT OUTER JOIN wkx_resource_misc ON `resourcemiscId` = `resourceId` LEFT OUTER JOIN wkx_resource_creator ON `resourcecreatorResourceId` = `resourceId` LEFT OUTER JOIN wkx_creator ON `creatorId` = `resourcecreatorCreatorId` LEFT OUTER JOIN wkx_resource_timestamp ON `resourcetimestampId` = `resourceId` LEFT OUTER JOIN wkx_resource_year ON `resourceyearId` = `resourceId` LEFT OUTER JOIN wkx_resource_text ON `resourcetextId` = `resourceId` LEFT OUTER JOIN wkx_resource_page ON `resourcepageId` = `resourceId` LEFT OUTER JOIN wkx_resource_summary ON `resourcesummaryId` = `resourceId` LEFT OUTER JOIN wkx_resource_metadata ON `resourcemetadataResourceId` = `resourceId` LEFT OUTER JOIN wkx_publisher ON `resourcemiscPublisher` = `publisherId` LEFT OUTER JOIN wkx_collection ON `resourcemiscCollection` = `collectionId` LEFT OUTER JOIN wkx_users ON usersId = CASE WHEN (`resourcemiscEditUserIdResource` IS NOT NULL) THEN (`resourcemiscEditUserIdResource`) ELSE (`resourcemiscAddUserIdResource`) END WHERE (`resourceId` IN (,1361,1423,1540,1745,2012,2055,2118,2229,2298,2431,2579,2592,2643,2748,2867,2921,2964,2989,3066,3071,3164,3274,3312,3444,3447,3536,3661,3665,3675,3740,3784,3825,3834,4027,4043,4091,4105,4139,4212,4228,4282,4299,4504,4506,4507,4508,4515,4670,4771,4798,4800,4826,4923,4924,5004,5013,5103,5106,5299,5507,5509,5580,5581,5630,5640,5686,5714,5772,5862,5893,6044,6046,6072,6216,6305,6319,6438,6439,6440,6441,6442,6514,6566,6582,6620,6623,6629,6631,6704,6784,6853,6939,6976,7025,7082,7118,7146,7168,7184,7241,7277,7350,7444,7501,7597,7716,7729,7730,7809,7817,7896,7909,8017,8024,8031,8038,8051,8056,8063,8148,8167,8189,8242,8328,8368,8406,8458,8521,8622,8631,8634,8638,8649,8665,8794,8840,8841,8845,8876,8899,8916,8917,8918,8919,8941,9050,9074,9077,9078,9080,9089,9099,9114,9202,9209,9210,9211,9212,9213,9220,9223,9226,9323,9346,9383,9406,9408,9409,9422,9476,9617,9665,9666,9793,9920,9925,9927,9954,9959,9991,10041,10054,10056,10057,10061,10113,10168,10368,10378,10393,10406,10425,10455,10513,10586,10588,10594,10596,10717,10723,10761,10795,10801,10933,10940,10992,10999,11057,11063,11075,11115,11145,11149,11192,11197,11204,11211,11242,11244,11276,11463,11475,11481,11523,11599,11623,11634,11635,11756,11774,11814,11886,11966,11973,11989,12107,12130,12139,12151,12188,12217,12241,12242,12243,12311,12335,12383,12387,12422,12423,12425,12518,12572,12583,12597,12599,12615,12661,12665,12684,12706,12735,12737,12753,13014,13093,13100,13117,13166,13237,13246,13528,13534)) GROUP BY `resourceId` ORDER BY `resourcetimestampTimestamp` DESC, IF(`resourcecreatorCreatorSurname` IS NOT NULL, `resourcecreatorCreatorSurname`, `resourceTitleSort`) DESC, `resourceTitleSort` DESC LIMIT 0, 100
    
    Fatal error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '1361,1423,1540,1745,2012,2055,2118,2229,2298,2431,2579,2592,2643,2748,2867,2921,' at line 1 in /var/www/wikindx5/core/sql/SQL.php on line 2839
    

    Thanks for your work, well done!
    Joachim

     
    • Stéphane Aulery

      It's because th e IN clause is malformed (one comma before the first number).

      JOIN wkx_users ON usersId = CASE WHEN (resourcemiscEditUserIdResourceIS NOT NULL) THEN (resourcemiscEditUserIdResource) ELSE (resourcemiscAddUserIdResource) END WHERE (resourceIdIN (,1361,1423,1540,1

       
    • Mark Grimshaw

      Mark Grimshaw - 2019-08-31

      What were you attempting to do Joachim?
      Mark

       
      • Joachim

        Joachim - 2019-08-31

        This happens when I click on certain keywords via the details view. The same keyword searched via Advanced Search gives no problem.

        Best
        Joachim

         

        Last edit: Stéphane Aulery 2019-09-03
    • Stéphane Aulery

      Since you have not had another problem for 3 months I consider that the problem is corrected. If there are other errors open a new bug because it is already very long. Thanks.

       
  • Mark Grimshaw

    Mark Grimshaw - 2019-09-01

    OK. I can't duplicate it but think I have a fix in place to ensure it does not occur. Can you check please Joachim?

    Regards,

    Mark

     
    • Joachim

      Joachim - 2019-09-03

      Sorry, same message as before. Could it simply be, that some of my records are in some ways corrupted, missing fields or something like that?

      Best
      Joachim

       

      Last edit: Stéphane Aulery 2019-09-03
  • Mark Grimshaw

    Mark Grimshaw - 2019-09-03

    Hi Joachim,

    Thanks for your patience on this.

    It could be that you have a stored SQL session that needs deleting so first try to log off then on again.

    If that doesn't fix it, can you send the URL of the page that causes the problem so that I can see if there is anything unusual?

    Regards,

    Mark

     

Log in to post a comment.

Auth0 Logo