Hi everyone
Last night I just put a new site live (very exciting!) The one odd thing that there is some connection between logging in to the manager and php scripts working. Only two scripts (one a chunk for sending an ajax requesting to a database, one an independent php script for sending emails from a contact form) are giving the trouble. The former can be fixed by opening the chunk and saving it, the latter by simply logging in to the manager (and logging out again doesn’t break it.) Logging in seems to fix it for all web clients, which would seem to indicate its not just a cache thing, but I’m not certain.
Does this sound like anything to anyone? Any ideas would be greatly appreciated, as this is on a live site now..!
Thanks,
--Peter
-
MODX Staff
- 730 Posts
I have never heard of a problem like this myself.
What kind of trouble are these scripts giving you?
I’m not sure I understand your scenario, if saving the chunk and logging into the manager fixes the two issues, under what circumstances are they breaking again?
These questions are what I’m not entirely sure on myself. Things were working initially, after a few hours they were broken so last night I fixed them in a slightly puzzled fashion and moved on.. only to find them not working again this morning. Error reporting has been turned off - I just set it on for my file and am waiting for something to break again - for whatever mysterious reason.
-
MODX Staff
- 730 Posts
Is there anything interesting in MODx’s Reports > System Events log?
yes, but nothing having to do with this. (Just an undefined variable in the manager plugin I’ve been working on.)
aha! So the problem has nothing to do with touching the files: When there is a www. prefix, it works, and without it doesn’t. It just sits as nothing happens. Thoughts? Is this IIS being weird? Something with my rewrite rule? (below)
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.71
RewriteEngine On
RewriteBase
# Defend your computer from some worm attacks
RewriteRule ^.*(?:global.asa|default\.ida|root\.exe|\.\.).*$ . [NC,F,O]
RewriteRule ^/manager/.* - [L]
RewriteRule ^/assets/.* - [L]ml$ /modx/index.php?q=$1 [L,QSA]
RewriteRule ^/(.*).html$ /index.php?q=$1 [L,QSA]
-
MODX Staff
- 730 Posts
It’s hard to say - I’d need to see what’s actually going wrong in the request and in the php.
Are you watching things in Firebug and/or using a PHP debugger?
-
MODX Staff
- 730 Posts
I think it’s the same origin policy.
Noticed that jQuery sending OPTIONS type request instead of POST when called via the no-www domain.
http://stackoverflow.com/questions/1099787/jquery-ajax-post-sending-options-as-request-method-in-firefox
Hmm, that would make sense, but at the same time it doesn’t at all.. Wouldn’t the ajax request be sent to the same domain no matter, as its not even specified in the ajax call? Also, for some reason, since my last post, www. stopped working and no prefix started working, as just as soon as I got a rewrite rule made >.<