Bug in cornerstone forms: PHP Action not executing in Cornerstone Forms (Advanced Mode enabled)

Hi,

I’m using Cornerstone Forms with Advanced Mode enabled (confirmed in Settings > Forms). I’ve added a PHP Action to a form, but the code never executes.

What I’ve tried:

  1. Simple test code in the PHP Action field:
throw new Exception( 'PHP Action is running' );

Expected: form error message. Result: form shows success, no error.

  1. File write test:
file_put_contents( ABSPATH . 'support-debug.txt', 'PHP Action fired' );

Expected: file created in WordPress root. Result: no file created.

  1. Confirmed Advanced Mode is enabled in Cornerstone Settings > Forms tab.
  2. Tried deactivating/reactivating plugins and clearing cache.

Setup:

  • Pro Theme (latest version)
  • Cornerstone (latest version)
  • Form uses AJAX submission
  • PHP Action is the first action in the chain
  • WordPress version: [your version]
  • PHP version: [your version]

The PHP Action appears in the action list and I can configure it, but it simply never runs. Other actions (like Redirect) work fine.

Is there an additional requirement to make PHP Actions functional, or could something be blocking execution?

Thanks

I didn’t actually see a form on that page, or I missed it.

I would check that the Temp directory is writable by WordPress. If not you will need to change the directory which we store a temporary PHP file via the filter cs_forms_php_directory. The code you showed in your examples should work fine.

you need to be logged in to actually see a form there. Can you check as a logged in user?

This condition is most likely preventing the action from running. It will hide the entire form, preventing the actions from never running.

Actually it doesn’t, because the form does appear on the front end (to logged in users)

For now, i did take that condition of entirely. Still, the php action is not being performed

hang on. I think it’s executing now

ok i am not sure what the issue was, because i could not imagine the condition being the culprit (for the simple reason that the form was being displayed). But it is working now. Perhaps it was indeed the temp directory not being writable.

Thanks!