Jump to content

Crazy PHP error


pixelusin

Recommended Posts

I'm running the ELGG Social Networking software and seem to be having a problem with a mod.

 

This is the error message that I am getting when I click on the register link:

 

***

Fatal error: Call to a member function getObjects() on a non-object in /home/content/l/e/s/lesbionix/html/mod/customstyle/start.php on line 70

***

and this is the line in question:

 

***

$customstyle_object = $user->getObjects($metadata_name, 1, 0);

***

 

I get this error when I try and register to the site. I'm running a "siteaccess mod" that allows me to "wall off" the site and require a password. The "customstyle mod" is a mod that allows users to "pimp their profiles." Yeah, I know, one shouldn't have ANYTHING to do with the other, but this is the situation I am having!

 

Any help you all could give me would be greatly appreciated. I posted the question in the ELGG forum and got NOTHING! Hopefully you all can help me!

 

Thanks in advance for the help,

Tami

Link to comment
Share on other sites

  • 2 weeks later...

Maybe I've been asking the question the wrong way? I was hoping someone could tell me what's wrong with this line of code as it pertains to the Customstyle plugin. When I click on the Register  button, I get this error message:

 

Fatal error: Call to a member function getObjects() on a non-object in /home/content/l/e/s/lesbionix/html/mod/customstyle/start.php on line 70

 

And heres line 70 from the Start.php file"

 

$customstyle_object = $user->getObjects($metadata_name, 1, 0); line: 70 

 

This is the rest of that code"

function get_custom_style_from_metadata($user, $metadata_name){

        $returnArray = false;

     

        $user = get_entity($user);

     

line: 70    $customstyle_object = $user->getObjects($metadata_name, 1, 0);

     

        $customConfig = get_metadata_for_entity($customstyle_object[0]->guid);

     

        if($customConfig){

            foreach($customConfig as $metadataObject){

                $returnArray[$metadataObject['name']] = $metadataObject['value'];

            }

        }

     

        return $returnArray;     

    }

 

 

If I disable the CustomStyle plugin the problem goes away.  Any ideas as to what might be the problem?

 

I'd appreciate the help!

Link to comment
Share on other sites

Thorpe,

 

I understand your question but I'm not sure how or where to find the information you are asking about.

 

The error occurs when someone clicks on the Register link. Would that be a place to start looking for the place where $user defined might be?

 

I'm not the most knowledgeable about PHP.

Link to comment
Share on other sites

The following line of code is what appears to be responsible for setting $user to an instance of an object (immediately before the line where the error is occurring) -

$user = get_entity($user);

 

It would take seeing the code in the get_entity() function to be sure, but it may be intentionally returning a FALSE value instead of an object and the main code should be testing for that occurrence instead of blindly using the returned value. It also may be that there is a logic error in the get_entity() function that needs to be fixed.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.