0

The other day my website suddenly started acting weird. When using the Flag module to flag content, i get a 200 error! The content does get flagged once i refresh the page, but when clicking the flag link i get this error below.

When editing any of my Views, and say i click on the THEME INFORMATION link to modify the theme files i get another 200 error (see image).

When trying to open modal forms, same thing. This problem seems to have come out of nowhere overnight, as my site was ok, i went to sleep, next day problems. Now, i get the error on both my own theme (when say flagging content) and also on the Admin theme (Seven) when say editing a View. So i would guess that its related to a module rather than the theme? Anyone have any idea how i can go about figuring out whats causing this? My JS is not good at all so im beat here, been on this for a few days now :(

Any help would be much much appreciated.

When flagging a content: enter image description here

When editing a View: enter image description here

  • Did you change templates for this view? – misha-from-lviv Aug 24 '14 at 16:14
1

You've made a change somewhere that is adding <?php to the beginning of all responses.

In "When editing a View" above, you can see this <?php at the beginning of the response text. Everything after the <?php is valid JSON and so likely the valid response.

I looked at your home page at http://www.spiritmolecule.com and it also has <?php added to the beginning of the HTML source. This causes the <STYLE> tag to be ignored. <?php<STYLE TYPE="text/css"> gets interpreted as a single unrecognizable tag and so the CSS statement afterwards is displayed as text on the browser.

HTTP=200 normally means OK (no errors) which makes sense since it was able to respond, just it has the junk <?php in front. Of course, in a file processed by PHP, <?php means the file is about to start some PHP code instead of HTML/JSON markup. Did <?php get added to a file NOT processed by PHP (and so <?php is passed thru as response text)?

Only you can know what you did to get <?php added to the beginning of all responses, HTML or JSON. Do you recall any other files that you changed before going to sleep? Since the <?php gets added to many (or all?) responses, it is likely in a common file.

Good luck troubleshooting!

| improve this answer | |
  • Wow thank you so much for the great answer. I purchased a theme from themeforest net website and it was a pre-setup drupal site. The only files i have changed since i got it are the files inside the theme. This extra <?php, in which sort of file would it have to be to be processed in the whole site? Would a theme file do this? Or should i be looking in a module file? – prezaeis Aug 24 '14 at 21:45
  • OMG your an absolute STAR i LOVE YOU. I decided to load up all the module folder and the theme folders in to Sublime and go through each file to find the extra '<?php'... I opened my theme folder and the first file was the template.php and i found that the file was empty apart from a single <?php.. i deleted this and all is fixed!!! WOW thank you – prezaeis Aug 24 '14 at 21:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.