I have successfully connected to a Drupal instance using JSON and even retrieved a node using the service.

Problem is that the node has php content type, and the service returns the raw php content instead of the eventual value.

What am I doing wrong? Is there a work-around to this?

  • Sounds like you need PHP on your web server, you get raw PHP code if there's no PHP interpreter on your webserver. – Beebee Oct 30 '19 at 17:42
  • Hi beebee sorry but seems like I cannot respond to your comment. On a browser, the page displays as expected. Not php code but the actual value – user96935 Oct 30 '19 at 19:37
  • 1
    Don't use PHP text formatter to begin with, that is bad/horrible practice. Do your php logic in a node preprocess function or in a hook. – No Sssweat Oct 30 '19 at 19:46
  • Oh you're storing PHP code in your content/database? If you want that code processed you need to do it on your PHP server I think... Otherwise the PHP code will just get returned as a text content. – Beebee Oct 31 '19 at 12:58

Your Answer

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

Browse other questions tagged or ask your own question.