Content Profile Pageroute > Edit Profile fails to render the profile node form, giving the error message

warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'node_form' was given in form.inc on line 376.

I recognized this notorious message from other troubleshooting: node.pages.inc was missing.

Apparently the parent class, PageroutePageEdit, never calls its own setUp function before handing the request off to its subclass.
The attached patch modifies ContentProfilePageEditProfile::setUp to include_once() node.pages.inc, addressing the issue.

Note: if you are not able to reproduce this issue, your drupal site may have already included node.pages.inc -- e.g. if you are rendering any part of a node or a node form in a block or view on the page.

Comments

dragonwize’s picture

Status: Needs review » Needs work

I can confirm this.

You should use module_load_include() instead of include_once() though.

vishun’s picture

Status: Needs review » Needs work

I can also confirm that the above patch and the module_load_include() approach resolves the issue. It would appear that the Pageroute API documentation may need to be updated at http://drupal.org/node/310810

Replacement

  module_load_include('inc', 'node', 'node.pages');
vishun’s picture

Status: Needs work » Needs review
StatusFileSize
new505 bytes
vishun’s picture

Status: Needs work » Reviewed & tested by the community