I wasn’t sure where to put this and I apologize if this is the wrong spot for it but it seems like a possible critical issue.
I put the following line in the source of my home page:
[!NewsListing?startID=`8` &summarize=`5` &truncSplit=`false` &summarize=’99’ &dateformat=’%d-%b-%y %I:%M %p’!]
Obviously, I didn’t notice that summarize was in there twice. When I saved the page, the manager hung (endless "working" message).
After I closed the browser and went back, the entire web site appeared dead. When going to the home page or to the manager login page, nothing appeared on the browser screen (no error messages ... nothing), even after a reboot and a long wait.
I found I could go directly to subsidiary pages at the site but clicking on the home page link hung things again.
I went to my ISP’s CPanel and found no new messages in the error log.
I launched PhpMyAdmin and the database looked fine. I went to the content section for the home page and, in PhpMyAdmin, removed the extra summarize variable. Everything was back to normal.
As a test, I logged on as a manager and re-inserted the summarize variable and everything locked up again. Went to PhpMyAdmin, removed it and everything was back to normal so that was definitely the culprit.
Someone familiar with the core code can probably guess why this little error is so disastrous and I’m not sure if the fix should be in NewsListing or the core (or both) but for the sake of robustness, this kind of coding error probably shouldn’t crash a website and, if it does, it still shouldn’t crash the manager.
Bob
-
MODX Staff
- 12,272 Posts
There’s really not enough info here to really figure out what’s going on ... (might look at the "help us help you" link in my forum sig). But, from the description above, I’m guessing you’re running an older version of the software. I’d personally convert the Newslisting to Ditto 2.0.2 as it’s a lot more robust, and the hung site/blank page sounds like an 0.9.2.x install.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Sorry ... forgot to mention that I’m running 0.9.5 just downloaded a couple of days ago.
It’s running on Apache and the behavior appeared in several browsers (ie6, Opera, FF). It is an upgrade install but there’s no way to know if that’s the problem without someone testing it on a clean intall.
It should be easily to duplicate, just paste this code into a home page and reload it:
[!NewsListing?startID=`8` &summarize=`5` &truncSplit=`false` &summarize=’99’ &dateformat=’%d-%b-%y %I:%M %p’!]
Just be prepared to edit the database file directly to remove the line if everything crashes.
Bob
-
MODX Staff
- 12,272 Posts
In re-looking at your call, you’re using single-quotes and not backticks. That’s your first problem. Second problem is that you should really think about upgrading to Ditto 2.0.2 instead of Newslisting.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
Good eye! I don’t think I ever would have noticed the difference between the backticks and single quotes. After searching for "MODx backtick", I see that I should have read ModX 101. Somehow, in all my reading up on MODx I never ran across that section.
Because of the goofy layout of my Dell keyboard, I’ve reconfigured the backtick as the escape key. I haven’t typed (or been able to type) a backtick in years of coding in C++, php, and SQL. It may take me a while to figure out how to undo it.
Once I fix the backticks, is it worth testing the code again to see if it still causes a problem?
I’ll definitely look into Ditto.
Thanks,
Bob
-
☆ A M B ☆
- 24,524 Posts
I think you can get away without any delimiter at all, as long as there are no spaces in your value. If you’re really desperate, you should be able to copy/paste an existing backtick, or use a utility to insert a selected character.
Thanks again for all your help.
I had forgotten that when I set up the backtick to be the escape key, I did the reverse also (set up my escape key to be a backtick)

.
Bob