Snog
Well-known member
I've been getting a lot of reports from people claiming there is a problem with my add-ons when it's not my add-ons causing the problem. I believe it is all from improper user entity extensions and I want to be sure my extensions are correct.
Somehow the errors produced will be something like this...
It's really frustrating because I'm 99.999% certain my add-on extends the entity properly, yet my add-on is mentioned in the errors.
Code:
namespace Snog\MyAddon\XF\Entity;
use XF\Mvc\Entity\Entity;
use XF\Mvc\Entity\Structure;
class User extends XFCP_User
{
public static function getStructure(Structure $structure)
{
$structure = parent::getStructure($structure);
$structure->columns['my_column'] = ['type' => Entity::STR, 'default' => ''];
$structure->defaultWith[] = 'Privacy';
return $structure;
}
}
Somehow the errors produced will be something like this...
Code:
ErrorException: Template error: Method aDifferentAddonFunction is not callable on the given object (Snog\MyAddon\XF\Entity\User) src/XF/Template/Templater.php:935
....
#2 internal_data/code_cache/navigation_cache.php(491): XF\Template\Templater->method(Object(Snog\MyAddon\XF\Entity\User), 'aDifferentAddonFunction', Array)
....
It's really frustrating because I'm 99.999% certain my add-on extends the entity properly, yet my add-on is mentioned in the errors.
Last edited: