- Status: Moved to Github
I added a UINode extension on the \IPS\nexus\Package class but the rowBadge() method is not being executed at all. This happens because the code in the file returns NULL rather than calling the parent Model method that contains the ui() call:
protected function get__badge(): ?array
{
if ( $this->deleteOrMoveQueued() === TRUE )
{
return array(
0 => 'ipsBadge ipsBadge--intermediary',
1 => 'mass_change_purchases_in_progress',
);
}
if( $this->locked )
{
return array(
0 => 'ipsBadge ipsBadge--negative',
1 => 'product_locked'
);
}
return NULL;
}
The parent Model method correctly calls the extension function at the end instead of returning NULL:
protected function get__badge(): ?array
{
if ( $this->deleteOrMoveQueued() === TRUE )
{
return array(
0 => 'ipsBadge ipsBadge--intermediary',
1 => 'node_move_delete_queued',
);
}
/* Check extensions for a possible badge */
return $this->ui( 'rowBadge', array(), true );
}
I tried replacing the NULL return locally with the ui() method and the badge was properly displayed.
Recommended Comments