4

I am upgrading Drupal 6.26 to Drupal 7. I had a small handful of nodes (a dozen or so) that contained PHP code. After the upgrade, I've found that the <?php tags have been replaced with <!--?php.

I searched the Google but all I found was http://drupal.org/node/1403918. I'm not using the WYSIWYG module though. I am using CKeditor so I followed the advice in post 1 but that didn't resolve the problem.

I have the PHP filter module enabled.

When I try to edit the node, the <?php tags are not HTML comments so I can't fix it that way. How can I fix this?

Edit 1: I don't think CKeditor has anything to do with this actually. I've completed disabled the CKeditor module and I'm still getting issues mentioned above.

Edit 2: I have a script that resets it back to 6.26. When I re-upgraded, the PHP scripts execute before I enable any non-Core modules. I then enabled everything but CKeditor and it fails so I don't think its CKeditor but another module. I will attempt to further diagnose.

  • Do you have PHP as the input format selected for one of these nodes? Is CKEditor actually appearing in place of the textarea for these nodes? – Charlie Schliesser Oct 31 '12 at 13:55
  • CKeditor is appearing for these nodes and they are either PHP code or HTML + PHP. – lokisapocalypse Oct 31 '12 at 20:47
  • Right, and if you click "configure" on those input formats at /admin/config/content/formats/ do they have HTML corrector (Correct faulty and chopped off HTML) enabled? The Drupal 7 site I just looked at has it checked by default on the HTML formats. – Chris Miller Nov 1 '12 at 16:14
  • Neither input has the HTML corrector enabled. – lokisapocalypse Nov 2 '12 at 12:20
3

You don't have to accept this as an answer, but I would recommend not using CKEditor with the PHP input format. In D7's CKEditor module you're able to attach CKEditor to input formats, as opposed to D6 where you specified textfield IDs and paths and such. Therefore, you can just attach CKEditor to the "Filtered HTML" and "Full HTML" input formats and leave PHP alone. I just think it's a bad idea to try and use wysiwyg formatting that contains code like this.

So, my recommendation would be: 1) Disable CKEditor for the PHP input format. 2) Edit the handful of nodes and replace <!--?php with <?php

  • So maybe its not a CKeditor issue after all. I've disabled for those input types as you suggested. When I edit the node after that, the PHP tags appear correctly but when I save, I continue to have that error. – lokisapocalypse Oct 31 '12 at 20:47
  • You have the error on viewing the node or on editing the node? – Charlie Schliesser Oct 31 '12 at 21:08
  • I have the error viewing the node. When I edit the node, the <?php tags appear correctly. – lokisapocalypse Nov 1 '12 at 13:02
3

Disable any additional filters like html corrector on the PHP input format. If it's not caused by CKEditor, it could be this.

  • Thank you for the suggestion but the only filter is the PHP evaluator. – lokisapocalypse Nov 1 '12 at 13:13
1

The issue ended up being with the drupal 7 version of http://drupal.org/project/contemplate. By not enabling that module, my issue was fixed.

Thanks to all who responded!

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.