Integrations: Fatal error: Call to a member function getId()
mr117119
Joined: 2009-12-22
Posts: 1 |
![]() |
hi, I have member system,and I want my member logging Automatically, Fatal error: Call to a member function getId() on a non-object in /srv/www/htdocs/new_web/album.php on line 37 could you help me? what can I do? my code: $ret = GalleryEmbed::init( array ('g2Uri'=>'/album/main.php', 'embedUri'=>'/album.php', 'fullInit'=>'false')); if (isset($_GET['username'])){ // if we get a username $GL_uid=$_GET['username']; $ret2 = GalleryEmbed::isExternalIdMapped($GL_uid, 'GalleryUser'); if ($ret2 && $ret2->getErrorCode() & ERROR_MISSING_OBJECT) { //gallery don't have these username if ($ret3) { } else { list($ret, $user) = GalleryCoreApi::fetchUserByUsername($GL_uid); } }else{ //gallery already have these username list($ret, $user) = GalleryCoreApi::fetchUserByUsername($GL_uid); } } $g2data = GalleryEmbed::handleRequest(); |
|
suprsidr
![]()
Joined: 2005-04-17
Posts: 8339 |
![]() |
you need to check $ret when you call list($ret, $user) = GalleryCoreApi::fetchUserByUsername($GL_uid); list($ret, $user) = GalleryCoreApi::fetchUserByUsername($GL_uid); if ($ret){ there was an error fetching the user lets create one instead } $g2uid = $user->getId();
-s |
|