Yesterday I moved/copied a development site to localhost. The server that it was on, is weird. To say the least. I had upgraded to PHP 5.3 (MODX system info says 5.3.13) in the CGI console and was told that even if it didn't show on their cp server info page that it was indeed upgraded.
On local, I'm running PHP 5.3.8.
So, unless debug is turned off in system settings I see errors on the pages. There is one for bookmarkThis and a huge list of errors for mxCalendar. Both snippets work however.
mxCalendar errors:
Notice: Undefined index: cid in C:\xampp\htdocs\lilocounseling\core\cache\includes\elements\modsnippet\102.include.cache.php on line 180
Warning: Invalid CRT parameters detected in C:\xampp\htdocs\lilocounseling\core\model\modx\filters\modoutputfilter.class.php on line 445
(the above Invalid CRT Parameters error displays multiple times after this, I can't count them...Many many times)
Just above the bookmark this output, I see this:
Notice: Undefined variable: dev in C:\xampp\htdocs\lilocounseling\core\cache\includes\elements\modsnippet\101.include.cache.php on line 34
In modoutputfilter.class.php at line 441 is this:
/* See PHP's strftime - http://www.php.net/manual/en/function.strftime.php */
if (empty($m_val))
$m_val = "%A, %d %B %Y %H:%M:%S"; /* @todo this should be modx default date/time format? Lexicon? */
$value = 0 + $output;
if ($value != 0 && $value != -1) {
$output= strftime($m_val,$value);
} else {
$output= '';
}
break;
If I remove both && from line 444 the manger and front end errors:
Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\lilocounseling\core\model\modx\filters\modoutputfilter.class.php on line 444
Removing one & fixes the front end and manager, yet the Invalid CRT error still shows.
When I remove both &&, the file referenced in the bookmarkThis error disappeared. When I replaced them, it re-loaded in NP++. When I removed them again, it did not disappear (not exist) again.
The file from the bookmarkThis error is as follows:
<?php
function elements_modsnippet_101($scriptProperties= array()) {
global $modx;
if (is_array($scriptProperties)) {
extract($scriptProperties, EXTR_SKIP);
}
/**
* BookmarkThis v1.2.2 pl
*
* Copyright 2011 by Mad About Brighton <[email protected]>
*
*(blah blah all the license stuff was here, I removed it for space reasons)
*
* You should have recieved a copy of the license. If not, it can be viewed by visiting
* http://madaboutbrighton.net/projects/bookmarkthis
*
* @package bookmarkthis
*/
/**
* BookmarkThis for MODx Revolution 2.*+
*
* @package bookmarkthis
*/
$path = ($dev == 1) ? $modx->getOption('base_path') . '/dev/' : $modx->getOption('core_path');
require_once $path.'components/bookmarkthis/model/bookmarkthis/bookmarkthis.class.php';
$mabBookmarkThis = new mabBookmarkThis($modx, $scriptProperties);
$s = $mabBookmarkThis->getBookmarkThis();
unset($mabBookmarkThis);
return $s;
}
Line 27 in the above code seems to be the invalid variable it's calling out. I couldn't find anything in the bookmarkThis.class file for "dev". I honestly don't know what I'm doing... sorry. A PHP class is sounding better and better even if it's not for credit.
The development site in a subfolder on the server doesn't create these errors. My point in moving the site is to prepare to move it again to my server (which is actually running PHP 5.2.17 but apparently I can enable 5.3 in .htaccess if I want) if they can't figure out their path issues at the client server.
Good news is, I'm not seeing any more path errors on local. It did not however solve the problem with fileUpload not finding the upload path. A new thread for that one though.
I can continue with debug off, but it seems wrong to do so. No?