Saving page-node with class and method callback fails.

GabrielVH

Member
I originally posted in this thread: http://xenforo.com/community/thread...-a-callback-for-pages.7226/page-5#post-498765

--

I know this is an old thread, but I can't find anything else (unless someone has a link?).

I've got my class setup in /library/PGMemberList/PageCallback/Members.php and I'm just using the example code from the video at the moment, modified with my class name:

Code:
<?php
 
class PGMemberList_PageCallback_Members {
 
  public static function respond(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract $response)
 
    $userModel = $controller->getModelFromCache('XenForo_Model_User');
    $response->params['users'] = $userModel->getLatestUsers(array(), array('limit' => 5));
 
    $response->templateName = 'pgmember_list';
  }
 
}

My template file just has a foreach loop of the user title as in the video.

But I can't save the page in the ACP when I enter the class name and method? Looking at the XHR request the page makes, the server responds with Internal Server Error 500.
I've also edited the database page entry with my class name and method, but then the resulting page node just shows up blank. Even with debug mode on for my IP Address I don't get any information about the error.

Any ideas?
 
I originally posted in this thread: http://xenforo.com/community/thread...-a-callback-for-pages.7226/page-5#post-498765

--

I know this is an old thread, but I can't find anything else (unless someone has a link?).

I've got my class setup in /library/PGMemberList/PageCallback/Members.php and I'm just using the example code from the video at the moment, modified with my class name:

Code:
<?php
 
class PGMemberList_PageCallback_Members {
 
  public static function respond(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract $response)
 
    $userModel = $controller->getModelFromCache('XenForo_Model_User');
    $response->params['users'] = $userModel->getLatestUsers(array(), array('limit' => 5));
 
    $response->templateName = 'pgmember_list';
  }
 
}

My template file just has a foreach loop of the user title as in the video.

But I can't save the page in the ACP when I enter the class name and method? Looking at the XHR request the page makes, the server responds with Internal Server Error 500.
I've also edited the database page entry with my class name and method, but then the resulting page node just shows up blank. Even with debug mode on for my IP Address I don't get any information about the error.

Any ideas?
Do you have your file saved under:
/library/PGMemberList/PageCallback/Members.php

What options do you actually have in your page? What error do you get? An actual error from XenForo?
 
Yup, the class file is here:
/library/PGMemberList/PageCallback/Members.php

The Members.php code is as I posted above, and the template simply contains:

Code:
<xen:require css="page.css" />
 
<xen:foreach loop="$users" value="$user">
{xen:helper usertitle, $user}
</xen:foreach>

There isn't any displayed error - XenForo doesn't even show the "Please enter valid class name" error. When you click Save, the form submits but there is no success message.
The server just has an Internal Error.
 
Yup, the class file is here:
/library/PGMemberList/PageCallback/Members.php

The Members.php code is as I posted above, and the template simply contains:

Code:
<xen:require css="page.css" />
 
<xen:foreach loop="$users" value="$user">
{xen:helper usertitle, $user}
</xen:foreach>

There isn't any displayed error - XenForo doesn't even show the "Please enter valid class name" error. When you click Save, the form submits but there is no success message.
The server just has an Internal Error.
This appears to be more of an issue with your server failing to display templates/save-multiple.json, versus an actual programming error. What add-ons do you have installed on your site?
 
Back
Top Bottom