Unable to display custom icon

HI everyone,

I am using the latest release of elgg 6

I don't know if this is a bug or a misunderstanding.

I upload icon to an entity this way.

 

$entity->deleteIcon();

$entity->saveIconFromUploadedFile('og_image', 'open_graph_image');

When I try to display the icon this way, nothing is displayed.

elgg_view('output/img', [

'src' => $entity->getIconURL(['type' => 'open_graph_image']),

'class' => 'elgg-photo elgg-field',

]);

But when I change "open_graph_image" by "icon" it works.

It works this way.

$entity->deleteIcon();

$entity->saveIconFromUploadedFile('og_image', 'icon');

Then

elgg_view('output/img', [

'src' => $entity->getIconURL(['type' => 'icon']),

'class' => 'elgg-photo elgg-field',

]);

Could someone help me ?

 

 

 

 

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking