Cakephp Plugin errors on live site, but not localhost site - php

I have two cakephp sites setup for the same site. One is my local version which I develop on, one is the live one.
I installed a User management plugin on both apps, and it works on my localhost site, but not on the live site.
I get this error on the live site:
Fatal error: Call to undefined function usermgmtinit() in /home2/collehn6/public_html/devcr12/app/Plugin/Usermgmt/Controller/Component/UserAuthComponent.php on line 53
The line in question is:
UsermgmtInIt($this);
I tried changing this line to:
$this->UsermgmtInIt();
And that just game me another error. Why is it working on my local site, but not on the live site?

The plugin you're referring to expects you to load its bootstrap file which contains:
function UsermgmtInIt(&$controller) {
...
As such the problem is probably that in your application you're loading the plugin like so:
CakePlugin::load('Usermgmt');
Wheras it needs to be loaded like so:
CakePlugin::load('Usermgmt', array('bootstrap' => true));
Check the Readme if that doesn't immediately solve the problem.
It should be no surprise that changing code to be fundamentally different doesn't make it work.

Related

Wordpress Call to a member function set_return_url() on a non-object

I have an error in a fresh Wordpress installation. Everytime I click on "Design -> Customize" I receive this error:
Call to a member function set_return_url() on a non-object in \wp-admin\customize.php on line 28
I have tested it with Wordpress version 4.5 and 4.6.1, and always got the same result.
I installed it local with XAMPP, first with the URL "localhost:8080" then with the URL "localhost.local". Everything works fine, instead of the click to customize...
Has someone had a similar error in the past?
If your site works fine on localhost or 127.0.0.1, but error occur on sever, you can try to update the WordPress permalinks (Settings->Permalinks).
If you have you edited any line of code in the theme you use - revert back changes.
Also you can try to switch and use the other old default WordPress theme(s) like TwentyFifteen for example, in order to see if it works fine. Then try once by switching the theme to default WordPress theme.

Magento can't login Admin panel error 500

I have a live running website developed using magento (1.8.1.0). The frontend is working fine but (from this morning) when I try to log in the admin panel I get the "http error 500" even if I use a wrong password or username.
Foreach login attempt the magento error log reports:
mod_fcgid: stderr: PHP Fatal error: Call to a member function
loadByUsername() on a non-object in
$MAGENTO_ROOT/httpdocs/includes/src/Mage_Admin_Model_User.php on line 408
the corresponding code in Mage_Admin_Model_User.php is:
406> public function loadByUsername($username)
407> {
408> $this->setData($this->getResource()->loadByUsername($username));
409> return $this;
410> }
I have just deleted the cache and session directories but the problem remains.
what could have happened ? how can I fix it ?
(from this morning)
Was there any update on server (hosting)? I would try to search on official Magento site if it is a common bug (other users can face it after update too)
Test copy of installation (ftp + db) on different server (hosting) in order to see if the problem persists.
Try to Google it similar to this ($MAGENTO_ROOT/httpdocs/includes/src/ is your site specific so Google will find nothing relevant):
loadByUsername() on a non-object in Mage_Admin_Model_User.php on line
408
Thank's all for the contribute, the problem is solved. It was very sneaky.
I've found in the directory app/code/core/Mage/ the directory "Admin" renamed as "Admin " (Admin with 2 spaces). Moreover this files were missing: app/code/core/Mage/Admin/etc/config.xml and app/code/core/Mage/Admin/Helper/Data.php.
After renaming the directory, restoring files, deleting cache and session, the problem is solved.
It was probably originated by a cache update in Cache Management section.

CakePHP : REST API 404 Error

I have build a REST server and trying to make my java application communicate to it.
But I keep getting a 404 error.
When I type in the url in my browser along with the function name like:
[url]/controller/functionname/1.json
it works fine, returning me the right data.
Without the function name:
[url]/controller/1.json
I get this error:
"action 1.json not defined in controller".
I've checked my .htaccess file and routes against a previous version I had build which was working just fine. I can't figure out what the problem might be. Any suggestions?
And oh, I should mention, the earlier version that I talked about was build on windows and this one on ubuntu.

Magento Fatal Error: Class 'Zend_Log' not found

With a module I added an custom customer attribute.
When a client is logged in and want to edit their account information or want to change their password on frontend the following error comes up:
Fatal error: Class 'Zend_Log' not found in /app/code/community/Amar/Profile/Model/Customer/Attribute.php on line 49
I build this website local and uploaded it to the server.
On the local environment this error is not showing up, this error only showing up on the server.
I think it has to do something with file permissions.
Does anyone have a solution for this?
the problem has been solved.
On the live server there was another PHP version which was not compatible with the extension.
For me a function loadByCode() causes the issue, I have renamed it and it is working fine. We should not use generic method names in custom modules.
The function is in \app\code\community\Amar\Profile\Model\Customer\Attribute.php file.

Call to undefined method sfApplyApplyForm::isCaptchaEnabled

I’m getting a funny error after I deploy a fully working symfony project to my web host (hostgator). Everything works fine on my localhost.
Here’s the error:
500 | Internal Server Error | sfException
Call to undefined method sfApplyApplyForm::isCaptchaEnabled.
Here’s what I’m using:
Symfony 1.4
Doctrine 2.0
sfForkedDoctrineApplyPlugin - for
registering new users with:
sfDoctrineGuardPlugin - for
authentication
I get the error when I click the “Register” link.
Obviously, the form is Captcha enabled. I’ve tried turning it off in config/app settings with no change in error. I’ve also confirmed that my public and private keys are correct and registered... I’ve even updated them with no change in error msg.
A search on Google brings up nothing helpful.
Any ideas about where to begin troubleshooting?
To correct this problem I just copied the isCaptiaEnabled() method from the plugin to the model class where I embedded the plugin form. I believe I had to also copy a couple of other methods over as well. But as soon as I did that, the errors never came back.

Categories