Jump to content
MakeWebGames

Errors - Undefined properties


Canjucks

Recommended Posts

Hey all just looking to see if someone can enlighten me to the solution here. I have found thebelow errors and trying to understand how to fix it but also know how to in the future when these pop up again:

["E_RECOVERABLE_ERROR","Undefined property: stdClass::$R_exp","/modules\/installed\/levels\/levels.hooks.php",7,"2021-01-24 11:15:37"]
["E_RECOVERABLE_ERROR","Undefined property: stdClass::$R_name","\/class\/user.php",342,"2021-01-24 11:15:37"]

 

Code in question - levels.hooks.php:

<?php

    new Hook("userInformation", function ($user) {
        global $page;
        if ($user) {
            $nextRank = $user->nextRank();
            if ($user->info->US_exp > $nextRank->R_exp) { <-- line has issue
                   $page->addToTemplate("levelUp", true);
            } else {
                   $page->addToTemplate("levelUp", false);
            }
        }
    });

 

User,php:

 

            $page->addToTemplate('maxRank', $this->info->maxRank);
            $page->addToTemplate('rank', $rank->R_name);
            @$page->addToTemplate('exp_perc', $expperc);
            $page->addToTemplate('gang', $gang);
            $page->addToTemplate('weapon', $weapon->I_name);
            $page->addToTemplate('armor', $armor->I_name);
            $page->addToTemplate('nextRank', $this->nextRank->R_name); <-- line has issue 
            
        }

TIA

*** UPDATED ***

So now getting the below issue with the effected lines. I don't think I had this locally though so probably not unexpected I suppose:

["E_RECOVERABLE_ERROR","Undefined property: home::$allowedMethods","/class\/module.php",72,"2021-01-24 11:37:09"]
["E_RECOVERABLE_ERROR","Invalid argument supplied for foreach()","/class\/module.php",86,"2021-01-24 11:37:09"]

Line 72 of Module

        private function buildMethodData() {
        
            $data = $this->allowedMethods; <-- line has issue

Line 86 of Module:

           foreach ($data as $key => $val) {

Edited by Canjucks
Link to comment
Share on other sites

2 minutes ago, AdamHull said:

It doesn't look as tho you are calling the correct names, i would look in the rank class or database and see what it should be calling, I'm not fully aware of how this engine works

It's not my code I can say lol ... maybe the creator can shed the light on it @Dayo?

Link to comment
Share on other sites

On 1/24/2021 at 10:26 PM, Canjucks said:

Hey all just looking to see if someone can enlighten me to the solution here. I have found thebelow errors and trying to understand how to fix it but also know how to in the future when these pop up again:


["E_RECOVERABLE_ERROR","Undefined property: stdClass::$R_exp","/modules\/installed\/levels\/levels.hooks.php",7,"2021-01-24 11:15:37"]
["E_RECOVERABLE_ERROR","Undefined property: stdClass::$R_name","\/class\/user.php",342,"2021-01-24 11:15:37"]

 

Code in question - levels.hooks.php:

<?php

    new Hook("userInformation", function ($user) {
        global $page;
        if ($user) {
            $nextRank = $user->nextRank();
            if ($user->info->US_exp > $nextRank->R_exp) { <-- line has issue
                   $page->addToTemplate("levelUp", true);
            } else {
                   $page->addToTemplate("levelUp", false);
            }
        }
    });

 

User,php:

 

            $page->addToTemplate('maxRank', $this->info->maxRank);
            $page->addToTemplate('rank', $rank->R_name);
            @$page->addToTemplate('exp_perc', $expperc);
            $page->addToTemplate('gang', $gang);
            $page->addToTemplate('weapon', $weapon->I_name);
            $page->addToTemplate('armor', $armor->I_name);
            $page->addToTemplate('nextRank', $this->nextRank->R_name); <-- line has issue 
            
        }

TIA

I haven't found an answer yet.  i emptied my minor error log and its filling up each time you click with both those errors. It was upto a 2 meg + file....

Link to comment
Share on other sites

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.   Paste as plain text instead

  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...