<![CDATA[ help troubleshooting "Warning: constant(): Couldn't find constant 32759 in ... modx/core/model/modx/modx.class.php on line 690" - My Forums]]> https://forums.modx.com/thread/?thread=104914 <![CDATA[help troubleshooting "Warning: constant(): Couldn't find constant 32759 in ... modx/core/model/modx/modx.class.php on line 690"]]> https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564126
I just upgraded a neglected site from modx 2.1.6 to 2.7.0. I was getting some php errors before the upgrade that left the front end up, but the manager broken. I found out my shared host upgraded their php, which may have triggered the issues. I backed up my site and did the upgrade. It went smoothly, and everything works fine now, except I get the error: "Warning: constant(): Couldn't find constant 32759 in /home1/mysite/modx/core/model/modx/modx.class.php on line 690" at the top of all of my public pages.

I suspect this is because there have been so many revisions since 2.1.6 and my database probably didn't quite match up.
My only addons are wayfinder and spform. Both are up to date.

cPanel 70.0 (build 66)
Apache 2.2.34
PHP 7.0.33
MySQL 5.6.41-84.1
Perl 5.26.0

What can I do to fix this?

Thanks,
-Dan]]>
danlanphear Feb 18, 2019, 04:42 PM https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564126
<![CDATA[Re: help troubleshooting "Warning: constant(): Couldn't find constant 32759 in ... modx/core/model/modx/modx.class.php on line 690"]]> https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564334 BobRay Mar 07, 2019, 09:32 PM https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564334 <![CDATA[Re: help troubleshooting "Warning: constant(): Couldn't find constant 32759 in ... modx/core/model/modx/modx.class.php on line 690"]]> https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564328
I had not attempted any of the changes we discussed above just yet, however, I found out my spform wasn't working.

While checking into it, I discovered my property set for spform had been lost. I uninstalled spform, downloaded a new copy, reinstalled it, and reset all my properties. spForm started working properly again, and I immediately noticed my php error from before also disappeared. My whole site seems fine now.

I figured I would post this just to say that I apparently did upgrade from 2.1 straight to 2.7 without any major hiccups, and that the database does seem to be working fine, except that my spform was busted. However, I suspect that may have actually happened prior to the actual modx upgrade, because I made sure to upgrade spform and wayfinder before I upgraded the rest of modx, but I never actually retested the form. So, I probably lost the property set before the upgrade.

Hopefully, this helps someone else.]]>
danlanphear Mar 07, 2019, 05:51 PM https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564328
<![CDATA[Re: help troubleshooting "Warning: constant(): Couldn't find constant 32759 in ... modx/core/model/modx/modx.class.php on line 690"]]> https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564272
I can understand why you don't want to revert the site, but at least check the DB for the fields listed here and add them if they're missing: https://bobsguides.com/blog.html/2016/06/27/missing-db-fields-(unknown-column)/.

]]>
BobRay Feb 28, 2019, 10:32 PM https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564272
<![CDATA[Re: help troubleshooting "Warning: constant(): Couldn't find constant 32759 in ... modx/core/model/modx/modx.class.php on line 690"]]> https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564268
It's not going to be practical for me to roll the site back to 2.1 again and install all those between versions just for the sake of this minor error message. Everything else about the site seems fine. But, the error message is bothering some users, so I'd like to try a band-aid fix.

As I mentioned before, setting debug to 0 in the manager had no effect.

Is it feasible for me to tweak the class constructor somehow, like by changing the code to "is_numeric()", or to set a default in the constructor's debug section as you suggested?

I'm not really a programmer. I have some basic training in c++, so I understand the concepts you're talking about here, but honestly, solving it myself is above my pay grade. I'm just going to end up copy/pasting whatever you tell me to see if it works or not.

Thanks,
-Dan]]>
danlanphear Feb 28, 2019, 07:00 PM https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564268
<![CDATA[Re: help troubleshooting "Warning: constant(): Couldn't find constant 32759 in ... modx/core/model/modx/modx.class.php on line 690"]]> https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564173
$debug = (is_int($debug) ? $debug : defined($debug) ? intval(constant($debug)) : 0);
if ($debug) {
   error_reporting($debug);
   parent :: setLogLevel(xPDO::LOG_LEVEL_INFO);
}


This happens in the modX class constructor:

$debug = $this->getOption('debug');
if (!is_null($debug) && $debug !== '') {
   $this->setDebug($debug);
}


As I read it (the double ternary operators make it difficult to read), $debug is coming through as a string. Because it's a string, it fails the is_int(), test so defined($debug) executes. If the number in the debug System Setting is not a defined constant, the error gets thrown. It shouldn't, imo, because error_reporting() accepts a bitmask, so any integer, defined or not, should be allowed, and the description of the debug setting says any valid integer will work.

Maybe the is_int() should be is_numeric(), which would pass a numeric string.

Or maybe it should be this in the constructor:

$this->setDebug(intval($debug));


Another issue is that in the xPDO getOption() method, if the key is not a string or an array, the default value is returned. But the getOption() call in the modX constructor's debug section has no default.

]]>
BobRay Feb 20, 2019, 09:45 PM https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564173
<![CDATA[Re: help troubleshooting "Warning: constant(): Couldn't find constant 32759 in ... modx/core/model/modx/modx.class.php on line 690"]]> https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564165 markh Feb 20, 2019, 01:06 PM https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564165 <![CDATA[Re: help troubleshooting "Warning: constant(): Couldn't find constant 32759 in ... modx/core/model/modx/modx.class.php on line 690"]]> https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564131
Thanks Bob]]>
danlanphear Feb 18, 2019, 11:51 PM https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564131
<![CDATA[Re: help troubleshooting "Warning: constant(): Couldn't find constant 32759 in ... modx/core/model/modx/modx.class.php on line 690"]]> https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564129
I think you're immediate problem might be solved by changing the value of the debug System Setting to 0.

I suspect that there will be other problems, though, due to missing database fields added since your old version.]]>
BobRay Feb 18, 2019, 08:50 PM https://forums.modx.com/thread/104914/help-troubleshooting-warning-constant-couldn-t-find-constant-32759-in-modx-core-model-modx-modx-class-php-on-line-690#dis-post-564129