Name2 Item function tossing error/white page

Forum
Last Post
Threads / Messages

Kandria

Member
Member
Joined
Jul 4, 2020
Messages
43
Points
8
Age
38
Mysidian Dollar
371
14Name2UserThis item function defines items that allow members to change their usernames.

Trying to add this item type to the web site but on testing i'm getting either a white page, or a 500 error page, this is the error kicked into the error log from the attempt.


  Spoiler: Error log 

Code:
[19-Jan-2024 11:53:45 America/Boise] PHP Fatal error:  Uncaught TypeError: Argument 2 passed to Model\DomainModel\ItemFunction::applyName2() must be an instance of Model\DomainModel\Member, instance of Model\DomainModel\OwnedAdoptable given, called in /home4/kaleidx3/public_html/model/domainmodel/itemfunction.php on line 69 and defined in /home4/kaleidx3/public_html/model/domainmodel/itemfunction.php:195
Stack trace:
#0 /home4/kaleidx3/public_html/model/domainmodel/itemfunction.php(69): Model\DomainModel\ItemFunction->applyName2(Object(Model\DomainModel\OwnedItem), Object(Model\DomainModel\OwnedAdoptable))
#1 /home4/kaleidx3/public_html/model/domainmodel/owneditem.php(99): Model\DomainModel\ItemFunction->apply(Object(Model\DomainModel\OwnedItem), Object(Model\DomainModel\OwnedAdoptable))
#2 /home4/kaleidx3/public_html/controller/main/inventorycontroller.php(51): Model\DomainModel\OwnedItem->apply('92')
#3 [internal function]: Controller\Main\InventoryController->uses()
#4 /home4/kaleidx3/public_html/resource/core/frontcontroller.php(196): ReflectionMethod->invoke in /home4/kaleidx3/public_html/model/domainmodel/itemfunction.php on line 195
 
No, it seems it's not implemented yet, but rather then getting the error message that i should have it gave the above errors

Code:
protected function applyName2(OwnedItem $item, Member $user){
        throw new ItemException("For now the items can only be used on adoptables, so user-based item usage will be implemented later.");
    }

Little frustrating as a admin/learning mysidiaa to find items in the function table that don't tell you they're not implemented until you make the item and try to use it.
 

Similar threads

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,277
Messages
33,118
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Top