On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • On future releases of Evo I wonder if E_DEPRECATED error reporting should be disabled by default, see: http://forums.modx.com/index.php/topic,37293.0.html

    I use the PieX extra on one site which uses PHP 5.3.21, and within 24hours it can log 200MB of errors into the database although it runs fine to the end user. I don't know if other older extras have a similar problem

    Maybe E_DEPRECATED error reporting should be enabled in RC versions but disabled for production releases. There might be a very good reason why this wouldn't a good idea but can't think of one at the moment.
    • Thanks for your suggestion.

      New config in Evo1.0.9

      Tools->System configuration->User
      "Detection level of the PHP error"

      How about this?
      • Thanks yama hadn't realised that, another excellent addition to Evo.

        I see that it is set to "Ignore the warning of a slight notice level" by default, this should have prevented the deprecated error from logging however it didn't. Perhaps that's because I was using an existing config file.
        • "Notice" is not the same as "Deprecated". There's also "Warning" before you get to the actual fatal errors. It's much better to fix any deprecated functions; the PHP documentation usually has excellent suggestions on equivalent substitutions.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
          • Yes I totally agree but sadly PieX was written by people far clever than myself. I did have a go though but only succeeded in taking my entire site down!
            • My apologies, I had not looked closely at that new System Setting; the setting in question does suppress Notice, Warning and Deprecated error messages. However, this won't stop it from actually logging the errors; nothing can do that. It only stops it from being displayed to the user on-screen.

              That's why I don't like "clever" code. I'd rather have an extra two or three lines of code than have it so "clever" that nobody else can do anything with it.

              I've never used PieX; can you post the actual error so that I can see the line numbers of the offending function? I might be able to provide a fix from that.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
              • Thank you Susan that very good of you. A typical error is:

                Undefined property: DocumentParser::$mstart
                « MODX Parse Error »
                MODX encountered the following error while attempting to parse the requested resource:
                « PHP Parse Error »
                PHP error debug
                Error : 	Assigning the return value of new by reference is deprecated
                ErrorType[num] : 	DEPRECATED[8192]
                File : 	[HIDDEN}/assets/snippets/simplepie/simplepie.inc
                Line : 	5866
                Source : 	$categories[] =& new $this->item->feed->category_class($this->sanitize($category['data'], SIMPLEPIE_CONSTRUCT_TEXT), null, null);
                Basic info
                REQUEST_URI : 	/robots.txt
                Resource : 	[1]Home
                Current Snippet : 	pieX
                Current Plugin : 	PHx(OnParseDocument)
                Referer : 	
                User Agent : 	Mozilla/5.0 (compatible; Ezooms/1.0; ezooms.bot@gmail.com)
                IP : 	208.115.111.68
                Parser timing
                MySQL : 	0.0974 s (287 Requests)
                PHP : 	0.6670 s
                Total : 	0.7644 s


                simplepie.inc is throwing up the most errors, for example on lines: 5453, 5214, 5858, 5862, 5866, 5914, 5936, 5941, 5945, 5997, 6019, 7654, 7796 and many more

                simplepie_hatena.inc is showing an error on line 210

                In the space of just 8 minutes, 19 pages full of Systems Events were recorded for PieX alone on a rarely visited site. My fix was to change all the '=&' to '=' but that caused the site to crash not surprisingly!
                • With those particular errors, all you have to do is remove that & in front of the new declaration indicated by the line number.
                  $categories[] = new $this->item->feed->

                  That should not have caused any problems; all "new" declarations are by reference by default, so the & is now redundant.
                  [ed. note: sottwell last edited this post 8 years, 1 month ago.]
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                  • That's great, thank you! All of the errors are gone. [ed. note: randall last edited this post 8 years, 1 month ago.]