• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 Error getters XFRM

XenConcept

Formerly Rémi C
#1
Hello,

I have a worry. I add a column "views count" but I get the following error:

Entity :

PHP:
class ResourceItem extends XFCP_ResourceItem
{

    public static function getStructure(Structure $structure)
    {
        $structure = parent::getStructure($structure);

        $structure->columns['views_count'] = ['type' => self::UINT, 'default' => 0, 'forced' => true];

        return $structure;
    }

}
Screenshot_4.png

Modification Template :

Code:
$0

<dl class="pairs pairs--justified structItem-minor structItem-metaItem structItem-metaItem--views">
    <dt>{{ phrase('views') }}</dt>
    <dd>{$resource.views_count|number}</dd>
</dl>

Dump :

Screenshot_5.png
 

Mike

XenForo developer
Staff member
#2
Have you confirmed that your class extension is getting loaded/triggered as you expect? I would guess not.