I have several errors in my error-log, but I have no idea where they are coming from.
What modules/packages are causing the errors? All I see i a reference to (ERROR @ /index.php)
Any suggestions??
(ERROR @ /index.php) `[[+id]]` is not a valid integer and may not be passed to makeUrl()
and
(ERROR @ /index.php) Error 42S22 executing statement:
Array
(
[0] => 42S22
[1] => 1054
[2] => Unknown column 'modResource. pagetitle' in 'where clause'
)
Thanks for the answer, but that's the easy part.
I have many snippets, with even more templates and chunks(tpl's). Finding out what snippet, chunk or template has the error is what I am looking for.
Just e reference to /index.php is way to general to start debugging....
-
☆ A M B ☆
- 183 Posts
Debugging template is somewhat challenging ...
I start with checking what page/resource that generate the error. Next I duplicate the template used in that resource and create a new resource for that 'newly duplicated' template. Then I try to locate the error by removing/editing some part of 'newly duplicated' template.
zaenal.lokamaya
There is an extra called "Janitor" which has a tool that allows one to search for strings in any resource\snippet etc etc. I use it sometimes when i am searching for example in your case "[[+id]]" it will list you all elements and resources that contain that string. Might help you. However
The index.php error seems to be an error in some SQL qry statement:
$query->where(array(
'parent:IN' => array(2),
'deleted' => false,
'hidemenu' => false,
'published' => true
));
Somewhere you got a statement similair to above that contains pagetitle, and there seems to be an error. I would try to look for $query->where string in janitor and then maybe you will find it.
Quote from: gallenkamp at Dec 19, 2012, 08:17 PMMaybe this helps: http://modx.im/blog/addons/244.html
That plugin is not available via the Package Manager. Is it production-quality? And dare I ask - do you have usage instructions in English?
Spacibo!
Loved ModX when I was using it a few years ago. Shifted to WordPress, sorry. Thanks, all.
-
☆ A M B ☆
- 1,780 Posts
I ran it through translation, here's the text.
Also, you'll find lots of fabulous packages that aren't in package management. Authors have to actually submit it and not everyone does. Shrug...
If you're concerned, install MODX locally or maybe on a dev subfolder and try packages there before you install them into your production site.
I'm gonna see how this one works myself. No Fear! (omg I just recalled that my brother actually tattooed that on his arm in 1988!)
Hooray, finally MODX Revolution can actually see the debug information.
Thank you very much user Agel_Nash , a link to the tool.
I will not drag out.
Enlargement itself on github
1) Download to your website and collect the package. For those who find it difficult to gather, there is a link to download the package itself .
2) Go to the package manager, search locally, and set debugtoolbar
3) Open the file core / xpdo / xpdo.class.php (around line 2952 (in my 2.3.0-dev line 2996)
and
try { $this->pdo= new PDO($this->config['dsn'], $this->config['username'], $this->config['password'], $this->config['driverOptions']); $errorCode= $this->pdo->errorCode(); } catch (PDOException $xe) { $this->log(xPDO::LOG_LEVEL_ERROR, $xe->getMessage(), '', __METHOD__, __FILE__, __LINE__); return false; } catch (Exception $e) { $this->log(xPDO::LOG_LEVEL_ERROR, $e->getMessage(), '', __METHOD__, __FILE__, __LINE__); return false; }
is replaced by the
$PDOClass = $this->xpdo->getOption('pdo_class'); if (empty($PDOClass)){ $PDOClassname = 'PDO'; }else{ $this->xpdo->loadClass($PDOClass, MODX_BASE_PATH, true); $pos= strrpos($PDOClass, '.'); if ($pos === false) { $PDOClassname = $PDOClass; } else { $PDOClassname = substr($PDOClass, $pos +1); } } try { $this->pdo= new $PDOClassname($this->config['dsn'], $this->config['username'], $this->config['password'], $this->config['driverOptions']); } catch (PDOException $xe) { $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, $xe->getMessage(), '', __METHOD__, __FILE__, __LINE__); return false; } catch (Exception $e) { $this->xpdo->log(xPDO::LOG_LEVEL_ERROR, $e->getMessage(), '', __METHOD__, __FILE__, __LINE__); return false; }
4) If desired, the system settings, you can disable DebugToolbar.
Everything is ready.
Just to mention a few other methods, you can disable plugins by right-clicking on them in the tree and disable snippets by putting a space between the opening brackets (the tag will show, but the snippet won't execute). Then you can re-enable them one-by-one until the error shows up.
If you have a good code editor with a debugger (e.g., PhpStorm), you can make the whole site a project, put a breakpoint in the $modx->log() method (in modx.class.php) in the Error section, and debug the index.php file in the root. That will take you to your front-end and you can wander around. When the error occurs, you'll be popped into the debugger and can examine things. If that doesn't trigger the error, you can debug the index.php in the Manager folder to see if the error occurs in the Manager.
Setting up the debugger can be a major pain (especially if you're doing remote debugging), so the first method is often faster.
The problem is almost certainly in a MODX Extra, unless you've written snippets or plugins of your own, so another way to go is to disable or uninstall Extras until the problem goes away (but first, try updating all your Extras to the current version).