Jump to content

FrontendUserProfile module issue


i3i2uno
 Share

Recommended Posts

Hello, 

I am having a strange issue that I can't quite figure out. I have a frontenduserprofile module setup on my processwire site, and it works flawlessly on a local testing environment, however I keep getting "Fatal error: Exception: Method Page::renderLoginForm does not exist or is not callable in this context" when visiting the site on the live test server. Here is the live page: http://icareforthecure.com/test/donations/

Here is my template code for the page: http://code.stypi.com/i3i2uno/donationsPage.php

And here is the module code: http://code.stypi.com/i3i2uno/frontenduserprofile.php

Any ideas on why the page isn't loading??

Thank you in advance!

Link to comment
Share on other sites

I really wonder why this would work locally cause the hooks you have are wrong and can't work:

$this->addHookAfter('Page::renderLoginForm', $this, 'renderLoginForm');

should be 

$this->addHook('Page::renderLoginForm', $this, 'renderLoginForm');

Edit: Strange as it seems to work with both for me on different installs. Seems it doesn't matter if addHook or addHookAfter, but I thought there were some case where I remember it would throw an error. What PW version do you have on both?

Link to comment
Share on other sites

I think you would also want to make sure the module is really loaded. If you tinkered with the autoload => true at some point you would have to reinstall the module.

You could also make sure with in template

if(!$modules->isInstalled("FrontendUserProfile")){
   echo "is not installed";
}

$modules->get("FrontendUserProfile");
// now it would be loaded
 

Edit:

Something I noticed is that strange ugly $GLOBALS you use

$GLOBALS['baseUrl']."/site/templates/styles/images/loginPic.png

you could just use

wire("config")->urls->templates . "styles/images/loginPic.png";

which will always return correct url. But then I don't understand what your baseUrl should be good for, as you use it also for a redirect.. ? I guess you have pw installed in a subdirectory? But pw urls methods will already include that.

  • Like 1
Link to comment
Share on other sites

Thanks for the Help Soma. Yea I am still getting use to php and processwire. I will definitely nix the use of the $GLOBALS upon final testing. Just using it due to where I am loading the site.

As for the issue. It seems that either addHookAfter or addHook work. It was all an issue with the fact that the FieldtypeSelect.module wasn't loaded or installed correctly. Once that got re-installed all was fine.

Once again thanks for the help! Processwire's forums are great!



Oh and btw, I am using version 2.3.0, just fyi. Not that it probably matters anymore!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...