Thread: Mys 1.3.x Stat/SKill System
View Single Post
  #63  
Old 06-30-2014, 03:10 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 22,285
IntoRain is on a distinguished road
Default

The error is probably because in the file it's supposed to throw an exception if the adoptable has already been clicked. In 1.3.4 all pages are separated into two files: One manages the controller (database accesses and verifications) and the other (in the folder view) manages what is shown to the user. The exchange of variables between these files is done through a hashmap. What's happening is that, when the user has already clicked an adoptable, this should throw an exception:

elseif($this->adopt->hasVoter($mysidia->user, $date)){
$message = ($mysidia->user instanceof Member)?"already_leveled_member":"already_leveled_ guest";
throw new LevelupException($message);
}

And it stops the levelupview.php page from generating text.

If you don't throw an exception there, the view file will try to access two variables called Reward and Adopt, which are set by the controller only in the case they pass all conditions:

(from levelup.php)
else{
//stuff
$this->setField("adopt", $this->adopt);
$this->setField("reward", new Integer($reward));
}

So it's basically trying to use two variables it can't find in the hashmap:

(from levelupview.php)
$adopt = $this->getField("adopt");
$reward = $this->getField("reward")->getValue();


-----

Maybe try setting both variables at the beginning instead of being inside the else clause?
__________________


asp.net stole my soul.

Last edited by IntoRain; 06-30-2014 at 03:21 PM.
Reply With Quote